Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Goessmann
logging-scratch-gui
Commits
ffba3559
Commit
ffba3559
authored
6 years ago
by
Ray Schamp
Browse files
Options
Downloads
Patches
Plain Diff
Apply to all branches, not only greenkeeper
parent
43f9cd82
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
clean_greenkeeper.sh
+5
-10
5 additions, 10 deletions
clean_greenkeeper.sh
with
5 additions
and
10 deletions
clean_greenkeeper.sh
+
5
−
10
View file @
ffba3559
#!/bin/bash
# gh-pages cleanup script: Switches to gh-pages branch, and removes all
#
greenkeeper/*
directories that aren't listed as remote branches
# directories that aren't listed as remote branches
# Join list of remote greenkeeper/* branches for GLOBIGNORE
# Turns origin/greenkeeper/package-x.x.x, ..., into
# greenkeeper/package-x.x.x:greenkeeper/package:...:
function
join
{
local
IFS
=
":"
;
shift
;
echo
"
${
*#origin/
}
"
;
}
current
=
$(
git rev-parse
--abbrev-ref
HEAD
)
git fetch origin
greenkeeper
=
$(
git branch
-r
--list
origin/
greenkeeper/
*
)
branches
=
$(
git branch
-r
--list
origin/
*
)
git checkout
-f
gh-pages
# Remove all greenkeeper/* directories that aren't remote branch names
GLOBIGNORE
=
$(
join
$greenkeeper
)
rm
-rf
greenkeeper/
*
# Remove all directories that aren't remote branch names
find
*
-type
d
\(
-path
./.git
$(
printf
" -o -path ./%s"
"
${
branches
[@]//origin\//
}
"
)
\)
-prune
-o
-type
d
-exec
rm
-rfvi
"
$0
"
{}
\;
git add
-u
git commit
-m
"Remove
old greenkeeper
directories"
git commit
-m
"Remove
stale
directories"
git push origin
# Return to where we were
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment