Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ get-deps-init:
cd "${GOPATH}/src/github.com/golang/mock/mockgen" && git checkout 1.3.1 && go get ./... && go install ./... && cd -
GO111MODULE=on go get github.com/fzipp/gocyclo/cmd/[email protected]
go get golang.org/x/tools/cmd/goimports
go get honnef.co/go/tools/cmd/staticcheck
GO111MODULE=on go get honnef.co/go/tools/cmd/staticcheck@v0.2.1

.amazon-linux-rpm-integrated-done:
./scripts/update-version.sh
Expand Down
64 changes: 64 additions & 0 deletions buildspecs/build-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
version: 0.2

env:
variables:
# Github username of the forked repo on which to make builds
GITHUBUSERNAME: prateekchaudhry

phases:
install:
commands:
- go version
- architecture=""
# Same buildspec for different architectures - detect the architecture here and rename the artifacts accordingly
- case $(uname -m) in
x86_64)
architecture="amd64"
;;
aarch64)
architecture="arm64"
;;
esac

# Tested with GOVERSION 1.15.x and 1.17.x
- GOVERSION="$(cat GO_VERSION)"
- BUILD_LOG="build_${architecture}.log"
- GOLANG_TAR="go${GOVERSION}.linux-${architecture}.tar.gz"

# Need to install GOLANG explicitly as required versions do not come preinstalled
- wget -O /tmp/${GOLANG_TAR} https://storage.googleapis.com/golang/${GOLANG_TAR} 2>&1 | tee $BUILD_LOG
- tar -C /usr/local -xzf /tmp/${GOLANG_TAR} 2>&1 | tee -a $BUILD_LOG
- go version

# glibc-static required for dockerfree make method
- echo "Install glibc-static for dockerfree make method" | tee -a $BUILD_LOG
- yum -y install glibc-static 2>&1 | tee -a $BUILD_LOG
build:
commands:
- go version
- echo "build_id = $CODEBUILD_LOG_PATH" 2>&1 | tee -a $BUILD_LOG
- echo Building agent image 2>&1 | tee -a $BUILD_LOG
- AGENT_VERSION=$(cat VERSION)
- ECS_AGENT_TAR="ecs-agent-v${AGENT_VERSION}.tar"
- echo $(pwd) 2>&1 | tee -a $BUILD_LOG

# Path readjustment for codebuild testing with fork due to cni plugins - may not needed when deploying with main account
- cd ../..
- mv $GITHUBUSERNAME aws
- cd aws/amazon-ecs-agent

- GO111MODULE=auto
- make dockerfree-agent-image 2>&1 | tee -a $BUILD_LOG
# Rename artifacts for architecture
- |
if [[ $architecture == "arm64" ]] ; then
mv $ECS_AGENT_TAR "ecs-agent-arm64-v${AGENT_VERSION}.tar"
ECS_AGENT_TAR="ecs-agent-arm64-v${AGENT_VERSION}.tar"
fi
post_build:
commands:
artifacts:
files:
- $ECS_AGENT_TAR
- $BUILD_LOG
name: $CODEBUILD_RESOLVED_SOURCE_VERSION