Commit 31783b7a authored by Kaniz Fatema Tuly's avatar Kaniz Fatema Tuly
Browse files

Update .gitlab-ci.yml

parent 04155f3b
Pipeline #1199 failed with stages
in 0 seconds
......@@ -8,7 +8,7 @@ image_build:
script:
- echo "Stage build, Dockerfile:"
- cat Dockerfile
- docker build -t fastapi:$CI_PIPELINE_ID .
- docker build -t testapi:$CI_PIPELINE_ID .
code_test:
stage: test
......@@ -19,16 +19,16 @@ code_test:
container_deploy1:
stage: deploy
script:
- docker run -d -p 80 --name myfastapi-w1-$CI_PIPELINE_ID fastapi:$CI_PIPELINE_ID
- docker run -d -p 80 --name mytestapi-w1-$CI_PIPELINE_ID testapi:$CI_PIPELINE_ID
- docker ps
- docker stop myfastapi-w1-$CI_PIPELINE_ID
- docker rm myfastapi-w1-$CI_PIPELINE_ID
- docker stop myftestapi-w1-$CI_PIPELINE_ID
- docker rm mytestapi-w1-$CI_PIPELINE_ID
deploy_test:
stage: test
script:
- docker run -d -p 80 --name myfastapi-test-$CI_PIPELINE_ID fastapi:$CI_PIPELINE_ID
- sleep 10 && curl $(ifconfig ens3 | grep "inet " | sed -e 's/.* inet //g' | sed -e 's/ .*//g'):$(docker port myfastapi-test-$CI_PIPELINE_ID | grep 0.0.0 | grep "80/tcp" | sed -e 's/.*://g')
- docker stop myfastapi-test-$CI_PIPELINE_ID
- docker rm myfastapi-test-$CI_PIPELINE_ID
- docker run -d -p 80 --name mytestapi-test-$CI_PIPELINE_ID testapi:$CI_PIPELINE_ID
- sleep 10 && curl $(ifconfig ens3 | grep "inet " | sed -e 's/.* inet //g' | sed -e 's/ .*//g'):$(docker port mytestapi-test-$CI_PIPELINE_ID | grep 0.0.0 | grep "80/tcp" | sed -e 's/.*://g')
- docker stop mytestapi-test-$CI_PIPELINE_ID
- docker rm mytestapi-test-$CI_PIPELINE_ID
Supports Markdown
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