-
Notifications
You must be signed in to change notification settings - Fork 1
/
bitbucket-pipelines.yml
124 lines (115 loc) · 4.34 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
116
117
118
119
120
121
122
123
124
definitions:
services:
postgres:
image: postgres:9.6
environment:
POSTGRES_DB: ara
POSTGRES_USER: ara
POSTGRES_PASSWORD: ara
steps:
- step: &unit-tests
name: Unit tests
image: golang:1.23
script:
- export TZ=Europe/Paris LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
- apt-get update
- mkdir -p /usr/share/man/man1 /usr/share/man/man7
- export PACKAGES="build-essential ruby-dev libpq-dev libxml2-dev zlib1g-dev git-core postgresql-client-common libproj-dev"
- export BUNDLER_VERSION=$(tail -n1 Gemfile.lock)
- apt-get -y install --no-install-recommends locales $PACKAGES
- echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
- gem install bundler -v $BUNDLER_VERSION
# FIXME
- export BASE_PATH="${GOPATH}/src/bitbucket.org/enroute-mobi"
- mkdir -p ${BASE_PATH}
- export IMPORT_PATH="${BASE_PATH}/ara"
- ln -s ${PWD} ${IMPORT_PATH}
- cd ${IMPORT_PATH}
- bundle install --jobs 4 --deployment --path=ruby/vendor/
- export ARA_DB_NAME=ara ARA_DB_USER=ara ARA_DB_PASSWORD=ara ARA_DB_HOST=localhost
- export ARA_CONFIG=$PWD/config
- ./ci.sh
services:
- postgres
pipelines:
default:
- step: *unit-tests
branches:
master:
- parallel:
- step: *unit-tests
- step:
name: Build Docker
image:
name: us.gcr.io/enroute-interne/enroute-cloud-sdk:latest
username: _json_key
password: "$GCLOUD_API_KEYFILE"
caches:
- docker
services:
- docker
script:
- ./script/bitbucket-gcloud-configure-docker.sh
- ./script/bitbucket-build-docker.sh
- step:
name: Deploy to test
image:
name: eu.gcr.io/enroute-interne/enroute-cloud-sdk:latest
username: _json_key
password: "$GCLOUD_API_KEYFILE"
deployment: test
runs-on:
- self.hosted
- env.interne
- deploy
script:
- git clone [email protected]:enroute-mobi/ara-env.git env
- env/deploy-with-runner.sh
- pipe: atlassian/datadog-send-event:2.2.0
variables:
API_KEY: $DATADOG_KEY
TITLE: "Build ${BITBUCKET_BUILD_NUMBER} deployed on ara ${BITBUCKET_DEPLOYMENT_ENVIRONMENT}"
PAYLOAD: >
{ "source_type_name": "BITBUCKET", "tags":["env:test","app:ara","repository:ara"] }
- step:
name: Deploy to staging
image:
name: eu.gcr.io/enroute-interne/enroute-cloud-sdk:latest
username: _json_key
password: "$GCLOUD_API_KEYFILE"
deployment: staging
trigger: manual
runs-on:
- self.hosted
- env.interne
- deploy
script:
- git clone [email protected]:enroute-mobi/ara-env.git env
- env/deploy-with-runner.sh
- pipe: atlassian/datadog-send-event:2.2.0
variables:
API_KEY: $DATADOG_KEY
TITLE: "Build ${BITBUCKET_BUILD_NUMBER} deployed on ara ${BITBUCKET_DEPLOYMENT_ENVIRONMENT}"
PAYLOAD: >
{ "source_type_name": "BITBUCKET", "tags":["env:staging","app:ara","repository:ara"] }
- step:
name: Deploy to production
image:
name: eu.gcr.io/enroute-interne/enroute-cloud-sdk:latest
username: _json_key
password: "$GCLOUD_API_KEYFILE"
deployment: production
trigger: manual
runs-on:
- self.hosted
- env.production
- deploy
script:
- git clone [email protected]:enroute-mobi/ara-env.git env
- env/deploy-with-runner.sh
- pipe: atlassian/datadog-send-event:2.2.0
variables:
API_KEY: $DATADOG_KEY
TITLE: "Build ${BITBUCKET_BUILD_NUMBER} deployed on ara ${BITBUCKET_DEPLOYMENT_ENVIRONMENT}"
PAYLOAD: >
{ "source_type_name": "BITBUCKET", "tags":["env:production","app:ara","repository:ara"] }