Skip to content
Snippets Groups Projects
Commit ef65b6b2 authored by MIchael Nguyen's avatar MIchael Nguyen
Browse files

updating indexer post deploy.

parent d8cc744f
No related branches found
No related tags found
1 merge request!6Trusted ibm
......@@ -44,6 +44,9 @@ phases:
commands:
- echo Logging in to Amazon ECR...
- $(aws ecr get-login --no-include-email --region $DEPLOYMENT_REGION)
- REPOSITORY_URI=$AWS_ACCOUNT_NUMBER.dkr.ecr.$DEPLOYMENT_REGION.amazonaws.com/$IMAGE_REPO_NAME # build and store the ECR repo URI
- IMAGE_TAG=build-$(echo $CODEBUILD_BUILD_ID | awk -F":" '{print $2}') # generate a version tag from the commit hash for the Docker image
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7) # get the commit hash
build:
commands:
- echo Indexer-core Java build started on `date`...
......@@ -58,11 +61,12 @@ phases:
- echo os-indexer beginning packaging to jar...
- mvn clean deploy -e -pl indexer-core,provider/indexer-aws -Ddeployment.environment=$ENVIRONMENT -Ddeployment.repositorybucket=$S3_MAVEN_REPOSITORY -Daws.accessKeyId=$AWS_ACCESS_KEY_ID_MAVEN -Daws.secretKey=$AWS_SECRET_ACCESS_KEY_MAVEN -Dazure.devops.token=$VSTS_FEED_TOKEN
- echo os-indexer Docker image build started on `date`...
- docker build -f provider/indexer-aws/Dockerfile -t $IMAGE_REPO_NAME:$IMAGE_TAG .
- docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $AWS_ACCOUNT_NUMBER.dkr.ecr.$DEPLOYMENT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG
- docker build -f provider/indexer-aws/Dockerfile -t $REPOSITORY_URI:latest .
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
- echo ...os-indexer Docker image build completed on `date`.
- echo Pushing the Docker image to ECR...
- docker push $AWS_ACCOUNT_NUMBER.dkr.ecr.$DEPLOYMENT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG
- docker push $REPOSITORY_URI:latest
- docker push $REPOSITORY_URI:$IMAGE_TAG
cache:
paths:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment