Skip to content

Commit

Permalink
Merge pull request #5 from bvtujo/buildspec-4.0
Browse files Browse the repository at this point in the history
Buildspec 4.0
  • Loading branch information
bvtujo committed May 22, 2020
2 parents d5a67eb + 53f9355 commit a17d7fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
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

0 comments on commit a17d7fc

Please sign in to comment.