forked from aws/copilot-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
50 lines (49 loc) · 1.93 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
version: 0.2
phases:
install:
runtime-versions:
golang: 1.14
pre_build:
commands:
- echo "cd into $CODEBUILD_SRC_DIR"
- cd $CODEBUILD_SRC_DIR
- export GOMOD=$CODEBUILD_SRC_DIR/go.mod:GOMOD
- export GOPATH="/go"
build:
commands:
- echo "Compilation context:"
- echo "CODEBUILD_SOURCE_VERSION=$CODEBUILD_SOURCE_VERSION"
- make tools
- make release
finally:
- echo "Built artifacts:"
- ls -lah ./bin/local
- ./bin/local/copilot-linux-amd64 --version
post_build:
commands:
- VERSION=`./bin/local/copilot-linux-amd64 --version`
- VERSION=`echo $VERSION | grep -oE "[^ ]+$"`
- COMMIT_VERSION=`git rev-parse --short HEAD`
- echo "Creating version-tagged artifacts..."
- ARTIFACT_DIRECTORY=aws/copilot
- mkdir -p $ARTIFACT_DIRECTORY
- mv ./bin/local/copilot.exe $ARTIFACT_DIRECTORY/copilot-windows-$VERSION.exe
- mv ./bin/local/copilot $ARTIFACT_DIRECTORY/copilot-darwin-$VERSION
- cp ./bin/local/copilot-linux-amd64 $ARTIFACT_DIRECTORY/copilot-linux-$VERSION
- mv ./bin/local/copilot-linux-amd64 $ARTIFACT_DIRECTORY/copilot-linux-amd64-$VERSION
- mv ./bin/local/copilot-linux-arm64 $ARTIFACT_DIRECTORY/copilot-linux-arm64-$VERSION
- echo "Creating manifest file..."
- COMMIT_ID=`git rev-parse HEAD`
- MANIFESTFILE="$COMMIT_ID.manifest"
- echo $ARTIFACT_DIRECTORY/copilot-windows-$VERSION.exe >> $MANIFESTFILE
- echo $ARTIFACT_DIRECTORY/copilot-darwin-$VERSION >> $MANIFESTFILE
- echo $ARTIFACT_DIRECTORY/copilot-linux-$VERSION >> $MANIFESTFILE
- echo $ARTIFACT_DIRECTORY/copilot-linux-amd64-$VERSION >> $MANIFESTFILE
- echo $ARTIFACT_DIRECTORY/copilot-linux-arm64-$VERSION >> $MANIFESTFILE
finally:
- echo "Built artifacts:"
- ls -lah $ARTIFACT_DIRECTORY
- $ARTIFACT_DIRECTORY/copilot-linux-$VERSION --version
artifacts:
files:
- '**/*'