-
Notifications
You must be signed in to change notification settings - Fork 1
/
bitbucket-pipelines.yml
71 lines (70 loc) · 2.44 KB
/
bitbucket-pipelines.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
image:
name: $template_default_taito_image
username: $template_default_taito_image_username
password: $template_default_taito_image_password
email: $template_default_taito_image_email
options:
docker: true
max-time: 60
definitions:
services:
docker:
memory: 3072
pipelines:
branches:
"{dev,test,stag,canary,master}":
# Prepare build
- step:
script:
- export taito_mode=ci
- taito build prepare:$BITBUCKET_BRANCH
artifacts:
- taitoflag_version
- taitoflag_images_exist
# Prepare artifacts in parallel
- parallel:
- step: # www prepare
script:
- export taito_mode=ci
- taito artifact prepare:www:$BITBUCKET_BRANCH $BITBUCKET_COMMIT true
artifacts:
- www.docker
- www-tester.docker
- step: # webhook prepare
script:
- export taito_mode=ci
- taito artifact prepare:webhook:$BITBUCKET_BRANCH $BITBUCKET_COMMIT "" false ./www ./www Dockerfile.webhook
artifacts:
- webhook.docker
- webhook-tester.docker
# Deploy the changes to target environment
- step:
script:
- export taito_mode=ci
- taito deployment deploy:$BITBUCKET_BRANCH $BITBUCKET_COMMIT
# Test and verify deployment
- step:
script:
- export taito_mode=ci
- "taito -v artifact-load: tester"
- taito deployment wait:$BITBUCKET_BRANCH
- taito test:$BITBUCKET_BRANCH
- taito deployment verify:$BITBUCKET_BRANCH
# # TODO: revert deployment on fail
# after-script:
# - [ $BITBUCKET_EXIT_CODE != 0 ] && taito deployment-revert:$BITBUCKET_BRANCH $BITBUCKET_COMMIT || :
# Release artifacts (push previously built container images with a new tag)
- parallel:
- step: # www release
script:
- export taito_mode=ci
- taito artifact release:www:$BITBUCKET_BRANCH $BITBUCKET_COMMIT
- step: # webhook release
script:
- export taito_mode=ci
- taito artifact release:webhook:$BITBUCKET_BRANCH $BITBUCKET_COMMIT
# Release build
- step:
script:
- export taito_mode=ci
- taito build release:$BITBUCKET_BRANCH