Skip to content

Instantly share code, notes, and snippets.

@parsa-asgari
Created February 13, 2022 11:48
Show Gist options
  • Save parsa-asgari/031c65bbd87719e179973ef33afa6712 to your computer and use it in GitHub Desktop.
Save parsa-asgari/031c65bbd87719e179973ef33afa6712 to your computer and use it in GitHub Desktop.
Simple working gitlab-ci.yml for my django_test project
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