-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.gitlab-ci.yml
43 lines (40 loc) · 1.28 KB
/
.gitlab-ci.yml
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
43
include:
- project: 'meat-n-potatoes/ci'
file: 'all.yml'
ref: v2
stages:
- lint-build-test
- publish
lint-build-test:
extends: .node
stage: lint-build-test
script:
- yarn build
- yarn lint
- yarn test
sync-github-repo:
extends: .sync-github-repo
stage: publish
only: [master]
variables:
GITHUB_SSH_URL: [email protected]:launchcodedev/app-config.git
script:
- test -n "${GITHUB_SSH_URL}" || (echo "No GITHUB_SSH_URL was found" && exit 1)
- test -n "${GITLAB_SSH_URL}" || (echo "No GITLAB_SSH_URL was found" && exit 1)
- ssh-keyscan github.com >> ~/.ssh/known_hosts
- git remote remove github || true
- git remote add github ${GITHUB_SSH_URL}
- git remote remove origin || true
- git remote add origin ${GITLAB_SSH_URL}
# pull any changes made on the github side
- git fetch github ${CI_COMMIT_REF_NAME}
- git merge github/${CI_COMMIT_REF_NAME}
# push whatever master ended up as back to gitlab and github
- git push origin HEAD:${CI_COMMIT_REF_NAME}
- git push github HEAD:${CI_COMMIT_REF_NAME}
# push any tags made in gitlab up to github
- git fetch origin --tags
- git push github --tags
# push any tags made in github up to gitlab
- git fetch github --tags
- git push origin --tags