Skip to content

Instantly share code, notes, and snippets.

@deleugpn
Created December 30, 2018 17:03
Show Gist options
  • Save deleugpn/b849f0ed218b85df94c522f6882ec671 to your computer and use it in GitHub Desktop.
Save deleugpn/b849f0ed218b85df94c522f6882ec671 to your computer and use it in GitHub Desktop.
version: 0.2
phases:
pre_build:
commands:
- $(aws ecr get-login --region $AWS_REGION --no-include-email)
- TAG="$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | head -c 8)"
- BUILD_URL="${REPOSITORY_URL}:${TAG}"
build:
commands:
- 'echo "{\"Parameters\":{\"CommitHash\":\"$TAG\"}}" > build.hash.json'
- docker build --tag "$BUILD_URL-artisan" --target artisan .
- docker build --tag "$REPOSITORY_URL" --tag "$BUILD_URL" .
# Run phpunit here
- docker push "$BUILD_URL-artisan"
- docker push "$BUILD_URL"
artifacts:
files:
- build.hash.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment