From e696074d897f4f8a9dd9ac27712cf2bb5f7ff339 Mon Sep 17 00:00:00 2001 From: jdbrown-usgs Date: Tue, 14 May 2019 10:58:14 -0600 Subject: [PATCH] Test Update --- .gitlab-ci.yml | 76 ++++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71b9451..b443b5f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,13 +2,13 @@ variables: # DOCKER_DRIVER: overlay2 # TEST_IMAGE: node:latest # RELEASE_IMAGE: node:latest - BUILD_ID: "1.0.4" + BUILD_ID: "TEST" APP_NAME: "earthquake-geoserve-ui" DEVOPS_REGISTRY: "$GITLAB_INNERSOURCE_REGISTRY/devops/images" #WORKSPACE: "prod" FAILURE: "null" # name of the branch; if master, do latest - IMAGE_VERSION: "1.0.4" + IMAGE_VERSION: "TEST" SCM_VARS: "[:]" # Name of image to use as basis when building LOCAL_IMAGE/DEPLOY_IMAGE BASE_IMAGE: "usgs/nginx:latest" @@ -17,7 +17,7 @@ variables: BUILDER_IMAGE: "usgs/node:10" # Name of image to deploy (push) to registry DEPLOY_IMAGE: "$GITLAB_INNERSOURCE_REGISTRY/ghsc/hazdev/earthquake-geoserve/ui" - DOCKER_HUB_IMAGE: "ghsc/hazdev/earthquake-geoserve-ui" + DOCKER_HUB_IMAGE: "usgs/earthquake-geoserve-ui" # DOCKER_HUB_IMAGE: "jamesmalin/usgs-geoserve-ui" # Run application locally for testing security vulnerabilities LOCAL_CONTAINER: $APP_NAME-$BUILD_ID-PENTEST @@ -40,7 +40,7 @@ stages: - build - unit-tests # - pen-tests - # - publish-image + - publish-image # - deploy # initialize: @@ -139,40 +139,42 @@ run unit tests: # dependencies: # - build -# publish image: -# stage: publish-image -# # image: node:latest -# image: docker:stable -# # cache: -# # untracked: true -# only: -# - master -# before_script: -# # - curl -O https://bootstrap.pypa.io/get-pip.py -# # - python3 get-pip.py --user -# # - /root/.local/bin/pip3 install awscli --upgrade --user -# # - npm install -g docker -# # - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY -# script: -# # - aws cloudformation package --template-file ./deployment/aws-create-user.json --s3-bucket $S3_BUCKET --output-template usgs-user-template-export.yml -# # - aws cloudformation deploy --template-file /builds/jmalin/earthquake-geoserve-ui/usgs-user-template-export.yml --stack-name usgs-user-deploy-stack -# # Re-tag candidate image as actual image name and push actual image to repository -# # TODO - Deploy to USGS Hazdev Registry -# # - docker tag ${LOCAL_IMAGE} ${DEPLOY_IMAGE}:${IMAGE_VERSION} -# # - docker push ${DEPLOY_IMAGE}:${IMAGE_VERSION} +publish image: + stage: publish-image + # image: node:latest + image: docker:stable + # cache: + # untracked: true + only: + - master + before_script: + # - curl -O https://bootstrap.pypa.io/get-pip.py + # - python3 get-pip.py --user + # - /root/.local/bin/pip3 install awscli --upgrade --user + # - npm install -g docker + # - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + script: + # - aws cloudformation package --template-file ./deployment/aws-create-user.json --s3-bucket $S3_BUCKET --output-template usgs-user-template-export.yml + # - aws cloudformation deploy --template-file /builds/jmalin/earthquake-geoserve-ui/usgs-user-template-export.yml --stack-name usgs-user-deploy-stack + # Re-tag candidate image as actual image name and push actual image to repository + # TODO - Deploy to USGS Hazdev Registry + # - docker tag ${LOCAL_IMAGE} ${DEPLOY_IMAGE}:${IMAGE_VERSION} + # - docker push ${DEPLOY_IMAGE}:${IMAGE_VERSION} -# # Re-tag candidate image as public image name and push to docker hub -# # For a private registry include registry URL -# - docker load -i docker-images/app.tar -# # - docker build --build-arg FROM_IMAGE=$BASE_IMAGE --build-arg BUILD_IMAGE=$BUILDER_IMAGE -t $LOCAL_IMAGE . -# - docker tag ${LOCAL_IMAGE} ${DOCKER_HUB_IMAGE}:${IMAGE_VERSION} -# # login to dockerhub -# - echo "$DOCKER_PASSWORD" | docker login --username $DOCKER_USERNAME --password-stdin -# - docker push ${DOCKER_HUB_IMAGE}:${IMAGE_VERSION} -# # Delete pass file -# - rm -rf /root/.docker/config.json -# dependencies: -# - build + # Re-tag candidate image as public image name and push to docker hub + # For a private registry include registry URL + - docker load -i docker-images/app.tar + # - docker build --build-arg FROM_IMAGE=$BASE_IMAGE --build-arg BUILD_IMAGE=$BUILDER_IMAGE -t $LOCAL_IMAGE . + # - docker tag ${LOCAL_IMAGE} ${DOCKER_HUB_IMAGE}:${IMAGE_VERSION} + - docker tag ${LOCAL_IMAGE} ${DEPLOY_IMAGE}:${IMAGE_VERSION} + # login to dockerhub + - echo "$CHS_PASSWORD" | docker login --username $CHS_USERNAME --password-stdin + # - docker push ${DOCKER_HUB_IMAGE}:${IMAGE_VERSION} + - docker push ${DEPLOY_IMAGE}:${IMAGE_VERSION} + # Delete pass file + - rm -rf /root/.docker/config.json + dependencies: + - build # deploy: # stage: deploy -- GitLab