Commit b76d75fb authored by Anton Borisov's avatar Anton Borisov

Update .gitlab-ci.yml

parent 2a4b3716
Pipeline #136 canceled with stages
in 50 seconds
stages: stages:
- build - build_dev
- build_test
- build_prod
- deploy_to_test - deploy_to_test
- run_tests - run_tests
- deploy_to_prod
build: build_dev:
stage: build stage: build_dev
image: docker:stable
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
script:
- docker login -u "gitlab-ci-token" -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker build -t ${CI_REGISTRY_IMAGE}:${CI_PIPELINE_ID} .
- docker push ${CI_REGISTRY_IMAGE}:${CI_PIPELINE_ID}
environment:
name: ${CI_COMMIT_REF_NAME}
url: https://xvideos.com
only:
- dev
tags:
- buidl1-dind
build_test:
stage: build_test
image: docker:stable image: docker:stable
services: services:
- docker:dind - docker:dind
...@@ -23,6 +46,26 @@ build: ...@@ -23,6 +46,26 @@ build:
tags: tags:
- buidl1-dind - buidl1-dind
build_prod:
stage: build_prod
image: docker:stable
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
script:
- docker login -u "gitlab-ci-token" -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker build -t ${CI_REGISTRY_IMAGE}/prod:${CI_PIPELINE_ID} .
- docker push ${CI_REGISTRY_IMAGE}/prod:${CI_PIPELINE_ID}
environment:
name: ${CI_COMMIT_REF_NAME}
url: https://xvideos.com
only:
- release
tags:
- buidl1-dind
deploy_to_test: deploy_to_test:
stage: deploy_to_test stage: deploy_to_test
image: docker:stable image: docker:stable
...@@ -63,3 +106,24 @@ run_test: ...@@ -63,3 +106,24 @@ run_test:
- test - test
tags: tags:
- buidl1-dind - buidl1-dind
deploy_to_prod:
stage: deploy_to_prod
image: docker:stable
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
script:
- sed 's|_IMAGE_NAME_|'"${CI_REGISTRY_IMAGE}/test"'|g; s|_VERSION_|'"${CI_PIPELINE_ID}"'|g' node.tpl.yml > node.yml; cat node.yml
- wget https://storage.googleapis.com/kubernetes-release/release/v1.13.3/bin/linux/amd64/kubectl && chmod +x ./kubectl
- wget https://github.com/garethr/kubeval/releases/download/0.7.3/kubeval-linux-amd64.tar.gz && tar xvf kubeval-linux-amd64.tar.gz && ./kubeval node.yml
- ./kubectl apply -f node.yml
environment:
name: ${CI_COMMIT_REF_NAME}
url: https://xvideos.com
only:
- release
tags:
- buidl1-dind
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment