forked from pinknetworkx/eosio-contract-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
114 lines (110 loc) · 3.9 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
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
image: node:16-alpine
definitions:
steps:
- step: &code-linting-and-building
name: Code linting and building
runs-on:
- 'self.hosted'
script:
- yarn install --frozen-lockfile
- yarn lint
- yarn build
caches:
- node
- step: &docker-build
name: Docker build
runs-on:
- 'self.hosted'
script:
- apk add --no-cache jq
- export DOCKER_REPOSITORY=eosio-contract-api
- export TAG1="${DOCKER_ORGANIZATION}/${DOCKER_REPOSITORY}:${BITBUCKET_BRANCH}-${BITBUCKET_BUILD_NUMBER}"
- export TAG2="${DOCKER_ORGANIZATION}/${DOCKER_REPOSITORY}:${BITBUCKET_COMMIT::7}"
- export TAG3="${DOCKER_ORGANIZATION}/${DOCKER_REPOSITORY}:$(jq -r .version package.json)"
- export TAG4="${DOCKER_ORGANIZATION}/${DOCKER_REPOSITORY}:latest"
- docker build --tag "${TAG1}" --tag "${TAG2}" --tag "${TAG3}" --tag "${TAG4}" .
- echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
- docker push "${TAG1}"
- docker push "${TAG2}"
- docker push "${TAG3}"
- docker push "${TAG4}"
- echo -e "Image names:\n${TAG1}\n${TAG2}\n${TAG3}\n${TAG4}"
caches:
- docker
services:
- docker
- step: &deployment
name: Deployment
runs-on:
- 'self.hosted'
deployment: production
trigger: manual
script:
- pipe: &trigger-pipeline atlassian/trigger-pipeline:5.0.0
variables: &deployment-variables
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
REPOSITORY: $BITBUCKET_REPOSITORY
ACCOUNT: $BITBUCKET_ACCOUNT
CUSTOM_PIPELINE_NAME: 'deployment-pipeline'
PIPELINE_VARIABLES: >
[{
"key": "BITBUCKET_COMMIT",
"value": "$BITBUCKET_COMMIT"
}]
WAIT: 'true'
WAIT_MAX_TIMEOUT: '600'
pipelines:
pull-requests:
'**':
- step: *code-linting-and-building
branches:
master:
- step: *code-linting-and-building
- step: *docker-build
- parallel:
- step:
<<: *deployment
name: Deployment to aws-proton-testnet-1
deployment: aws-proton-testnet-1
script:
- pipe: *trigger-pipeline
variables:
<<: *deployment-variables
CUSTOM_PIPELINE_NAME: 'aws-proton-testnet-1'
- step:
<<: *deployment
name: Deployment to aws-wax-testnet-1
deployment: aws-wax-testnet-1
script:
- pipe: *trigger-pipeline
variables:
<<: *deployment-variables
CUSTOM_PIPELINE_NAME: 'aws-wax-testnet-1'
- step:
<<: *deployment
name: Deployment to aws-proton-mainnet-1
deployment: aws-proton-mainnet-1
script:
- pipe: *trigger-pipeline
variables:
<<: *deployment-variables
CUSTOM_PIPELINE_NAME: 'aws-proton-mainnet-1'
- step:
<<: *deployment
name: Deployment to aws-wax-mainnet-1
deployment: aws-wax-mainnet-1
script:
- pipe: *trigger-pipeline
variables:
<<: *deployment-variables
CUSTOM_PIPELINE_NAME: 'aws-wax-mainnet-1'
- step:
<<: *deployment
name: Deployment to aws-eos-mainnet-1
deployment: aws-eos-mainnet-1
script:
- pipe: *trigger-pipeline
variables:
<<: *deployment-variables
CUSTOM_PIPELINE_NAME: 'aws-eos-mainnet-1'