Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buildspec 4.0 #5

Merged
merged 3 commits into from
May 22, 2020
Merged
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
1 change: 0 additions & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pull_request_rules:
- base~=master
- "#approved-reviews-by>=2"
- approved-reviews-by=@aws/aws-ecs-devx
- status-success=AWS CodeBuild us-west-2 (ecs-cli-ci)
- status-success=continuous-integration/travis-ci/pr
- -approved-reviews-by~=author
- -title~=(WIP|wip)
Expand Down
21 changes: 10 additions & 11 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,23 @@ phases:
# so we copy all the source code to the appropriate location before
# invoking any go command
- ls -lah
- mkdir -p /go/1.13.8/src/github.com/aws/amazon-ecs-cli
- cp -R . /go/1.13.8/src/github.com/aws/amazon-ecs-cli/
- |
env -i PATH=$PATH GOPATH=`go env GOPATH` GOROOT=`go env GOROOT` GOCACHE=`go env GOCACHE` \
go test -race -v -cover github.com/aws/amazon-ecs-cli/ecs-cli/modules/...
- mkdir -p /go/src/github.com/aws/amazon-ecs-cli
- cp -R . /go/src/github.com/aws/amazon-ecs-cli/
- cd /go/src/github.com/aws/amazon-ecs-cli
- go test -race -v -cover ./ecs-cli/modules/...
# make a copy of the version.go because `go run gen/version-gen.go` will
# modify it.
- cp /go/1.13.8/src/github.com/aws/amazon-ecs-cli/ecs-cli/modules/version/version.go /go/1.13.8/src/github.com/aws/amazon-ecs-cli/ecs-cli/modules/version/_version.go
- cp ./ecs-cli/modules/version/version.go ./ecs-cli/modules/version/_version.go
# need to cd into the version package because version-gen.go assumes the relative
# location of the VERSION file.
- cd /go/1.13.8/src/github.com/aws/amazon-ecs-cli/ecs-cli/modules/version/
- cd ./ecs-cli/modules/version/
# since we are running the go program inside a Linux container, has to hardcode
# the GOOS and GOARCH correspondinly regardless of what the host OS is.
- GOOS=linux GOARCH=amd64 ECS_RELEASE=cleanbuild go run gen/version-gen.go
build:
commands:
- echo "cd into $CODEBUILD_SRC_DIR"
- cd $CODEBUILD_SRC_DIR
- cd /go/src/github.com/aws/amazon-ecs-cli
- echo "Compilation context:"
- echo "CODEBUILD_SOURCE_VERSION=$CODEBUILD_SOURCE_VERSION"
- VERSION=`git tag --points-at HEAD`
Expand All @@ -46,9 +45,9 @@ phases:
echo "the VERSION file contains a version number that is different from the git tag. file: $CHECKED_IN_VERSION, tag: $VERSION"
exit 1
fi
- GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -installsuffix cgo -a -ldflags "-s" -o aws/amazon-ecs-cli/ecs-cli-windows-amd64-$VERSION.exe github.com/aws/amazon-ecs-cli/ecs-cli/
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -installsuffix cgo -a -ldflags "-s" -o aws/amazon-ecs-cli/ecs-cli-linux-amd64-$VERSION github.com/aws/amazon-ecs-cli/ecs-cli/
- GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -installsuffix cgo -a -ldflags "-s" -o aws/amazon-ecs-cli/ecs-cli-darwin-amd64-$VERSION github.com/aws/amazon-ecs-cli/ecs-cli/
- GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -installsuffix cgo -a -ldflags "-s" -o aws/amazon-ecs-cli/ecs-cli-windows-amd64-$VERSION.exe ./ecs-cli/
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -installsuffix cgo -a -ldflags "-s" -o aws/amazon-ecs-cli/ecs-cli-linux-amd64-$VERSION ./ecs-cli/
- GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -installsuffix cgo -a -ldflags "-s" -o aws/amazon-ecs-cli/ecs-cli-darwin-amd64-$VERSION ./ecs-cli/
finally:
- echo "built artifacts:"
- ls -lah aws/amazon-ecs-cli/
Expand Down