-
-
Save gEndelf/edd4cd6218a15457d3fe6e614fa1e74a to your computer and use it in GitHub Desktop.
Jenkins pipeline sample
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
#!/usr/bin/env groovy | |
node { | |
def app | |
stage("Clone") { | |
git 'https://github.com/caroso1222/ast-viewer.git' | |
} | |
stage("Build") { | |
app = docker.build("caroso1222/ts-ast-viewer") | |
} | |
stage("Push") { | |
docker.withRegistry("https://registry.hub.docker.com", "docker-hub-credentials") { | |
app.push("${env.BUILD_ID}") | |
app.push("latest") | |
} | |
} | |
stage("Deploy") { | |
sh "ssh [email protected] \"docker stop ast_0 && \ | |
docker rm ast_0 && \ | |
docker pull caroso1222/ts-ast-viewer:latest && \ | |
docker run -d --name=ast_0 -p 8080:80 caroso1222/ts-ast-viewer:latest\"" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment