-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
352b691
commit f1db1b5
Showing
5 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "${@}" |