-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
34 lines (33 loc) · 1.53 KB
/
.gitlab-ci.yml
File metadata and controls
34 lines (33 loc) · 1.53 KB
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
backup:
image: ubuntu:latest
rules:
- if: $CI_PIPELINE_SOURCE == 'push'
script:
- |
apt update
apt install -y --no-install-recommends git openssh-client ca-certificates
git pull --unshallow origin $CI_COMMIT_REF_NAME
chmod 400 $id_ed25519
git -c core.sshCommand="ssh -i $id_ed25519 -o StrictHostKeyChecking=no" push -f git@framagit.org:chaowenguo/$CI_PROJECT_NAME HEAD:$CI_COMMIT_REF_NAME
clean:
image: ubuntu:latest
rules:
- if: $CI_PIPELINE_SOURCE == 'schedule'
script:
- |
apt update
apt install -y --no-install-recommends git openssh-client ca-certificates curl moreutils
curl https://deb.nodesource.com/setup_current.x | bash -
apt install -y --no-install-recommends nodejs
git ls-files -z | xargs -0 -I {} bash -c 'base64 {} | sponge {}'
git add -A
git config --global user.email dummy
git config --global user.name dummy
git commit --allow-empty-message -m \
chmod 400 $id_ed25519
git -c core.sshCommand="ssh -i $id_ed25519 -o StrictHostKeyChecking=no" push -f git@gitlab.com:chaowenguo/$CI_PROJECT_NAME HEAD:$CI_COMMIT_REF_NAME
git ls-files -z | xargs -0 -I {} bash -c 'base64 -d {} | sponge {}'
git add -A
git commit --allow-empty-message -m \
git -c core.sshCommand="ssh -i $id_ed25519 -o StrictHostKeyChecking=no" push -f git@gitlab.com:chaowenguo/$CI_PROJECT_NAME HEAD:$CI_COMMIT_REF_NAME
curl https://bitbucket.org/chaowenguo/common/raw/main/clean.mjs | node --input-type=module - $token