-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
120 lines (111 loc) · 2.57 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
variables:
CDP_IMAGE: ouestfrance/cdp:latest
NODE_IMAGE: matthieupresse/php7-node14:latest # CF ./utils/Dockerfile-build-cdp
stages:
- build
- check
- package
- deploy
build:
image: $NODE_IMAGE
stage: build
script:
- yarn install
- npx gulp html
- npm run build-storybook
artifacts:
paths:
- dist
expire_in: 1day
only:
- branches
tags:
- int
checknpublish:
image: $NODE_IMAGE
stage: check
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- echo "$SSH_PRIVATE_KEY"
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "Host *.upload.akamai.com" > ~/.ssh/config
- echo "HostKeyAlgorithms +ssh-dss" >> ~/.ssh/config
- echo "PubkeyAcceptedKeyTypes +ssh-dss" >> ~/.ssh/config
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config'
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- echo ${NPM_TOKEN}
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ./.npmrc
script:
- yarn install
- npx gulp clean
- npx gulp make-prod-assets
- npm run checknpublish
only:
- master
tags:
- int
package_review:
image: $CDP_IMAGE
stage: package
script:
- cdp docker --image-tag-branch-name --use-gitlab-registry
dependencies:
- build
only:
- branches
except:
- master
- develop
tags:
- int
package_staging:
image: $CDP_IMAGE
stage: package
script:
- cdp docker --image-tag-branch-name --use-aws-ecr
dependencies:
- build
only:
- master
- develop
tags:
- int
deploy_review:
image: $CDP_IMAGE
stage: deploy
script:
- cdp k8s --internal-port=80 --use-gitlab-registry --namespace-project-branch-name --image-tag-branch-name --delete-labels=120 --create-default-helm --image-pull-secret
environment:
name: review/$CI_COMMIT_REF_NAME
only:
- branches
except:
- master
- develop
tags:
- int
deploy_staging:
image: $CDP_IMAGE
stage: deploy
script:
- cdp k8s --internal-port=80 --use-aws-ecr --namespace-project-name --image-tag-branch-name --create-default-helm --image-pull-secret
environment:
name: review/$CI_COMMIT_REF_NAME
only:
- develop
tags:
- staging
deploy_prod:
image: $CDP_IMAGE
stage: deploy
script:
- cdp k8s --internal-port=80 --use-aws-ecr --namespace-project-name --image-tag-branch-name --create-default-helm --image-pull-secret
environment:
name: review/$CI_COMMIT_REF_NAME
only:
- master
tags:
- prod