-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun-clean.sh
executable file
·42 lines (34 loc) · 980 Bytes
/
run-clean.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
BASEDIR=`dirname "$0"`
FULLPATH=`cd "$BASEDIR"; pwd`
cd $FULLPATH
function cleanRepo() {
docker run --rm \
-v $FULLPATH/root:/root \
-v $FULLPATH:/app \
tagplus5/ubuntu-ppa git clone --mirror [email protected]:tagplus5/keeweb-ppa.git app.git
docker run --rm \
-v $FULLPATH:/data \
tagplus5/git-bfg --delete-files *.deb app.git
docker run --rm \
-v $FULLPATH/app.git:/app \
tagplus5/ubuntu-ppa bash -c "git reflog expire --expire=now --all && git gc --prune=now --aggressive"
docker run --rm \
-v $FULLPATH/root:/root \
-v $FULLPATH/app.git:/app \
tagplus5/ubuntu-ppa git push
docker run --rm \
-v $FULLPATH:/app \
tagplus5/ubuntu-ppa rm -rf app.git
}
function newGit() {
docker run --rm \
-v $FULLPATH/root:/root \
-v $FULLPATH:/app \
tagplus5/ubuntu-ppa bash -c "rm -rf .git && \
git clone [email protected]:tagplus5/keeweb-ppa.git app.git && \
mv app.git/.git /app/.git && \
rm -rf app.git"
}
cleanRepo
newGit