@@ -6,15 +6,21 @@ pipeline {
6
6
7
7
}
8
8
9
+ environment {
10
+ DOCKER_IMAGE_FILE = ' docker-ptf.gz'
11
+ DOCKER_IMAGE_TAG = ' latest'
12
+ DOCKER_IMAGE_FILE_DIR = ' sonic-buildimage/target'
13
+ }
14
+
9
15
triggers {
10
16
pollSCM(' @midnight' )
11
17
}
12
18
13
19
stages {
14
20
stage(' Prepare' ) {
15
21
steps {
16
- step([$ class : ' WsCleanup ' ])
17
- checkout([$class : ' GitSCM' ,
22
+ dir( ' sonic-buildimage ' ) {
23
+ checkout([$class : ' GitSCM' ,
18
24
branches : [[name : ' refs/heads/master' ]],
19
25
extensions : [[$class : ' SubmoduleOption' ,
20
26
disableSubmodules : false ,
@@ -23,6 +29,7 @@ pipeline {
23
29
reference : ' ' ,
24
30
trackingSubmodules : false ]],
25
31
userRemoteConfigs : [[url : ' http://github.com/Azure/sonic-buildimage' ]]])
32
+ }
26
33
}
27
34
}
28
35
@@ -31,6 +38,8 @@ pipeline {
31
38
sh '''
32
39
#!/bin/bash -xe
33
40
41
+ ls -l
42
+ cd sonic-buildimage
34
43
git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $(realpath --relative-to=. $(cut -d" " -f2 .git))" > .git'
35
44
36
45
make configure PLATFORM=generic
@@ -39,11 +48,18 @@ make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-generic.bin target/sonic-aboot-gener
39
48
}
40
49
}
41
50
51
+ stage(' Upload' ) {
52
+ steps {
53
+ withCredentials([usernamePassword(credentialsId : ' sonicdev-cr' , usernameVariable : ' REGISTRY_USERNAME' , passwordVariable : ' REGISTRY_PASSWD' )]) {
54
+ sh ' ./scripts/lib/docker-upload.sh'
55
+ }
56
+ }
57
+ }
42
58
}
43
59
post {
44
60
45
61
success {
46
- archiveArtifacts(artifacts : ' target/**' )
62
+ archiveArtifacts(artifacts : ' sonic-buildimage/ target/**' )
47
63
}
48
64
fixed {
49
65
slackSend(color :' #00FF00' , message : " Build job back to normal: ${ env.JOB_NAME} ${ env.BUILD_NUMBER} (<${ env.BUILD_URL} |Open>)" )
0 commit comments