diff --git a/v0.81.2/Dockerfile b/v0.81.2/Dockerfile new file mode 100755 index 0000000..e076fe9 --- /dev/null +++ b/v0.81.2/Dockerfile @@ -0,0 +1,34 @@ +FROM adoptopenjdk:11-jdk-hotspot + +LABEL "org.opencontainers.image.title"="jbang" +LABEL "org.opencontainers.image.description"="Unleash the power of Java" +LABEL "org.opencontainers.image.url"="https://jbang.dev" +LABEL "org.opencontainers.image.licenses"="MIT" +LABEL "org.opencontainers.image.version"="0.81.2" +LABEL "org.opencontainers.image.revision"="95a715e40c06316b8069555447a99a3a9c78584e" + + +COPY assembly/* / + +RUN jar xf jbang-0.81.2.zip && \ + rm jbang-0.81.2.zip && \ + mv jbang-* jbang && \ + chmod +x jbang/bin/jbang + +VOLUME /scripts + +ENV PATH="${PATH}:/jbang-0.81.2/bin" + +ADD ./entrypoint /bin/entrypoint + +ENV SCRIPTS_HOME /scripts +ENV JBANG_VERSION 0.81.2 + +VOLUME /scripts + +ENV PATH="${PATH}:/jbang/bin" + +## github action does not allow writing to $HOME thus routing this elsewhere +ENV JBANG_DIR="/jbang/.jbang" + +ENTRYPOINT ["entrypoint"] \ No newline at end of file diff --git a/v0.81.2/LICENSE b/v0.81.2/LICENSE new file mode 100755 index 0000000..6b3236c --- /dev/null +++ b/v0.81.2/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Max Rydahl Andersen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/v0.81.2/action.yml b/v0.81.2/action.yml new file mode 100755 index 0000000..70769ed --- /dev/null +++ b/v0.81.2/action.yml @@ -0,0 +1,21 @@ +name: 'Java Scripting w/jbang' +description: 'Run Java as scripts with https://jbang.dev from your GitHub repo' +branding: + icon: hash + color: red +inputs: + jbangargs: + description: 'Arguments for jbang' + required: false + script: + description: 'Script file to run' + required: true + scriptargs: + description: 'arguments to pass on to the script' + required: false + trust: + description: "if present will be added to trust before running jbang" + required: false +runs: + using: 'docker' + image: 'docker://ghcr.io/jbangdev/jbang-action:0.81.2' \ No newline at end of file diff --git a/v0.81.2/assembly/jbang-0.81.2.zip b/v0.81.2/assembly/jbang-0.81.2.zip new file mode 100755 index 0000000..2415838 Binary files /dev/null and b/v0.81.2/assembly/jbang-0.81.2.zip differ diff --git a/v0.81.2/entrypoint b/v0.81.2/entrypoint new file mode 100755 index 0000000..c2ace4c --- /dev/null +++ b/v0.81.2/entrypoint @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# In OpenShift, containers are run as a random high number uid +# that doesn't exist in /etc/passwd +if [ `id -u` -ge 500 ] || [ -z "${CURRENT_UID}" ]; then + + cat << EOF > /tmp/passwd +root:x:0:0:root:/root:/bin/bash +jbang:x:`id -u`:`id -g`:,,,:/scripts:/bin/bash +EOF + + cat /tmp/passwd > /etc/passwd + rm /tmp/passwd +fi + +if [[ ! -z "$INPUT_TRUST" ]]; then + jbang trust add $INPUT_TRUST +fi + +echo jbang $INPUT_JBANGARGS $INPUT_SCRIPT $INPUT_ARGS "${@}" +exec jbang $INPUT_JBANGARGS $INPUT_SCRIPT $INPUT_SCRIPTARGS "${@}" \ No newline at end of file