Created
February 13, 2022 11:48
-
-
Save parsa-asgari/031c65bbd87719e179973ef33afa6712 to your computer and use it in GitHub Desktop.
Simple working gitlab-ci.yml for my django_test project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stages: # List of stages for jobs, and their order of execution | |
- build | |
- deploy | |
build-job: # This job runs in the build stage, which runs first. | |
stage: build | |
script: | |
- echo "building the image..." | |
- docker build --tag django_test:latest . | |
- echo "building image complete." | |
deploy-job: # This job runs in the deploy stage. | |
stage: deploy # It only runs when *both* jobs in the test stage complete successfully. | |
script: | |
- echo "Deploying the container..." | |
- docker run -d -p 192.168.100.146:8000:8000 django_test:latest | |
- echo "Container successfully deployed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment