Skip to content
Snippets Groups Projects
Commit 6449b1d6 authored by Dobromir Palushev's avatar Dobromir Palushev
Browse files

pipeline update

parent fdb5906a
No related branches found
No related tags found
23 merge requests!71A pipeline Job rename,!69Workflow updates,!68Workflow updates,!67Workflow updates,!65updated logic of the test-job,!63updated logic of the test-job,!61updated logic of the test-job,!59updated logic of the test-job,!57updated logic of the test-job,!55added "create-release-tag" job,!54updated logic of the test-job,!53Workflow updates,!51updated logic of the test-job,!49updated logic of the test-job,!48updated logic of the test-job,!46updated logic of the test-job,!44updated logic of the test-job,!43updated logic of the test-job,!42updated logic of the test-job,!41updated logic of the test-job,!40updated logic of the test-job,!39updated logic of the test-job,!38updated logic of the test-job
......@@ -15,7 +15,7 @@ variables:
CONTAINER_TAG: '${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}'
stages:
# - test
- test
- build
- release
- deploy
......@@ -28,26 +28,33 @@ stages:
- gcloud config set compute/zone ${GCP_COMPUTE_REGION}
- gcloud container clusters get-credentials ${GCP_PROJECT_ID}-gke
# run-tests:
# stage: test
# tags:
# - docker-privileged
# image: docker:${DOCKER_VERSION}
# services:
# - name: docker:${DOCKER_VERSION}-dind
# alias: containerhost
# script:
# - docker run -p 27017:27017 -d --name mongo-container --rm mongo:${MONGO_VERSION}
# - docker build
# --tag "${CONTAINER_TAG}-test"
# --target=test
# --build-arg MONGODB_URL_TEST=mongodb://containerhost:27017/todo-app
# --build-arg JWT_SECRET_TEST=my-very-secret-jwt
# "./app"
# after_script:
# - docker stop mongo-container
# - docker images -a | grep "mongo" | awk '{print $3}' | xargs docker rmi --force
# - docker image rm --force "${CONTAINER_TAG}-test"
run-tests:
stage: test
tags:
- docker-privileged
image: docker:${DOCKER_VERSION}
services:
- name: docker:${DOCKER_VERSION}-dind
alias: localhost
script:
- docker run -p 27017:27017
--detached
--name mongo-container
--rm
--network=host
mongo:${MONGO_VERSION}
- docker build
--tag "${CONTAINER_TAG}-test"
--target=test
--network=host
--build-arg MONGODB_URL_TEST=mongodb://localhost:27017/todo-app
--build-arg JWT_SECRET_TEST=my-very-secret-jwt
--add-host=host.docker.internal:localhost
"./app"
after_script:
- docker stop mongo-container
- docker images -a | grep "mongo" | awk '{print $3}' | xargs docker rmi --force
- docker image rm --force "${CONTAINER_TAG}-test"
build-image:
stage: build
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment