cd challenge-day2/frontend
<Run GitHub steps>
git status
git add -A
git commit -m "app sent to repo"
git push
cloudmart-cicd-pipeline
cloudmart-application
as the source.cloudmartBuild
).cloudmart-application
).buildspec.yml
:version: 0.2
phases:
install:
runtime-versions:
docker: 20
pre_build:
commands:
- echo Logging in to Amazon ECR...
- aws --version
- REPOSITORY_URI=$ECR_REPO
**- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/l4c0j8h9**
build:
commands:
- echo Build started on `date`
- echo Building the Docker image...
- docker build -t $REPOSITORY_URI:latest .
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$CODEBUILD_RESOLVED_SOURCE_VERSION
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker image...
- docker push $REPOSITORY_URI:latest
- docker push $REPOSITORY_URI:$CODEBUILD_RESOLVED_SOURCE_VERSION
- export imageTag=$CODEBUILD_RESOLVED_SOURCE_VERSION
- printf '[{\\"name\\":\\"cloudmart-app\\",\\"imageUri\\":\\"%s\\"}]' $REPOSITORY_URI:$imageTag > imagedefinitions.json
- cat imagedefinitions.json
- ls -l
env:
exported-variables: ["imageTag"]
artifacts:
files:
- imagedefinitions.json
- cloudmart-frontend.yaml
Create a Deployment Project:
cloudmartDeployToProduction
).eks-user
in Cloud Build, so it can authenticate to the Kubernetes cluster.