-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
62 lines (57 loc) · 1.83 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
54
55
56
57
58
59
60
61
62
stages:
- test
- deploy
test:
stage: test
image: bhdouglass/openstore-ci:20
before_script:
- npm install
script:
- npm run translations
- npm run generate-icons
- npm run lint
deploy:
stage: deploy
only:
- master
image: bhdouglass/openstore-ci:20
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- npm install
script:
- VERSION=$(date +"%Y-%m-%d_%H-%M-%S")
- echo $VERSION
- npm run translations
- npm run generate-icons
- rsync -av --delete --exclude node_modules --exclude ".git" . [email protected]:/srv/openstore-web/$VERSION
- ssh [email protected] "/srv/openstore-web/$VERSION/deploy/post-deploy.sh $VERSION"
deploy_staging:
stage: deploy
only:
- staging
image: bhdouglass/openstore-ci:20
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- npm install
script:
- ENV=-staging
- VERSION=$(date +"%Y-%m-%d_%H-%M-%S")
- echo $VERSION
- npm run translations
- npm run generate-icons
- rsync -av --delete --exclude node_modules --exclude ".git" . [email protected]:/srv/openstore-web$ENV/$VERSION
- ssh [email protected] "/srv/openstore-web$ENV/$VERSION/deploy/post-deploy.sh $VERSION $ENV"
sast:
variables:
SAST_EXCLUDED_PATHS: spec, test, tests, tmp, po, deploy
SAST_EXCLUDED_ANALYZERS: bandit, brakeman, eslint, flawfinder, gosec, kubesec,
phpcs-security-audit, pmd-apex, security-code-scan, sobelow, spotbugs
stage: test
include:
- template: Security/SAST.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml