-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
62 lines (54 loc) · 1.32 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:
- build
- test
- release
- deploy
- cleanup
variables:
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
.sharedBeforeScript: &sharedBeforeScript
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
build:
stage: build
<<: *sharedBeforeScript
script:
- npm install --unsafe-perm
- ls -lha packages/storybook/
- docker build --pull -t $CONTAINER_RELEASE_IMAGE .
layers:
stage: test
script:
- docker history --no-trunc $CONTAINER_RELEASE_IMAGE
feature:
stage: release
when: manual
except:
- master
- stage
<<: *sharedBeforeScript
script:
- npm install --unsafe-perm
- docker build --pull -t $CONTAINER_RELEASE_IMAGE .
- docker push $CONTAINER_RELEASE_IMAGE
- docker rmi -f $(docker images --filter=reference="$CONTAINER_RELEASE_IMAGE" -q)
release:
stage: release
only:
- master
- stage
<<: *sharedBeforeScript
script:
- docker push $CONTAINER_RELEASE_IMAGE
deploy_master:
only:
- master
stage: deploy
environment: master
script:
- 'curl -X POST "https://kubr.yeebase.net/yeebase.kubr/webhook/deploy?apikey=RM8vKrnr5XBRLvHKW8Qt7gqO&name=Live"'
cleanup:
stage: cleanup
script:
- docker rmi -f $(docker images --filter=reference="$CONTAINER_RELEASE_IMAGE" -q)
when: always