-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
executable file
·51 lines (49 loc) · 1.76 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
43
44
45
46
47
48
49
50
51
// Uses Declarative syntax to run commands inside a container.
pipeline {
triggers {
pollSCM("*/5 * * * *")
}
agent {
kubernetes {
yaml '''
apiVersion: v1
kind: Pod
spec:
volumes:
- name: docker-sock
hostPath:
path: /var/run/docker.sock
containers:
- name: docker
image: quay.imanuel.dev/dockerhub/library---docker:stable
command:
- cat
tty: true
volumeMounts:
- mountPath: /var/run/docker.sock
name: docker-sock
'''
defaultContainer 'docker'
}
}
stages {
stage('Push') {
steps {
container('docker') {
sh "docker build -t quay.imanuel.dev/imanuel/docker-checker:v1.$BUILD_NUMBER -f ./Dockerfile ."
sh "docker tag quay.imanuel.dev/imanuel/docker-checker:v1.$BUILD_NUMBER quay.imanuel.dev/imanuel/docker-checker:latest"
sh "docker tag quay.imanuel.dev/imanuel/docker-checker:v1.$BUILD_NUMBER iulbricht/docker-checker:v1.$BUILD_NUMBER"
sh "docker tag quay.imanuel.dev/imanuel/docker-checker:v1.$BUILD_NUMBER iulbricht/docker-checker:latest"
withDockerRegistry(credentialsId: 'quay.imanuel.dev', url: 'https://quay.imanuel.dev') {
sh "docker push quay.imanuel.dev/imanuel/docker-checker:v1.$BUILD_NUMBER"
sh "docker push quay.imanuel.dev/imanuel/docker-checker:latest"
}
withDockerRegistry(credentialsId: 'hub.docker.com', url: '') {
sh "docker push iulbricht/docker-checker:v1.$BUILD_NUMBER"
sh "docker push iulbricht/docker-checker:latest"
}
}
}
}
}
}