CodeCommit publish
What you publish
Section titled “What you publish”Two trees under demo/ become two CodeCommit
AWS managed Git hosting — GitHub alternative used for app source and deploy manifests in this lab. repos. Confirm this layout before any git commands:
| Local path | CodeCommit repo |
|---|---|
demo/app/ |
pulse-app (kpackKubernetes-native build service that runs CNB builds on-cluster and pushes images to a registry. source) |
demo/deploy/ |
pulse-deploy (Argo CDArgo CD — GitOps controller that syncs cluster state from Git repositories.: Applications kpack + pulse) |
demo/app → pulse-app
Section titled “demo/app → pulse-app”demo/app├── cmd│ └── pulse│ └── main.go├── go.mod├── internal│ ├── config│ │ └── config.go│ ├── httpapi│ │ ├── dashboard.go│ │ ├── handler.go│ │ └── router.go│ └── monitor│ ├── checker.go│ ├── store.go│ └── types.go├── project.toml└── README.mdproject.toml sets Paketo
Paketo Buildpacks — mature open-source builders for Go, Node, Java, Python, and more. Go targets (./cmd/pulse). There is no Dockerfile.
demo/deploy → pulse-deploy
Section titled “demo/deploy → pulse-deploy”demo/deploy├── base│ ├── configmap.yaml│ ├── deployment.yaml│ └── service.yaml├── kpack│ ├── README.md│ └── release.yaml└── kustomization.yamlOne GitOps repo, two Argo CD Applications:
| Application | path |
What it syncs |
|---|---|---|
| kpack | kpack |
Controller install (release.yaml) |
| pulse | . |
Kustomize root (base/ only — kustomization.yaml does not include kpack/) |
Set variables
Section titled “Set variables”Reuse exports from Bootstrap AWS. Run from the repository root:
export AWS_PROFILE=sandboxexport AWS_PAGER=""export AWS_REGION=ap-southeast-2export CODECOMMIT_APP=pulse-appexport CODECOMMIT_DEPLOY=pulse-deployexport CODECOMMIT_APP_URL="https://git-codecommit.${AWS_REGION}.amazonaws.com/v1/repos/${CODECOMMIT_APP}"export CODECOMMIT_DEPLOY_URL="https://git-codecommit.${AWS_REGION}.amazonaws.com/v1/repos/${CODECOMMIT_DEPLOY}"Prepare pulse-deploy image
Section titled “Prepare pulse-deploy image”demo/deploy/base/deployment.yaml still has an ECR_URI placeholder. Copy the rendered file from bootstrap before you push:
cp demo/.generated/deploy/deployment.yaml demo/deploy/base/deployment.yamlgrep 'image:' demo/deploy/base/deployment.yamlExpect your account ECR URI ending in pulse:main, not the literal ECR_URI:main.
The copy is only for the CodeCommit tree. Keep the walkthrough template as ECR_URI in git; regenerating from demo/.generated/ before each push is enough.
Git remote options
Section titled “Git remote options”Pick one remote style for each repo:
Option A — git-remote-codecommit (if installed: pip install git-remote-codecommit):
git remote add origin "codecommit::${AWS_REGION}://${CODECOMMIT_APP}"Option B — HTTPS + AWS CLI credential helper (works with SSO profiles; no IAM Git username/password):
git remote add origin "$CODECOMMIT_APP_URL"git config credential.helper '!aws codecommit credential-helper $@'git config credential.UseHttpPath trueUse $CODECOMMIT_DEPLOY_URL the same way for pulse-deploy.
Push pulse-app
Section titled “Push pulse-app”Nested git init under demo/app is intentional — that tree becomes the CodeCommit repo (separate from this walkthrough’s GitHub repo).
cd demo/appgit init -b main# Option A or B remote (see above)git add .git commit -m "Initial Pulse app"git push -u origin maincd -Push pulse-deploy
Section titled “Push pulse-deploy”Include kpack/ in this push (controller release). Root kustomization.yaml still lists only base/, so Application pulse does not adopt the controller manifests.
cd demo/deploygit init -b main# Option A or B remote (see above; use CODECOMMIT_DEPLOY / CODECOMMIT_DEPLOY_URL)git add .git commit -m "Initial deploy manifests + kpack controller"git push -u origin maincd -Verify
Section titled “Verify”aws codecommit get-branch --repository-name "$CODECOMMIT_APP" --branch-name mainaws codecommit get-branch --repository-name "$CODECOMMIT_DEPLOY" --branch-name mainExample success (commit IDs will differ):
{ "branch": { "branchName": "main", "commitId": "aabc46b00f25f0c885292bd4eea5d96a7fecf159" }}{ "branch": { "branchName": "main", "commitId": "f14423033b2a7a47b412a1b634cd67e7ef198eb3" }}Both repos must report branchName main. Optionally confirm the deploy image on CodeCommit (account ID redacted):
aws codecommit get-file \ --repository-name "$CODECOMMIT_DEPLOY" \ --commit-specifier main \ --file-path base/deployment.yaml \ --query fileContent --output text | base64 -d | grep 'image:' image: <ACCOUNT_ID>.dkr.ecr.ap-southeast-2.amazonaws.com/pulse:mainkpack via GitOps — Argo CD Application kpack syncs pulse-deploy at path: kpack.