-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
30 lines (29 loc) · 1.07 KB
/
buildspec.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
version: 0.2
env:
variables:
taito_mode: "ci"
phases:
pre_build:
commands:
# Determine ENV and IMAGE_TAG
- export ENV=$(git branch -a --contains HEAD | sed -n 2p | awk '{ printf $1 }' | xargs echo $CODEBUILD_WEBHOOK_HEAD_REF | awk '{ printf $1 }' | sed 's/.*\///')
- export IMAGE_TAG=$CODEBUILD_RESOLVED_SOURCE_VERSION
# TODO: Cancel other ongoing builds for $ENV
# - taito deployment cancel:$ENV $CURRENT_BUILD_ID
# Prepare build
- taito build prepare:$ENV $IMAGE_TAG
build:
commands:
# Prepare artifacts for deployment (TODO: can be executed parallel)
- taito artifact prepare:server:$ENV $IMAGE_TAG
# Deploy changes to target environment
- taito db deploy:$ENV
- taito deployment deploy:$ENV $IMAGE_TAG
# Test and verify deployment
- taito deployment wait:$ENV
- taito test:$ENV
- taito deployment verify:$ENV
# Release artifacts (TODO: can be executed parallel)
- taito artifact release:server:$ENV $IMAGE_TAG
# Release build
- taito build release:$ENV