|
1 |
| -pipeline { |
2 |
| - agent { |
3 |
| - docker { |
4 |
| - image 'haufelexware/wicked.build-agent:latest' |
5 |
| - // Add docker group |
6 |
| - args '--group-add 125' |
7 |
| - } |
8 |
| - } |
9 |
| - triggers { |
10 |
| - pollSCM "H/10 * * * *" |
11 |
| - upstream(upstreamProjects: "wicked.env/" + env.BRANCH_NAME.replaceAll("/", "%2F"), threshold: hudson.model.Result.SUCCESS) |
12 |
| - } |
| 1 | +// pipeline { |
| 2 | +// agent { |
| 3 | +// docker { |
| 4 | +// image 'haufelexware/wicked.build-agent:latest' |
| 5 | +// // Add docker group |
| 6 | +// args '--group-add 999' |
| 7 | +// } |
| 8 | +// } |
| 9 | +// triggers { |
| 10 | +// pollSCM "H/10 * * * *" |
| 11 | +// upstream(upstreamProjects: "wicked.env/" + env.BRANCH_NAME.replaceAll("/", "%2F"), threshold: hudson.model.Result.SUCCESS) |
| 12 | +// } |
13 | 13 |
|
14 |
| - stages { |
15 |
| - stage('SonarQube analysis') { |
16 |
| - steps { |
17 |
| - script { |
18 |
| - sh 'id' |
19 |
| - def dockerTag = env.BRANCH_NAME.replaceAll('/', '-') |
20 |
| - if (dockerTag == 'next') { |
21 |
| - // requires SonarQube Scanner 2.8+ |
22 |
| - def scannerHome = tool 'wicked-sonar'; |
23 |
| - withSonarQubeEnv('sonar') { |
24 |
| - sh "${scannerHome}/bin/sonar-scanner" |
25 |
| - } |
26 |
| - } else { |
27 |
| - echo 'Skipping SonarQube, not "next" branch.' |
28 |
| - } |
29 |
| - } |
30 |
| - } |
31 |
| - } |
| 14 | +// stages { |
| 15 | +// stage('SonarQube analysis') { |
| 16 | +// steps { |
| 17 | +// script { |
| 18 | +// sh 'id' |
| 19 | +// def dockerTag = env.BRANCH_NAME.replaceAll('/', '-') |
| 20 | +// if (dockerTag == 'next') { |
| 21 | +// // requires SonarQube Scanner 2.8+ |
| 22 | +// def scannerHome = tool 'wicked-sonar'; |
| 23 | +// withSonarQubeEnv('sonar') { |
| 24 | +// sh "${scannerHome}/bin/sonar-scanner" |
| 25 | +// } |
| 26 | +// } else { |
| 27 | +// echo 'Skipping SonarQube, not "next" branch.' |
| 28 | +// } |
| 29 | +// } |
| 30 | +// } |
| 31 | +// } |
32 | 32 |
|
33 |
| - stage('Build and Push') { |
34 |
| - steps { |
35 |
| - script { |
36 |
| - withCredentials([ |
37 |
| - usernamePassword(credentialsId: 'dockerhub_wicked', usernameVariable: 'DOCKER_REGISTRY_USER', passwordVariable: 'DOCKER_REGISTRY_PASSWORD') |
38 |
| - ]) { |
39 |
| - env.DOCKER_TAG = env.BRANCH_NAME.replaceAll('/', '-') |
40 |
| - sh './build.sh --push' |
41 |
| - } |
42 |
| - } |
43 |
| - } |
44 |
| - } |
45 |
| - } |
46 |
| -} |
| 33 | +// stage('Build and Push') { |
| 34 | +// steps { |
| 35 | +// script { |
| 36 | +// withCredentials([ |
| 37 | +// usernamePassword(credentialsId: 'dockerhub_wicked', usernameVariable: 'DOCKER_REGISTRY_USER', passwordVariable: 'DOCKER_REGISTRY_PASSWORD') |
| 38 | +// ]) { |
| 39 | +// env.DOCKER_TAG = env.BRANCH_NAME.replaceAll('/', '-') |
| 40 | +// sh './build.sh --push' |
| 41 | +// } |
| 42 | +// } |
| 43 | +// } |
| 44 | +// } |
| 45 | +// } |
| 46 | +// } |
47 | 47 |
|
48 |
| -// properties([ |
49 |
| -// pipelineTriggers([ |
50 |
| -// [$class: "SCMTrigger", scmpoll_spec: "H/10 * * * *"], |
51 |
| -// [$class: 'jenkins.triggers.ReverseBuildTrigger', upstreamProjects: "wicked.env/" + env.BRANCH_NAME.replaceAll("/", "%2F"), threshold: hudson.model.Result.SUCCESS] |
52 |
| -// ]) |
53 |
| -// ]) |
| 48 | +properties([ |
| 49 | + pipelineTriggers([ |
| 50 | + [$class: "SCMTrigger", scmpoll_spec: "H/10 * * * *"], |
| 51 | + [$class: 'jenkins.triggers.ReverseBuildTrigger', upstreamProjects: "wicked.env/" + env.BRANCH_NAME.replaceAll("/", "%2F"), threshold: hudson.model.Result.SUCCESS] |
| 52 | + ]) |
| 53 | +]) |
54 | 54 |
|
55 |
| -// node('docker') { |
| 55 | +node('docker') { |
56 | 56 |
|
57 |
| -// stage('Checkout') { |
58 |
| -// checkout scm |
59 |
| -// } |
| 57 | + stage('Checkout') { |
| 58 | + checkout scm |
| 59 | + } |
60 | 60 |
|
61 |
| -// def dockerTag = env.BRANCH_NAME.replaceAll('/', '-') |
| 61 | + def dockerTag = env.BRANCH_NAME.replaceAll('/', '-') |
62 | 62 |
|
63 |
| -// echo 'Building docker tag: ' + dockerTag |
64 |
| -// env.DOCKER_TAG = dockerTag |
| 63 | + echo 'Building docker tag: ' + dockerTag |
| 64 | + env.DOCKER_TAG = dockerTag |
65 | 65 |
|
66 |
| -// stage('SonarQube analysis') { |
67 |
| -// if (dockerTag == 'next') { |
68 |
| -// // requires SonarQube Scanner 2.8+ |
69 |
| -// def scannerHome = tool 'wicked-sonar'; |
70 |
| -// withSonarQubeEnv('sonar') { |
71 |
| -// sh "${scannerHome}/bin/sonar-scanner" |
72 |
| -// } |
73 |
| -// } else { |
74 |
| -// echo 'Skipping SonarQube, not "next" branch.' |
75 |
| -// } |
76 |
| -// } |
| 66 | + // stage('SonarQube analysis') { |
| 67 | + // if (dockerTag == 'next') { |
| 68 | + // // requires SonarQube Scanner 2.8+ |
| 69 | + // def scannerHome = tool 'wicked-sonar'; |
| 70 | + // withSonarQubeEnv('sonar') { |
| 71 | + // sh "${scannerHome}/bin/sonar-scanner" |
| 72 | + // } |
| 73 | + // } else { |
| 74 | + // echo 'Skipping SonarQube, not "next" branch.' |
| 75 | + // } |
| 76 | + // } |
77 | 77 |
|
78 |
| -// stage('Build and Push') { |
79 |
| -// withCredentials([ |
80 |
| -// usernamePassword(credentialsId: 'dockerhub_wicked', usernameVariable: 'DOCKER_REGISTRY_USER', passwordVariable: 'DOCKER_REGISTRY_PASSWORD') |
81 |
| -// ]) { |
| 78 | + stage('Build and Push') { |
| 79 | + withCredentials([ |
| 80 | + usernamePassword(credentialsId: 'dockerhub_wicked', usernameVariable: 'DOCKER_REGISTRY_USER', passwordVariable: 'DOCKER_REGISTRY_PASSWORD') |
| 81 | + ]) { |
82 | 82 |
|
83 |
| -// sh './build.sh --push' |
| 83 | + sh './build.sh --push' |
84 | 84 |
|
85 |
| -// } |
86 |
| -// } |
87 |
| -// } |
| 85 | + } |
| 86 | + } |
| 87 | +} |
0 commit comments