initial commit
This commit is contained in:
7
distros/busybox/Dockerfile
Normal file
7
distros/busybox/Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
# Container image that runs your code
|
||||
FROM busybox:1.36.0
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
14
distros/busybox/action.yaml
Normal file
14
distros/busybox/action.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
name: busybox
|
||||
description: "Run busybox commands."
|
||||
inputs:
|
||||
args:
|
||||
description: "Shell arguments to pass into busybox."
|
||||
required: true
|
||||
outputs:
|
||||
console:
|
||||
description: "The console output of the command."
|
||||
runs:
|
||||
using: docker
|
||||
image: Dockerfile
|
||||
args:
|
||||
- ${{ inputs.args }}
|
||||
15
distros/busybox/entrypoint.sh
Normal file
15
distros/busybox/entrypoint.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
ARGS="$@"
|
||||
|
||||
OUTPUT=$(sh -c "$ARGS")
|
||||
RESULT=$?
|
||||
echo "$OUTPUT"
|
||||
|
||||
#Output multiline strings.
|
||||
#https://trstringer.com/github-actions-multiline-strings/
|
||||
OUTPUT="${OUTPUT//'%'/'%25'}"
|
||||
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
||||
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
||||
echo "::set-output name=console::$OUTPUT"
|
||||
|
||||
exit $RESULT
|
||||
18
distros/rockylinux2/Dockerfile
Normal file
18
distros/rockylinux2/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
# Container image that runs your code
|
||||
FROM rockylinux:9.1
|
||||
|
||||
RUN dnf install -y \
|
||||
rpm-sign \
|
||||
unzip \
|
||||
pinentry \
|
||||
wget \
|
||||
zip
|
||||
|
||||
COPY setup_gpg.sh /setup_gpg.sh
|
||||
RUN chmod +x /setup_gpg.sh
|
||||
RUN /setup_gpg.sh
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
19
distros/rockylinux2/action.yaml
Normal file
19
distros/rockylinux2/action.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
name: rockylinux
|
||||
description: "Run rockylinux commands."
|
||||
inputs:
|
||||
#args:
|
||||
# description: "Shell arguments to pass into Rocky Linux."
|
||||
# required: true
|
||||
workingDir:
|
||||
description: "Working directory to execute the commands in."
|
||||
required: true
|
||||
default: "."
|
||||
outputs:
|
||||
console:
|
||||
description: "The console output of the command."
|
||||
runs:
|
||||
using: docker
|
||||
image: Dockerfile
|
||||
args:
|
||||
#- "${{ inputs.workingDir }}"
|
||||
- "${{ inputs.args }}"
|
||||
18
distros/rockylinux2/entrypoint.sh
Normal file
18
distros/rockylinux2/entrypoint.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
WORKDIR="$1"
|
||||
cd "$WORKDIR"
|
||||
|
||||
ARGS_ARRAY=($@)
|
||||
ARGS=${array[@]:1}
|
||||
OUTPUT=$(bash -c "$ARGS")
|
||||
RESULT=$?
|
||||
echo "$OUTPUT"
|
||||
|
||||
#Output multiline strings.
|
||||
#https://trstringer.com/github-actions-multiline-strings/
|
||||
OUTPUT="${OUTPUT//'%'/'%25'}"
|
||||
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
||||
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
||||
echo "::set-output name=console::$OUTPUT"
|
||||
|
||||
exit $RESULT
|
||||
29
distros/rockylinux2/setup_gpg.sh
Normal file
29
distros/rockylinux2/setup_gpg.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
#Importing gpg key via cli
|
||||
#https://d.sb/2016/11/gpg-inappropriate-ioctl-for-device-errors
|
||||
GPG_CONF="$HOME/.gnupg/gpg.conf"
|
||||
GPG_AGENT_CONF="$HOME/.gnupg/gpg-agent.conf"
|
||||
|
||||
function create_file
|
||||
{
|
||||
FILE_PATH="$1"
|
||||
CONTENTS="$2"
|
||||
DIR=$(dirname "$FILE_PATH")
|
||||
|
||||
mkdir -p "$DIR"
|
||||
chmod 700 "$DIR"
|
||||
echo "$CONTENTS" > "$FILE_PATH"
|
||||
}
|
||||
|
||||
create_file "$GPG_CONF" "$(cat <<EOF
|
||||
use-agent
|
||||
pinentry-mode loopback
|
||||
EOF
|
||||
)"
|
||||
|
||||
create_file "$GPG_AGENT_CONF" "$(cat <<EOF
|
||||
allow-loopback-pinentry
|
||||
EOF
|
||||
)"
|
||||
|
||||
echo "RELOADAGENT" | gpg-connect-agent
|
||||
Reference in New Issue
Block a user