forked from rudderlabs/rudder-transformer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.saas.yml
47 lines (46 loc) · 1.86 KB
/
buildspec.saas.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
version: 0.2
env:
parameter-store:
dockerhub_passwd: "/prod/codebuild/dockerhub-password"
GITHUB_TOKEN: "build-deploy-pkey"
MAIL: "mail-id"
USER_NAME: "user-name"
phases:
install:
runtime-versions:
nodejs: 14
commands:
- wget https://github.com/mikefarah/yq/releases/download/v4.9.6/yq_linux_amd64 -O /usr/bin/yq
- chmod +x /usr/bin/yq
- apt-get update
- apt install -y hub
pre_build:
commands:
- docker login --username rudderlabs --password $dockerhub_passwd
build:
commands:
- VERSION="$(date '+%d%m%Y.%H%M%S')"
- ls
- docker build --build-arg version=${VERSION} -t rudderlabs/rudder-transformer:$VERSION -f Dockerfile .
- docker run rudderlabs/rudder-transformer:$VERSION npm run testDestinations
- docker run rudderlabs/rudder-transformer:$VERSION npm run testVersionedRouter
- echo $?
- docker tag rudderlabs/rudder-transformer:$VERSION rudderlabs/rudder-transformer:latest
post_build:
commands:
- docker push rudderlabs/rudder-transformer:$VERSION
- docker push rudderlabs/rudder-transformer:latest
- git clone https://$GITHUB_TOKEN@github.com/rudderlabs/rudder-devops.git
- git config --global user.email \"$MAIL\"
- git config --global user.name \"$USER_NAME\"
- cd rudder-devops/helm-charts/shared-services/per-az
- git checkout -b shared-transformer-\"$VERSION\"
- yq eval -i ".rudder-transformer.image.tag=\"$VERSION\"" values.blue-release.yaml
- yq eval -i ".rudder-transformer.image.tag=\"$VERSION\"" values.prod.yaml
- git add values.blue-release.yaml values.prod.yaml
- git commit -m "changing version for shared transformer"
- git push -u origin shared-transformer-\"$VERSION\"
- hub pull-request -m "rudder-transformer version change-\"$VERSION\" "
artifacts:
files:
- "**/*"