-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile-stable.groovy
86 lines (83 loc) · 2.57 KB
/
Jenkinsfile-stable.groovy
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
pipeline {
environment {
registry = "dexai2/drake-pytorch"
registryCredential = 'dockerhub_id'
}
agent any
options {
parallelsAlwaysFailFast()
}
stages {
stage('build_drake_torch') {
parallel {
stage('build_cuda') {
steps {
echo "starting in $PWD"
sh "cd $WORKSPACE"
sh "ls"
sh "./build_image.sh --cuda --stable --nocache"
}
}
stage('build_cpu') {
steps {
echo "starting in $PWD"
sh "cd $WORKSPACE"
sh "ls"
sh "./build_image.sh --cpu --stable --nocache"
}
}
}
}
stage('build_drake_torch_ros') {
parallel {
stage('build_cuda') {
steps {
echo "starting in $PWD"
sh "cd $WORKSPACE"
sh "ls"
sh "./build_image.sh --cuda --stable --ros --nocache"
}
}
stage('build_cpu') {
steps {
echo "starting in $PWD"
sh "cd $WORKSPACE"
sh "ls"
sh "./build_image.sh --cpu --stable --ros --nocache"
}
}
}
}
stage('test_dockers') {
steps {
sh "./test_image.sh dexai2/drake-pytorch:cuda-stable-ros"
// sh "./publish_docker_images.sh" // do not publish by default
}
}
// prerequisite for jenkins' docker plugin to login properly:
// sudo apt install gnupg2 pass
stage('publish_images') {
steps {
script {
docker.withRegistry('', registryCredential) {
sh "./publish_image.sh --cuda --stable"
sh "./publish_image.sh --cuda --stable --ros"
sh "./publish_image.sh --cpu --stable"
sh "./publish_image.sh --cpu --stable --ros"
}
}
}
}
}
post {
always {
// step([$class: 'WsCleanup'])
sh "chmod -R 777 ."
cleanWs()
deleteDir()
}
cleanup {
deleteDir()
}
}
}