-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from SoManyHs/arm-support
chore: support ARM architecture
- Loading branch information
Showing
14 changed files
with
2,553 additions
and
37 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -19,3 +19,7 @@ out/ | |
.idea | ||
.idea/* | ||
.DS_Store | ||
|
||
infra/node_modules | ||
infra/*.js | ||
infra/*.d.ts |
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
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,26 @@ | ||
version: 0.2 | ||
|
||
env: | ||
secrets-manager: | ||
USERNAME: "com.amazonaws.ec2.madison.dockerhub.amazon-ecs-local-container-endpoints.credentials:username" | ||
PASSWORD: "com.amazonaws.ec2.madison.dockerhub.amazon-ecs-local-container-endpoints.credentials:password" | ||
|
||
phases: | ||
install: | ||
commands: | ||
- echo '#!/bin/bash' > /usr/local/bin/ok; echo 'if [[ "$CODEBUILD_BUILD_SUCCEEDING" == "0" ]]; then exit 1; else exit 0; fi' >> /usr/local/bin/ok; chmod +x /usr/local/bin/ok | ||
pre_build: | ||
commands: | ||
- echo "Logging into DockerHub..." | ||
- docker login -u ${USERNAME} --password ${PASSWORD} | ||
build: | ||
# build and tag docker image. This will read ARCH_SUFFIX env var set in the | ||
# Codebuild project. | ||
commands: | ||
- echo Build started on `date` | ||
- echo Building Docker image... | ||
- make build-image | ||
- make publish-dockerhub | ||
post_build: | ||
commands: | ||
- ok && echo Build completed on `date` |
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,22 @@ | ||
version: 0.2 | ||
|
||
env: | ||
secrets-manager: | ||
USERNAME: "com.amazonaws.ec2.madison.dockerhub.amazon-ecs-local-container-endpoints.credentials:username" | ||
PASSWORD: "com.amazonaws.ec2.madison.dockerhub.amazon-ecs-local-container-endpoints.credentials:password" | ||
|
||
phases: | ||
install: | ||
commands: | ||
- echo '#!/bin/bash' > /usr/local/bin/ok; echo 'if [[ "$CODEBUILD_BUILD_SUCCEEDING" == "0" ]]; then exit 1; else exit 0; fi' >> /usr/local/bin/ok; chmod +x /usr/local/bin/ok | ||
pre_build: | ||
commands: | ||
- echo "Logging into DockerHub..." | ||
- docker login -u ${USERNAME} --password ${PASSWORD} | ||
build: | ||
commands: | ||
- echo "Verifying Docker images..." | ||
- make verify | ||
post_build: | ||
commands: | ||
- ok && echo Build completed on `date` |
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
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,33 @@ | ||
# Continuous delivery pipelines | ||
|
||
This package uses the [AWS Cloud Development Kit (AWS)](https://github.com/awslabs/aws-cdk) to model AWS CodePipeline pipelines and to provision them with AWS CloudFormation. | ||
|
||
* pipeline.ts: Builds and publishes the base Docker image for amazon/amazon-ecs-local-container-endpoints. | ||
|
||
This creates as CodePipeline pipeline which consists of a souce stage that uses | ||
a GitHub webhook, and build stages that uses AWS CodeBuild to build, publish | ||
and verify Docker images for both amd64 and arm64 architectures to DockerHub. | ||
|
||
## GitHub Access Token | ||
The official pipeilne uses a team account (ecs-local-container-endpoints+release@amazon.com). | ||
|
||
Create a GitHub [personal access token](https://github.com/settings/tokens) with access to your fork of the repo, including "admin:repo_hook" and "repo" permissions. Then store the token in Secrets Manager: | ||
|
||
``` | ||
aws secretsmanager create-secret --region us-west-2 --name EcsDevXGitHubToken --secret-string <my-github-personal-access-token> | ||
``` | ||
|
||
## Deploy | ||
|
||
To deploy this pipeline, install the AWS CDK CLI: `npm i -g aws-cdk` | ||
|
||
Install and build everything: `npm install && npm run build` | ||
|
||
Then deploy the pipeline stacks: | ||
|
||
``` | ||
cdk deploy --app 'node pipeline.js' | ||
``` | ||
|
||
See the pipelines in the CodePipeline console. |
Oops, something went wrong.