Update buildspec.yml

This commit is contained in:
blueCycle 2020-01-24 16:49:20 -08:00 committed by GitHub
parent b9e99be53f
commit 86fa41c9a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,7 @@ phases:
pre_build: pre_build:
commands: commands:
- TAG="$REPOSITORY_NAME.$REPOSITORY_BRANCH.$ENVIRONMENT_NAME.$(date +%Y-%m-%d.%H.%M.%S).$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | head -c 8)" - TAG="$REPOSITORY_NAME.$REPOSITORY_BRANCH.$ENVIRONMENT_NAME.$(date +%Y-%m-%d.%H.%M.%S).$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | head -c 8)"
- sed -i 's@CONTAINER_IMAGE@'"$REPOSITORY_URI:$TAG"'@' hello-k8s.yml - sed -i 's@CONTAINER_IMAGE@'"$REPOSITORY_URI:$TAG"'@' frontend.yml
- $(aws ecr get-login --no-include-email) - $(aws ecr get-login --no-include-email)
- export KUBECONFIG=$HOME/.kube/config - export KUBECONFIG=$HOME/.kube/config
build: build:
@ -27,7 +27,7 @@ phases:
- export AWS_SESSION_TOKEN="$(echo ${CREDENTIALS} | jq -r '.Credentials.SessionToken')" - export AWS_SESSION_TOKEN="$(echo ${CREDENTIALS} | jq -r '.Credentials.SessionToken')"
- export AWS_EXPIRATION=$(echo ${CREDENTIALS} | jq -r '.Credentials.Expiration') - export AWS_EXPIRATION=$(echo ${CREDENTIALS} | jq -r '.Credentials.Expiration')
- aws eks update-kubeconfig --name $EKS_CLUSTER_NAME - aws eks update-kubeconfig --name $EKS_CLUSTER_NAME
- kubectl apply -f hello-k8s.yml - kubectl apply -f frontend.yaml -n hipster
- printf '[{"name":"hello-k8s","imageUri":"%s"}]' $REPOSITORY_URI:$TAG > build.json - printf '[{"name":"frontend","imageUri":"%s"}]' $REPOSITORY_URI:$TAG > build.json
artifacts: artifacts:
files: build.json files: build.json