-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
64 lines (58 loc) · 1.78 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
63
64
services:
- mongo:latest
stages:
- test
- deploy
test:
stage: test
image: bhdouglass/openstore-ci
before_script:
- npm install
script:
- npm run lint
- npm run lint:json
- npm run test:ci
- npm run build
deploy:
stage: deploy
only:
- master
image: bhdouglass/openstore-ci
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
script:
- VERSION=$(date +"%Y-%m-%d_%H-%M-%S")
- echo $VERSION
- npm install
- npm run build
- rsync -av --delete --exclude node_modules --exclude ".*" . [email protected]:/srv/openstore-api/$VERSION
- ssh [email protected] "/srv/openstore-api/$VERSION/deploy/post-deploy.sh $VERSION"
deploy_staging:
stage: deploy
only:
- staging
image: bhdouglass/openstore-ci
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
script:
- ENV=-staging
- VERSION=$(date +"%Y-%m-%d_%H-%M-%S")
- echo $VERSION
- npm install
- npm run build
- rsync -av --delete --exclude node_modules --exclude ".*" . [email protected]:/srv/openstore-api$ENV/$VERSION
- ssh [email protected] "/srv/openstore-api$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