-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
38 lines (34 loc) · 1.06 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
38 lines (34 loc) · 1.06 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
35
36
37
38
stages:
- yaos
variables:
YAOS_RELEASE_REPO: "kavinsood/yaos"
default:
image: node:20
update_yaos:
stage: yaos
rules:
- when: manual
script:
- node scripts/update-from-release.mjs
- |
if git diff --quiet; then
echo "No YAOS server changes to commit."
exit 0
fi
- VERSION="$(node -p "require('./package.json').version")"
- git config user.name "GitLab CI"
- git config user.email "ci@gitlab"
- git add -A
- git commit -m "yaos(server): update to ${VERSION}"
- git remote set-url origin "https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git"
- git push origin "HEAD:${CI_COMMIT_BRANCH:-$CI_DEFAULT_BRANCH}"
revert_yaos:
stage: yaos
rules:
- when: manual
script:
- node scripts/revert-last-update.mjs
- git config user.name "GitLab CI"
- git config user.email "ci@gitlab"
- git remote set-url origin "https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git"
- git push origin "HEAD:${CI_COMMIT_BRANCH:-$CI_DEFAULT_BRANCH}"