Commit 7c9f47db authored by Anton Borisov's avatar Anton Borisov

Update .gitlab-ci.yml

parent dd0f82e1
Pipeline #118 failed
stages: stages:
- build - build
- k8s_test - deploy_to_test
- deploy2test_and_tests - run_tests
build: build:
stage: build stage: build
...@@ -13,8 +13,8 @@ build: ...@@ -13,8 +13,8 @@ build:
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
script: script:
- docker login -u "gitlab-ci-token" -p ${CI_JOB_TOKEN} ${CI_REGISTRY} - docker login -u "gitlab-ci-token" -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker build -t ${CI_REGISTRY_IMAGE}:${CI_PIPELINE_ID} . - docker build -t ${CI_REGISTRY_IMAGE}/test:${CI_PIPELINE_ID} .
- docker push ${CI_REGISTRY_IMAGE}:${CI_PIPELINE_ID} - docker push ${CI_REGISTRY_IMAGE}/test:${CI_PIPELINE_ID}
environment: environment:
name: ${CI_COMMIT_REF_NAME} name: ${CI_COMMIT_REF_NAME}
url: https://xvideos.com url: https://xvideos.com
...@@ -23,8 +23,8 @@ build: ...@@ -23,8 +23,8 @@ build:
tags: tags:
- buidl1-dind - buidl1-dind
k8s_test: deploy_to_test:
stage: k8s stage: deploy_to_test
image: docker:stable image: docker:stable
services: services:
- docker:dind - docker:dind
...@@ -32,7 +32,7 @@ k8s_test: ...@@ -32,7 +32,7 @@ k8s_test:
DOCKER_HOST: tcp://docker:2375 DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
script: script:
- sed 's|_IMAGE_NAME_|'"${CI_REGISTRY_IMAGE}"'|g; s|_VERSION_|'"${CI_PIPELINE_ID}"'|g' app.tpl.yml > app.yml; cat app.yml - sed 's|_IMAGE_NAME_|'"${CI_REGISTRY_IMAGE}/test"'|g; s|_VERSION_|'"${CI_PIPELINE_ID}"'|g' app.tpl.yml > app.yml; cat app.yml
- wget https://storage.googleapis.com/kubernetes-release/release/v1.13.3/bin/linux/amd64/kubectl && chmod +x ./kubectl - 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 app.yml - wget https://github.com/garethr/kubeval/releases/download/0.7.3/kubeval-linux-amd64.tar.gz && tar xvf kubeval-linux-amd64.tar.gz && ./kubeval app.yml
- ./kubectl apply -f app.yml - ./kubectl apply -f app.yml
...@@ -63,17 +63,3 @@ test: ...@@ -63,17 +63,3 @@ test:
- test - test
tags: tags:
- buidl1-dind - buidl1-dind
deploy2test:
stage: deploy2test_and_tests
script:
- docker login -u "gitlab-ci-token" -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker-compose down
- docker-compose up -d
- docker ps
environment:
name: ${CI_COMMIT_REF_NAME}
only:
- test
tags:
- test1-shell
\ 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