version: 0.2 phases: install: commands: - apt-get update && apt-get -y install python-pip - apt-get -y install nodejs - apt-get -y install npm - pip install --upgrade python - pip install --upgrade awscli pre_build: commands: - npm config set registry="http://registry.npmjs.org/" - $(aws ecr get-login --no-include-email) - TAG="$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | head -c 8)" build: commands: - cd services/$SERVICE_NAME/ && npm install && docker build --tag "${REPOSITORY_URI}:${TAG}" . post_build: commands: - docker push "${REPOSITORY_URI}:${TAG}" - printf '{"tag":"%s"}' $TAG > /tmp/build.json artifacts: files: - /tmp/build.json - services/$SERVICE_NAME/infrastructure/templates/ecs-cluster.yaml - services/$SERVICE_NAME/$CONFIG - services/$SERVICE_NAME/$PRODCONFIG - services/$SERVICE_NAME/$BETACONFIG - services/$SERVICE_NAME/$PRODBETACONFIG discard-paths: yes