-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
42 lines (42 loc) · 1.13 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
pipeline {
agent any
environment {
registry = "eu.gcr.io/riptides/api-go"
registryUrl = "https://eu.gcr.io/riptides"
dockerImage = ''
}
stages {
stage('Cloning Git and prepping image') {
steps {
sh 'rm -rf *'
git (
url: 'git@github.com:skyerus/riptides-go.git',
credentialsId: 'github',
branch: 'master'
)
}
}
stage('Building image') {
steps{
script {
dockerImage = docker.build("${env.registry}:build-${BUILD_NUMBER}", "--no-cache .")
}
}
}
stage('Deploy Image') {
steps{
script {
docker.withRegistry( registryUrl, 'gcr:riptides-gcr' ) {
dockerImage.push()
}
}
}
}
stage('Remove Unused docker image & git repo') {
steps{
sh "docker rmi $registry:build-$BUILD_NUMBER"
sh "rm -Rf"
}
}
}
}