Last active
June 2, 2021 19:14
-
-
Save manimike00/efd4294f29204221e75a808b5f811754 to your computer and use it in GitHub Desktop.
This file contains 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 any | |
stages { | |
stage('Build') { | |
steps { | |
script { | |
if (env.BRANCH_NAME == 'test') { | |
sshPublisher( | |
publishers: [ | |
sshPublisherDesc( | |
configName: "hawksighttest", | |
transfers: [ | |
sshTransfer( | |
execCommand: "docker ps -q | xargs -r docker kill" | |
), | |
sshTransfer( | |
execCommand: "docker images -f dangling=true -q | xargs -r -n1 docker rmi -f" | |
), | |
sshTransfer( | |
execCommand: "docker-compose rm -f -v" | |
), | |
sshTransfer( | |
execCommand: "cd /home/ubuntu/hwk-srm-frontend/;git pull && docker-compose up --build -d" | |
) | |
]) | |
]) | |
} else { | |
echo 'Branch Not Found' | |
} | |
} | |
} | |
} | |
} | |
post { | |
always { | |
discordSend description: "Jenkins Pipeline Build", link: env.BUILD_URL, result: currentBuild.currentResult, title: JOB_NAME, webhookURL: env.hwk_srm_frontend | |
} | |
} | |
} |
vinayakkulkarni
commented
Oct 14, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment