Loading src/ztp/.gitlab-ci.yml +11 −11 Original line number Diff line number Diff line Loading @@ -13,12 +13,12 @@ # limitations under the License. variables: IMAGE_NAME: 'automation' IMAGE_NAME: 'ztp' REPORTS_PATH: "src/${IMAGE_NAME}/reports" BUILD_ENV: build.env # Package application needed to run tests & build the image on next stage build automation: build ztp: stage: build script: - export IMAGE_TAG=$(grep -m1 '<version>' ./src/$IMAGE_NAME/pom.xml | grep -oP '(?<=>).*(?=<)') Loading @@ -39,12 +39,12 @@ build automation: - .gitlab-ci.yml # Run tests, build & push the image unit_test automation: unit_test ztp: variables: REPORTS_CONTAINER: "${IMAGE_NAME}-reports" stage: unit_test needs: - build automation - build ztp before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker rm ${REPORTS_CONTAINER} || true Loading Loading @@ -79,18 +79,18 @@ unit_test automation: - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml ## Deployment of automation service in Kubernetes Cluster #deploy automation: ## Deployment of ztp service in Kubernetes Cluster #deploy ztp: # stage: deploy # needs: # - build automation # - unit_test automation # - build ztp # - unit_test ztp # script: # - kubectl version # - kubectl get all # - kubectl delete --ignore-not-found=true -f "manifests/automationservice.yaml" # - kubectl apply -f "manifests/automationservice.yaml" # - kubectl delete pods --selector app=automationservice # - kubectl delete --ignore-not-found=true -f "manifests/ztpservice.yaml" # - kubectl apply -f "manifests/ztpservice.yaml" # - kubectl delete pods --selector app=ztpservice # - kubectl get all # rules: # - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' Loading Loading
src/ztp/.gitlab-ci.yml +11 −11 Original line number Diff line number Diff line Loading @@ -13,12 +13,12 @@ # limitations under the License. variables: IMAGE_NAME: 'automation' IMAGE_NAME: 'ztp' REPORTS_PATH: "src/${IMAGE_NAME}/reports" BUILD_ENV: build.env # Package application needed to run tests & build the image on next stage build automation: build ztp: stage: build script: - export IMAGE_TAG=$(grep -m1 '<version>' ./src/$IMAGE_NAME/pom.xml | grep -oP '(?<=>).*(?=<)') Loading @@ -39,12 +39,12 @@ build automation: - .gitlab-ci.yml # Run tests, build & push the image unit_test automation: unit_test ztp: variables: REPORTS_CONTAINER: "${IMAGE_NAME}-reports" stage: unit_test needs: - build automation - build ztp before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker rm ${REPORTS_CONTAINER} || true Loading Loading @@ -79,18 +79,18 @@ unit_test automation: - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml ## Deployment of automation service in Kubernetes Cluster #deploy automation: ## Deployment of ztp service in Kubernetes Cluster #deploy ztp: # stage: deploy # needs: # - build automation # - unit_test automation # - build ztp # - unit_test ztp # script: # - kubectl version # - kubectl get all # - kubectl delete --ignore-not-found=true -f "manifests/automationservice.yaml" # - kubectl apply -f "manifests/automationservice.yaml" # - kubectl delete pods --selector app=automationservice # - kubectl delete --ignore-not-found=true -f "manifests/ztpservice.yaml" # - kubectl apply -f "manifests/ztpservice.yaml" # - kubectl delete pods --selector app=ztpservice # - kubectl get all # rules: # - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' Loading