File tree 2 files changed +27
-3
lines changed
2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -143,12 +143,16 @@ commands:
143
143
144
144
docker_publish_images :
145
145
description : " Upload the docker images"
146
+ parameters :
147
+ include_commit_hash :
148
+ type : boolean
149
+ default : false
146
150
steps :
147
151
- run :
148
152
name : " Publish Docker Images"
149
153
command : |
150
154
docker login --username "${DOCKER_USER_RW}" --password "${DOCKER_PASSWORD_RW}"
151
- ./gradlew --no-daemon --parallel "-Pbranch=${CIRCLE_BRANCH}" uploadDocker
155
+ ./gradlew --no-daemon --parallel "-Pbranch=${CIRCLE_BRANCH} -PincludeCommitHash=<< parameters.include_commit_hash >> " uploadDocker
152
156
153
157
notify :
154
158
description : " Notify Slack"
@@ -431,23 +435,33 @@ jobs:
431
435
- notify
432
436
433
437
publishDockerAmd64 :
438
+ parameters :
439
+ include_commit_hash :
440
+ type : boolean
441
+ default : false
434
442
executor : machine_executor_amd64
435
443
steps :
436
444
- prepare
437
445
- attach_workspace :
438
446
at : ~/project
439
447
- docker_trust_sign
440
- - docker_publish_images
448
+ - docker_publish_images :
449
+ include_commit_hash : << parameters.include_commit_hash >>
441
450
- notify
442
451
443
452
publishDockerArm64 :
453
+ parameters :
454
+ include_commit_hash :
455
+ type : boolean
456
+ default : false
444
457
executor : machine_executor_arm64
445
458
steps :
446
459
- prepare
447
460
- attach_workspace :
448
461
at : ~/project
449
462
- docker_trust_sign
450
- - docker_publish_images
463
+ - docker_publish_images :
464
+ include_commit_hash : << parameters.include_commit_hash >>
451
465
- notify
452
466
453
467
manifestDocker :
Original file line number Diff line number Diff line change @@ -532,6 +532,16 @@ def executableAndArg = System.getProperty('os.name').toLowerCase().contains('win
532
532
task distDocker {
533
533
dependsOn dockerDistUntar
534
534
def dockerBuildVersion = ' develop'
535
+
536
+ if (project. hasProperty(' includeCommitHash' ) && project. property(' includeCommitHash' ). toBoolean()) {
537
+ def commitHash = new ByteArrayOutputStream ()
538
+ exec {
539
+ commandLine ' git' , ' rev-parse' , ' --short' , ' HEAD'
540
+ standardOutput = commitHash
541
+ }
542
+ dockerBuildVersion + = ' -' + commitHash
543
+ }
544
+
535
545
doLast {
536
546
for (def variant in dockerJdkVariants) {
537
547
copy {
You can’t perform that action at this time.
0 commit comments