-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildspec.yml
26 lines (25 loc) · 976 Bytes
/
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
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
- taito artifact prepare:wordpress:$ENV $IMAGE_TAG
- taito wp-plugin-update:$${branch_name} || echo "WARNING: Failed updating wordpress plugins"
# Deploy changes to target environment
- taito deployment deploy:$ENV $IMAGE_TAG
# Release artifacts
- taito artifact release:wordpress:$ENV $IMAGE_TAG
# Release build
- taito build release:$ENV