Forked from pracps/jenkins-pipeline-shell-docker.groovy
Created
January 11, 2019 09:19
-
-
Save SergiuCip/d78de05b61d45c856b3c2f6f92499d5a to your computer and use it in GitHub Desktop.
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
pipeline { | |
agent { | |
label 'slave3' | |
} | |
stages { | |
stage ('mysql-db-dump') { | |
steps { | |
sh 'docker image rmi dockerhub.company.com:5000/mysqldmp' | |
sh 'docker pull dockerhub.company.com:5000/mysqldmp' | |
// sh 'docker container rm mysql-dumper' | |
sh 'docker run --name mysql-dumper --env MYSQL_DB_HOST=mdb.stage.company.com --env MYSQL_DB_USER=root --env MYSQL_DB_PASSWORD=welcome123 --env MYSQL_PORT=3306 --env DB_INSTANCE=ins --env MYSQL_DB_NAME="db1 db2" --env DUMP_VOLUME_PATH=/data-dump -v /smb/data-dump:/data-dump dockerhub.company.com:5000/mysqldmp' | |
sh 'docker container rm mysql-dumper' | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment