forked from robertmassaioli/ep-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
115 lines (112 loc) · 4.88 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
115
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:14
options:
docker: true
size: 2x
deploymentScript: &deploymentScript
script:
- cd remotes/connect
# Download and extract Atlas CLI
- curl -fL https://statlas.prod.atl-paas.net/atlas-cli/linux/atlas-latest-linux-amd64.tar.gz | tar -xzp atlas
# Install the Micros plugin
- ./atlas plugin install -n micros
# Lastly, run the deployment as normal
- ./atlas micros service deploy -s my-cool-service -f my-cool-service.sd.yml -e $BITBUCKET_DEPLOYMENT_ENVIRONMENT
pipelines:
default:
- parallel:
steps:
- step:
name: Remote Build & Test
caches:
- node
script: # Modify the commands below to build your repository.
- cd remotes/connect
- npm install
- npm run test
- npm run build
- step:
name: Custom UI Frontend Build & Test
caches:
- node
script:
- cd static/hello-world
- yarn
- yarn lint
- yarn build
branches:
master:
- step:
name: Build docker image
script:
# Used for accessing packages.atlassian.com
- pipe: docker://atlassian/artifactory-sidekick:latest
variables:
COMPLIANT: "true"
- source .artifactory/activate.sh
# set up step variables and auth data
- export DOCKER_URL="docker-proxy.services.atlassian.com"
- echo $PIPELINES_JWT_TOKEN | docker login -u=sox --password-stdin docker-proxy.services.atlassian.com
# build base image (node@alpine + python dependencies + hugo)
- cd remotes/connect
- docker build --tag="${DOCKER_URL}/sox/atlassian/ep-tool:${BITBUCKET_BUILD_NUMBER}" .
- docker push "${DOCKER_URL}/sox/atlassian/ep-tool:${BITBUCKET_BUILD_NUMBER}"
services:
- docker
caches:
- docker
- step:
name: Deploy to staging
deployment: adev
script:
# set up step variables and auth data
- export DOCKER_URL="docker-proxy.services.atlassian.com"
- export MICROS_TOKEN="$MICROS_TOKEN:$PIPELINES_JWT_TOKEN"
- export MICROS_URL="wss://micros-proxy.services.atlassian.com"
- echo $PIPELINES_JWT_TOKEN | docker login -u=sox --password-stdin docker-proxy.services.atlassian.com
- cd remotes/connect
# Download and extract Atlas CLI
- curl -fL https://statlas.prod.atl-paas.net/atlas-cli/linux/atlas-latest-linux-amd64.tar.gz | tar -xzp atlas
# Install the Micros plugin
- ./atlas plugin install -n micros
# generate the service descriptor
- echo "RELEASE_VERSION" > "template-vars.csv"
- echo "${BITBUCKET_BUILD_NUMBER}" >> "template-vars.csv"
- npm install mustang
- $(npm bin)/mustang -t "service-descriptor.template.json" -i "template-vars.csv" > "service-descriptor.json"
# Lastly, run the deployment as normal
- ./atlas micros service deploy -s ep-tool -f service-descriptor.json -e $BITBUCKET_DEPLOYMENT_ENVIRONMENT
services:
- docker
caches:
- docker
- step:
name: Deploy to prod
deployment: prod-east
trigger: manual
script:
# set up step variables and auth data
- export DOCKER_URL="docker-proxy.services.atlassian.com"
- export MICROS_TOKEN="$MICROS_TOKEN:$PIPELINES_JWT_TOKEN"
- export MICROS_URL="wss://micros-proxy.services.atlassian.com"
- echo $PIPELINES_JWT_TOKEN | docker login -u=sox --password-stdin docker-proxy.services.atlassian.com
- cd remotes/connect
# Download and extract Atlas CLI
- curl -fL https://statlas.prod.atl-paas.net/atlas-cli/linux/atlas-latest-linux-amd64.tar.gz | tar -xzp atlas
# Install the Micros plugin
- ./atlas plugin install -n micros
# generate the service descriptor
- echo "RELEASE_VERSION" > "template-vars.csv"
- echo "${BITBUCKET_BUILD_NUMBER}" >> "template-vars.csv"
- npm install mustang
- $(npm bin)/mustang -t "service-descriptor.template.json" -i "template-vars.csv" > "service-descriptor.json"
# Lastly, run the deployment as normal
- ./atlas micros service deploy -s ep-tool -f service-descriptor.json -e $BITBUCKET_DEPLOYMENT_ENVIRONMENT
services:
- docker
caches:
- docker