Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker image build #497

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM eclipse-temurin:17-jre-alpine

RUN mkdir -p /app
COPY build/app/rd-cli.jar /app

ENV RD_AUTH_PROMPT false

ENTRYPOINT ["java", "-jar", "/app/rd-cli.jar"]
CMD ["--help"]
21 changes: 21 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Docker Image Build

# How to

## Build Docker image

From source root perform:

```shell
./gradlew :docker:dockerBuild
```

This will build `rundeck/cli:latest` and `rundeck/cli:$VERSION` image tags.

## Run docker image

Run the image

```shell
docker run -it rundeck/cli --help
```
67 changes: 67 additions & 0 deletions docker/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
plugins {
id 'base'
id "org.ajoberstar.grgit" version "4.1.1"
}
configurations {
appJar
}
dependencies {
appJar project(path: ":rd-cli-tool", configuration: 'shadow')
}

project.ext.branch = grgit.branch.current().name
project.ext.commit = grgit.head().id
project.ext.gitdescribe = grgit.describe()

tasks.register('dockerBuild', DockerBuild) {
def dockerRepo = "${dockerOrgName}/${dockerRepoName}"
dependsOn configurations.appJar
tags = [
"$dockerRepo:latest",
"$dockerRepo:$version"
]

outputs.dir("$project.buildDir/app")
inputs.file "$project.projectDir/Dockerfile"
}

assemble.dependsOn dockerBuild


class DockerBuild extends DefaultTask {
@Input
String[] tags

@TaskAction
def build() {
File appJar = project.configurations.appJar.files.first()

println "Building image tags $tags using ${appJar.name}"
project.copy {
from appJar
into "$project.buildDir/app"
rename appJar.name,'rd-cli.jar'
}

def args = [
"docker",
"build",
"--label=org.rundeck.cli.version=$project.version",
"--label=org.rundeck.cli.commit=$project.commit",
"--label=org.rundeck.cli.gitdescribe=$project.gitdescribe"
]

tags.each {
args.add('-t=' + it)
}

args << '.'

println "exec: " + args
project.exec {
workingDir "./"
commandLine args
}
}
}

2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ toolbeltVersion=0.2.29
lombokVersion=1.18.24
retrofitVersion=2.9.0
okhttpVersion=4.9.3
dockerOrgName=rundeck
dockerRepoName=cli
34 changes: 34 additions & 0 deletions gradle/verification-keyring.keys
Original file line number Diff line number Diff line change
Expand Up @@ -8859,3 +8859,37 @@ H2Ir6RZpmqeY4NI6ujL41iUru20RzTNCAQA8jgmCMq9kDxaykpzdSvFHnyijywCZ
B1jblPtxo2UqRO/qhPfqSkoVcpWmxgiPUFOr
=w8k7
-----END PGP PUBLIC KEY BLOCK-----

pub EE8ECBBBC188FD5D
uid Andrew Oberstar (Artifact Signing) <ajoberstar@gmail.com>

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: BCPG v1.68

mQINBGGmcvMBEAC7BcmYnWIy1635ba+JXKwXtZLZCLX6y4LbDcAmToKM3MXQoYU9
3J+Gt3riZIDDZ6x0/lLf4IQlJnfd/QhKGE+SsfF6nCEWMOKIS4hRI3LczC4x3hrY
tHmG/CVFECV33C5SCvzeedzIOSSHy0ybZFrhE2DYXgZddavcxamuRyUOUZAV27yV
Vyn4RYHSqy9YRz5WrN9R7BK+MeIh2vBJ8Nd9N36z5kBukTLeDZDsb8wujSuMyPGz
P09gzieX6B5x7biz7Jzotqj4f5KRD0fHbCSVW60N1S7xXFsjZZf6dYdYINWW0Utc
ABY6T1H8FOfqkd2tcfv4TqNd03vweUiPQnh0v6nWURrQKsty2z7YcVI543l4P0Bv
/5E3YfT/B/BohsYbakT6nLSlKw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Yk7
GZgUYf5Ao1oYyc6LroGCb5aP9VNWY8YvIYroVzTfpnKDcFsqyNbrhTck9OjjKhp5
mKqcdEx2k3BJHkgsnorYJ7RneXuZlyiYoeUgUwnPSObY/A==
=gKXg
-----END PGP PUBLIC KEY BLOCK-----
81 changes: 81 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<trusted-keys>
<trusted-key id="015479e1055341431b4545ab72475fd306b9cab7">
<trusting group="com.googlecode.javaewah" name="JavaEWAH" version="0.7.9"/>
<trusting group="com.googlecode.javaewah" name="JavaEWAH" version="1.1.12"/>
<trusting group="com.googlecode.javaewah" name="JavaEWAH" version="1.1.13"/>
<trusting group="com.googlecode.javaewah" name="JavaEWAH" version="1.1.7"/>
</trusted-key>
Expand All @@ -33,6 +34,7 @@
<trusting group="org.yaml" name="snakeyaml" version="1.31"/>
<trusting group="org.yaml" name="snakeyaml" version="1.33"/>
</trusted-key>
<trusted-key id="124dac8350968ec2a8260584ee8ecbbbc188fd5d" group="org.ajoberstar.grgit"/>
<trusted-key id="144219b604dde6a2383fa0ee9c6404ebce3e4464" group="com.github.zafarkhaja" name="java-semver" version="0.9.0"/>
<trusted-key id="19beab2d799c020f17c69126b16698a4adf4d638">
<trusting group="org.checkerframework" name="checker-qual" version="2.10.0"/>
Expand Down Expand Up @@ -770,6 +772,14 @@
<sha256 value="ab05da5b081f27f64f00b9695962bef0865c3968f8d3e6c32824d319cceea0b5" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.googlecode.javaewah" name="JavaEWAH" version="1.1.12">
<artifact name="JavaEWAH-1.1.12.jar">
<sha256 value="b19204331ac6e204befaf508a68f52ec6b4638d9d9bacddbebd435f9c4d500f2" origin="Generated by Gradle"/>
</artifact>
<artifact name="JavaEWAH-1.1.12.pom">
<sha256 value="06184e9b059e080911827136af5ec78f57ee4c3bc19f632eb561b0df8f8788ce" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.googlecode.javaewah" name="JavaEWAH" version="1.1.13">
<artifact name="JavaEWAH-1.1.13.jar">
<sha256 value="4c0fda2b1d317750d7ea324e36c70b2bc48310c0aaae67b98df0915d696d7111" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -1544,6 +1554,51 @@
<sha256 value="be846cb493ec623fbc89f4cfe884b3f60737207e6dfe4bbccb00af13515f2f99" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ajoberstar.grgit" name="grgit-core" version="4.1.1">
<artifact name="grgit-core-4.1.1.jar">
<sha256 value="c626aa433d6d13f245bd2c865bf46f1aa3457540bfd05aa84474b3a1ee4c2319" origin="Generated by Gradle"/>
</artifact>
<artifact name="grgit-core-4.1.1.module">
<sha256 value="180e750b87be263edf3a40844d03e567b5e502ec109c539417e3d6bc561b23e3" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ajoberstar.grgit" name="grgit-core" version="5.0.0">
<artifact name="grgit-core-5.0.0.jar">
<sha256 value="7ae1de5036f6a4ff2c4f21d42ee279dcbbca70e603a44b4feb30592b47aef06f" origin="Generated by Gradle"/>
</artifact>
<artifact name="grgit-core-5.0.0.module">
<sha256 value="7ee003bfee7ef1b351cb15761805d4b391c8ec2500c3175ac75a3532033b2a35" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ajoberstar.grgit" name="grgit-gradle" version="4.1.1">
<artifact name="grgit-gradle-4.1.1.jar">
<sha256 value="aa846cbf7cb6a263a49884a71b16914b4886ec780e87ec86d303cfcd4845def3" origin="Generated by Gradle"/>
</artifact>
<artifact name="grgit-gradle-4.1.1.pom">
<ignored-keys>
<ignored-key id="124dac8350968ec2a8260584ee8ecbbbc188fd5d" reason="PGP verification failed"/>
</ignored-keys>
<sha256 value="62a7b33ccc3fc9e4327f1babd32ff3769cd47fc117c60593400cb60acac0d06a" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ajoberstar.grgit" name="grgit-gradle" version="5.0.0">
<artifact name="grgit-gradle-5.0.0.jar">
<sha256 value="69af16897020d563c706d60144d801a67ad24b671de060398fcac9868eda3c2c" origin="Generated by Gradle"/>
</artifact>
<artifact name="grgit-gradle-5.0.0.module">
<sha256 value="449f96a20db6c8262f36da6c2d959d12425bdcb63a922e88922b79d0a0be5499" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ajoberstar.grgit" name="org.ajoberstar.grgit.gradle.plugin" version="4.1.1">
<artifact name="org.ajoberstar.grgit.gradle.plugin-4.1.1.pom">
<sha256 value="ed8421ac81b76c4883333cee36f6b399d89ef1b4546b12d5249e60f7d8df439e" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ajoberstar.grgit" name="org.ajoberstar.grgit.gradle.plugin" version="5.0.0">
<artifact name="org.ajoberstar.grgit.gradle.plugin-5.0.0.pom">
<sha256 value="72ccd000dd0eb950700eeae0b4e90ba2e51bfcb744e8566282033472e56aab20" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.anarres.jdiagnostics" name="jdiagnostics" version="1.0.7">
<artifact name="jdiagnostics-1.0.7.jar">
<sha256 value="7c7fe5347ce2d147ff7bc372f4b2e110d60261fb0f2809e719e3c56ca52ee3d7" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -3116,6 +3171,14 @@
<sha256 value="43f30a6f8370440194de49a6e1cbb3b385cc175c67c8ce6506fa172c475ee3db" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.eclipse.jgit" name="org.eclipse.jgit" version="5.13.0.202109080827-r">
<artifact name="org.eclipse.jgit-5.13.0.202109080827-r.jar">
<sha256 value="dabf8369f0cdf8cf17b7f7da4bda9320c570bb754c88e0beb7b852812cf5cd25" origin="Generated by Gradle"/>
</artifact>
<artifact name="org.eclipse.jgit-5.13.0.202109080827-r.pom">
<sha256 value="a8417745cfa2d95d6a9711e9413fca984fc5666b7627bad1540cf27d462ae813" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.eclipse.jgit" name="org.eclipse.jgit" version="5.13.1.202206130422-r">
<artifact name="org.eclipse.jgit-5.13.1.202206130422-r.jar">
<sha256 value="d679365a6c8e55c1496701099f5e5765433f68dcb659759416ba5b222eb5055c" origin="Generated by Gradle"/>
Expand All @@ -3124,6 +3187,14 @@
<sha256 value="3cc4bebf9c936578eae2b6d24fb2a912d89993a54fd0e2fbc1c8abc049878515" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.eclipse.jgit" name="org.eclipse.jgit" version="6.0.0.202111291000-r">
<artifact name="org.eclipse.jgit-6.0.0.202111291000-r.jar">
<sha256 value="35290aaacc62561304cd02ef8cfa5b297a8800755d7d7424e52954fcc52a1203" origin="Generated by Gradle"/>
</artifact>
<artifact name="org.eclipse.jgit-6.0.0.202111291000-r.pom">
<sha256 value="a5108b2c735d67b65f87b7feefb9310148426b1e1d01f1dd634e332c1da6254b" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.eclipse.jgit" name="org.eclipse.jgit-parent" version="4.0.1.201506240215-r">
<artifact name="org.eclipse.jgit-parent-4.0.1.201506240215-r.pom">
<sha256 value="fe5c093914e733fc935dfe9717572c613881688df39fda9da650bdedf611bf3e" origin="Generated by Gradle"/>
Expand All @@ -3134,11 +3205,21 @@
<sha256 value="2887281c99d474dd8c003afe32b2166e197ff1808999563992c3c3183b6c32ba" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.eclipse.jgit" name="org.eclipse.jgit-parent" version="5.13.0.202109080827-r">
<artifact name="org.eclipse.jgit-parent-5.13.0.202109080827-r.pom">
<sha256 value="a18fd7d0c41fda8d8f1c4a24b5000a866456147a24746ee6cc4731e788a18dee" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.eclipse.jgit" name="org.eclipse.jgit-parent" version="5.13.1.202206130422-r">
<artifact name="org.eclipse.jgit-parent-5.13.1.202206130422-r.pom">
<sha256 value="de65fc76ed8f44a57785ee164918dc3d4f55ee3fea6a47bc7cb1baa19ef1bc83" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.eclipse.jgit" name="org.eclipse.jgit-parent" version="6.0.0.202111291000-r">
<artifact name="org.eclipse.jgit-parent-6.0.0.202111291000-r.pom">
<sha256 value="2a535810cd8686811a693d1abb8b101911356df46585dc690f44cd346c77bf05" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.eclipse.jgit" name="org.eclipse.jgit.gpg.bc" version="5.12.0.202106070339-r">
<artifact name="org.eclipse.jgit.gpg.bc-5.12.0.202106070339-r.jar">
<sha256 value="1bda6185f547c2c26a39f08254d72d37ff4d289f2a37bb1b20378894fcafaca2" origin="Generated by Gradle"/>
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ include 'rd-cli-enterprise'
include 'rd-testing'
include 'rd-cli-acl'
include 'integration-tests'

include 'docker'