Skip to content
Snippets Groups Projects

pipeline multiple updates

Merged Dobromir Palushev requested to merge just-a-test into staging
1 file
+ 23
39
Compare changes
  • Side-by-side
  • Inline
+ 23
39
@@ -14,7 +14,7 @@ variables:
@@ -14,7 +14,7 @@ variables:
CONTAINER_TAG: '${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}'
CONTAINER_TAG: '${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}'
stages:
stages:
- test
# - test
- build
- build
- release
- release
- deploy
- deploy
@@ -27,47 +27,31 @@ stages:
@@ -27,47 +27,31 @@ stages:
- gcloud config set compute/zone ${GCP_COMPUTE_REGION}
- gcloud config set compute/zone ${GCP_COMPUTE_REGION}
- gcloud container clusters get-credentials ${GCP_PROJECT_ID}-gke
- gcloud container clusters get-credentials ${GCP_PROJECT_ID}-gke
run-tests:
# run-tests:
stage: test
# stage: test
tags:
# tags:
- docker-privileged
# - docker-privileged
# - docker
# image: docker:${DOCKER_VERSION}
image: docker:${DOCKER_VERSION}
# services:
# image: node:16.17.0-alpine
# - name: docker:${DOCKER_VERSION}-dind
services:
# alias: containerhost
- name: docker:${DOCKER_VERSION}-dind
# script:
alias: containerhost
# - docker run -p 27017:27017 -d --name mongo-container --rm mongo:${MONGO_VERSION}
script:
# - docker build
- docker run -p 27017:27017 -d --name mongo-container --rm mongo:${MONGO_VERSION}
# --tag "${CONTAINER_TAG}-test"
- docker build
# --target=test
--tag "${CONTAINER_TAG}-test"
# --build-arg MONGODB_URL_TEST=mongodb://containerhost:27017/todo-app
--target=test
# --build-arg JWT_SECRET_TEST=my-very-secret-jwt
--build-arg MONGODB_URL_TEST=mongodb://containerhost:27017/todo-app
# "./app"
--build-arg JWT_SECRET_TEST=my-very-secret-jwt
# after_script:
"./app"
# - docker stop mongo-container
# --add-host=host.docker.internal:localhost
# - docker images -a | grep "mongo" | awk '{print $3}' | xargs docker rmi --force
# - echo ‘http://dl-cdn.alpinelinux.org/alpine/v3.6/main’ >> /etc/apk/repositories
# - docker image rm --force "${CONTAINER_TAG}-test"
# - echo ‘http://dl-cdn.alpinelinux.org/alpine/v3.6/community’ >> /etc/apk/repositories
# - apk update
# - apk add mongodb mongodb-tools
# - mkdir -p /data/db/
# - mongod --config "./app/server/dev.mongo.conf"
# - cd "./app/client"
# - npm ci --no-audit --no-fund
# - npm run test
# - cd "../server"
# - npm ci --no-audit --no-fund
# - MONGODB_URL=mongodb://localhost:27017/todo-app JWT_SECRET=a-big-secret npm run test
# - jest --ci
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:
build-image:
stage: build
stage: build
needs:
# needs:
- 'run-tests'
# - 'run-tests'
tags:
tags:
- docker-privileged
- docker-privileged
image: docker:${DOCKER_VERSION}
image: docker:${DOCKER_VERSION}
Loading