forked from dpgiakatos/PyPoll-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
61 lines (50 loc) · 1.41 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
52
53
54
55
56
57
58
59
60
61
/*
* Jenkinsfile to pull the source code from git, build a docker image
* using a Dockerfile and push that image to a registry.
*/
pipeline {
agent any
environment {
/*
* edit the following variables
*/
// the name of your docker image
// set to 'datalabauth/projectname' for Dockerhub
// or just to 'projectname' if you're using our private registry
dockertag = 'datalabauth/pypoll-app'
// the registry name
// set to 'https://registry.hub.docker.com' for DockerHub
// or to 'https://registry.csd.auth.gr' for our private registry
registry = 'https://registry.hub.docker.com'
// the credentials to the above registry as stored in Jenkins
// set to 'dockerhub' for DockerHub
// or 'datalab-registry' for our private registry
registry_credentials = 'dockerhub'
}
// you probably don't need to edit anything below this line
stages {
stage('Checkout the source code') {
steps {
checkout scm
}
}
stage('Build') {
steps {
script {
image_api = docker.build("${dockertag}-api", "./api")
image_spa = docker.build("${dockertag}-spa", "./spa")
}
}
}
stage('Push') {
steps {
script {
docker.withRegistry(registry, registry_credentials) {
image_api.push()
image_spa.push()
}
}
}
}
}
}