Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Israel Amaral
/
app01
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
2eb5366a
authored
2021-02-17 10:19:27 -0300
by
Israel do Amaral Santiago
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Jenkins File
1 parent
831d85d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
Jenkinsfile
Jenkinsfile
0 → 100644
View file @
2eb5366
pipeline {
agent any
environment {
registry = "israeldoamaral/app01"
registryCredential = 'dockerhub_id'
dockerImage = ''
}
stages {
stage('Build Docker Image') {
steps {
script {
dockerImage = docker.build registry + ":develop"
}
}
}
stage('Send image to Docker Hub') {
steps {
script {
docker.withRegistry( '', registryCredential ) {
dockerImage.push()
}
}
}
}
stage('Cleaning up') {
steps {
sh "docker rmi $registry:develop"
}
}
}
}
def remote = [:]
remote.name = "suporte"
remote.host = "172.25.45.103"
remote.allowAnyHosts = true
node {
withCredentials([sshUserPrivateKey(credentialsId: 'suporte-id', keyFileVariable: 'identity', passphraseVariable: '', usernameVariable: 'suporte')]) {
remote.user = suporte
remote.identityFile = identity
stage("SSH Steps Rocks!") {
sshScript remote: remote, script: 'scripts/stop-container.sh'
sshScript remote: remote, script: 'scripts/start-container.sh'
}
}
}
\ No newline at end of file
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment