Created
February 20, 2022 06:23
-
-
Save parsa-asgari/c453ad5bbacdcb6b1c71919beed19464 to your computer and use it in GitHub Desktop.
simple Jenkinsfile using Docker and Django
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
node{ | |
git branch: "master", url: "http://192.168.100.185:3000/parsa/Django_cicd" | |
stage ('Build the Docker image') { | |
sh "echo building the image..." | |
sh "docker build --tag django_test:latest ." | |
sh "echo building image complete." | |
} | |
stage ('Deploy the Docker image') { | |
sh "echo Deploying the container..." | |
sh " docker rm -f django_test" | |
sh "docker run -d -p 192.168.100.146:8000:8000 --name django_test django_test:latest " | |
sh "echo Container successfully deployed." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment