Skip to content

CodeCommit 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 (kpack
Kubernetes-native build service that runs CNB builds on-cluster and pushes images to a registry.
source)
demo/deploy/ pulse-deploy (Argo CD
Argo CD — GitOps controller that syncs cluster state from Git repositories.
: Applications kpack + pulse)
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.md

project.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
├── base
│ ├── configmap.yaml
│ ├── deployment.yaml
│ └── service.yaml
├── kpack
│ ├── README.md
│ └── release.yaml
└── kustomization.yaml

One 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/)

Reuse exports from Bootstrap AWS. Run from the repository root:

Terminal window
export AWS_PROFILE=sandbox
export AWS_PAGER=""
export AWS_REGION=ap-southeast-2
export CODECOMMIT_APP=pulse-app
export CODECOMMIT_DEPLOY=pulse-deploy
export 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}"

demo/deploy/base/deployment.yaml still has an ECR_URI placeholder. Copy the rendered file from bootstrap before you push:

Terminal window
cp demo/.generated/deploy/deployment.yaml demo/deploy/base/deployment.yaml
grep 'image:' demo/deploy/base/deployment.yaml

Expect 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.

Pick one remote style for each repo:

Option A — git-remote-codecommit (if installed: pip install git-remote-codecommit):

Terminal window
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):

Terminal window
git remote add origin "$CODECOMMIT_APP_URL"
git config credential.helper '!aws codecommit credential-helper $@'
git config credential.UseHttpPath true

Use $CODECOMMIT_DEPLOY_URL the same way for pulse-deploy.

Nested git init under demo/app is intentional — that tree becomes the CodeCommit repo (separate from this walkthrough’s GitHub repo).

Terminal window
cd demo/app
git init -b main
# Option A or B remote (see above)
git add .
git commit -m "Initial Pulse app"
git push -u origin main
cd -

Include kpack/ in this push (controller release). Root kustomization.yaml still lists only base/, so Application pulse does not adopt the controller manifests.

Terminal window
cd demo/deploy
git 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 main
cd -
Terminal window
aws codecommit get-branch --repository-name "$CODECOMMIT_APP" --branch-name main
aws codecommit get-branch --repository-name "$CODECOMMIT_DEPLOY" --branch-name main

Example 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):

Terminal window
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:main

kpack via GitOps — Argo CD Application kpack syncs pulse-deploy at path: kpack.