-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildspec.yml
More file actions
36 lines (35 loc) · 1.45 KB
/
buildspec.yml
File metadata and controls
36 lines (35 loc) · 1.45 KB
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
version: 0.2
env:
variables:
AWS_DEFAULT_REGION: "us-east-1"
MIX_ENV: "test"
phases:
install:
commands:
- BUILD_NAME=$(echo $CODEBUILD_BUILD_ID | cut -d':' -f1)
- BUILD_ID=$(echo $CODEBUILD_BUILD_ID | cut -d':' -f2)
- BUILD_URL=$(echo "https://$AWS_DEFAULT_REGION.console.aws.amazon.com/codesuite/codebuild/projects/$BUILD_NAME/build/$BUILD_NAME%3A$BUILD_ID")
pre_build:
commands:
- echo "Revoking approval"
- aws codecommit update-pull-request-approval-state --pull-request-id $PULL_REQUEST_ID --approval-state REVOKE --revision-id $REVISION_ID;
- echo "Checkout code"
- git checkout $SOURCE_COMMIT
build:
commands:
- docker-compose --env MIX_ENV=test run --rm test
post_build:
commands:
- |
if [ $CODEBUILD_BUILD_SUCCEEDING = 1 ]; then
aws codecommit update-pull-request-approval-state --pull-request-id $PULL_REQUEST_ID --approval-state APPROVE --revision-id $REVISION_ID;
content="✔️ Pull request build SUCCEEDED! "
else
content="❌ Pull request build FAILED "
fi
- aws codecommit post-comment-for-pull-request --pull-request-id $PULL_REQUEST_ID --repository-name $REPOSITORY_NAME --before-commit-id $DESTINATION_COMMIT --after-commit-id $SOURCE_COMMIT --content "$content"
reports:
coverage-report:
files:
- 'cover/excoveralls.json'
file-format: 'SIMPLECOV'