forked from awslabs/ssosync
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated pipeline: - group Actions into Stages - create Dockerfiles - create buildimage.yml
- Loading branch information
1 parent
03169d7
commit 3618c55
Showing
5 changed files
with
162 additions
and
53 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
pre_build: | ||
commands: | ||
- echo Logging in to Amazon ECR... | ||
- aws ecr get-login-password --region ${Region} | docker login --username AWS --password-stdin ${AccountId}.dkr.ecr.${Region}.amazonaws.com | ||
# Switch to the folder containing the Dockerfile | ||
- cd ${DockerPath} | ||
|
||
# Check to see whether the image already exists | ||
- IMAGE_META="$( aws ecr describe-images --repository-name=${ImageRepo} --image-ids=imageTag=${ImageVersion} ||: )" | ||
- | | ||
if expr ! ${#myvar} : 0; then | ||
echo "Docker Image already exists. Skipping Docker build..." | ||
exit 0 | ||
fi | ||
build: | ||
commands: | ||
- cd ${DockerPath} | ||
- echo Build started on `date` | ||
- echo Building the Docker image... | ||
- docker build --build-arg ImageVersion=${ImageVersion} -t ${ImageRepo}:${ImageVersion} | ||
- docker tag ${ImageRepo}:${ImageVersion} ${AccountId}.dkr.ecr.${Region}.amazonaws.com/${ImageRepo}:${ImageVersion} | ||
|
||
post_build: | ||
commands: | ||
- echo Build completed on `date` | ||
- echo Pushing the Docker image... | ||
- docker push ${AccountId}.dkr.ecr.${Region}.amazonaws.com/${ImageRepo}:${ImageVersion} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
FROM aws/codebuild/standard:5.0 AS build | ||
#Install go.lang | ||
RUN wget -q https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz && \ | ||
tar -C / -xzf go${GO_VERSION}.linux-amd64.tar.gz && \ | ||
export PATH="/go/bin:$PATH" && export GOPATH="/go" && export PATH="$GOPATH/bin:$PATH" && \ | ||
rm go${GO_VERSION}.linux-amd64.tar.gz | ||
RUN wget -q https://storage.googleapis.com/golang/go${ImageVersion}.linux-amd64.tar.gz \ | ||
&& tar -C / -xzf go${ImageVersion}.linux-amd64.tar.gz \ | ||
&& export PATH="/go/bin:$PATH" && export GOPATH="/go" && export PATH="$GOPATH/bin:$PATH" \ | ||
&& rm go${ImageVersion}.linux-amd64.tar.gz | ||
|
||
# Install golint | ||
RUN go install golang.org/x/lint/golint@latest | ||
|
||
# Install staticcheck | ||
RUN go install honnef.co/go/tools/cmd/staticcheck@latest | ||
|
||
# Install Testify to use common assertions and mocks in tests | ||
RUN go get -u github.com/stretchr/testify | ||
|
||
# Install goreleaser | ||
RUN go install github.com/goreleaser/goreleaser@latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM aws/codebuild/standard:5.0 AS build | ||
# Update sam to latest version | ||
RUN wget -q https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip \ | ||
&& unzip -q aws-sam-cli-linux-x86_64.zip -d sam-installation \ | ||
&& sudo ./sam-installation/install --update \ | ||
&& rm -rf ./sam-installation aws-sam-cli-linux-x86_64.zip | ||
|