/
.gitlab-ci.yml
53 lines (48 loc) · 1.36 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
44
45
46
47
48
49
50
51
52
53
include:
- project: widas/software-quality/gitlab-template-projects/widas-ci-templates
file: node/npmjs-publish.yml
stages:
- prepare
- test
- release
- publish
- deploy
test_build:
extends: .test_build
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
artifacts:
paths:
- coverage
- dist
- minified
release:
after_script:
- echo "PACKAGE_VERSION=$(git describe --abbrev=0 --tags | grep -E '[0-9]' | cut -b 2-10)" >> build.env
artifacts:
reports:
dotenv: build.env
when: manual
github_sync:
stage: publish
image: bitnami/git
script:
- git config --global --add safe.directory $PWD
- git config --global user.name $GITLAB_USER_NAME
- git config --global user.email $GITLAB_USER_EMAIL
- git checkout master
- git remote -v >> temp
- if grep -q github temp;then echo 'remote github already exists';else git remote add github https://github.com/Cidaas/cidaas-javascript-sdk.git;fi
- rm -rf Dockerfile .gitlab-ci.yml scripts temp
- git add . && git commit -m "fix():cleanup" && git status
- git push https://$USERNAME:$PAT@github.com/Cidaas/cidaas-javascript-sdk.git master -f
only:
- master
when: manual
aws_upload:
extends: .aws_upload
variables:
S3_SRC_PATH: minified
S3_PATH: s3://cidaassdk/javascript/oidc/$PACKAGE_VERSION
only:
- master
when: manual