Pull secret from disk

Signed-off-by: Brett Logan <lindluni@github.com>
This commit is contained in:
Brett Logan 2023-01-04 00:41:31 -05:00
parent f00a0bbe87
commit 22cdb4a0e0
5 changed files with 18 additions and 18 deletions

View file

@ -8,12 +8,12 @@ set -euo pipefail
url=$(curl -s \ url=$(curl -s \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
https://api.github.com/repos/Azure/arm-ttk/releases/latest | jq -r '.tarball_url') https://api.github.com/repos/Azure/arm-ttk/releases/latest | jq -r '.tarball_url')
mkdir -p /usr/lib/microsoft mkdir -p /usr/lib/microsoft
curl --retry 5 --retry-delay 5 -sL \ curl --retry 5 --retry-delay 5 -sL \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"${url}" | tar -xz -C /usr/lib/microsoft "${url}" | tar -xz -C /usr/lib/microsoft
mv /usr/lib/microsoft/Azure-arm-ttk-*/arm-ttk /usr/lib/microsoft/arm-ttk mv /usr/lib/microsoft/Azure-arm-ttk-*/arm-ttk /usr/lib/microsoft/arm-ttk
rm -rf /usr/lib/microsoft/Azure-arm-ttk-* rm -rf /usr/lib/microsoft/Azure-arm-ttk-*

View file

@ -4,12 +4,12 @@ set -euo pipefail
url=$(curl -s \ url=$(curl -s \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"https://api.github.com/repos/instrumenta/kubeval/releases/tags/${KUBEVAL_VERSION}" | "https://api.github.com/repos/instrumenta/kubeval/releases/tags/${KUBEVAL_VERSION}" |
jq -r '.assets | .[] | select(.name | contains("linux-amd")) | .url') jq -r '.assets | .[] | select(.name | contains("linux-amd")) | .url')
curl --retry 5 --retry-delay 5 -sL \ curl --retry 5 --retry-delay 5 -sL \
-H "Accept: application/octet-stream" \ -H "Accept: application/octet-stream" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"${url}" | tar -xz "${url}" | tar -xz
mv kubeval /usr/local/bin mv kubeval /usr/local/bin
@ -18,12 +18,12 @@ mv kubeval /usr/local/bin
################## ##################
url=$(curl -s \ url=$(curl -s \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"https://api.github.com/repos/pinterest/ktlint/releases/tags/${KTLINT_VERSION}" | "https://api.github.com/repos/pinterest/ktlint/releases/tags/${KTLINT_VERSION}" |
jq -r '.assets | .[] | select(.name=="ktlint") | .url') jq -r '.assets | .[] | select(.name=="ktlint") | .url')
curl --retry 5 --retry-delay 5 -sL -o "/usr/bin/ktlint" \ curl --retry 5 --retry-delay 5 -sL -o "/usr/bin/ktlint" \
-H "Accept: application/octet-stream" \ -H "Accept: application/octet-stream" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"${url}" "${url}"
chmod a+x /usr/bin/ktlint chmod a+x /usr/bin/ktlint
terrascan init terrascan init
@ -34,12 +34,12 @@ cd ~ && touch .chktexrc
#################### ####################
url=$(curl -s \ url=$(curl -s \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"https://api.github.com/repos/sgerrand/alpine-pkg-glibc/releases/tags/${GLIBC_VERSION}" | "https://api.github.com/repos/sgerrand/alpine-pkg-glibc/releases/tags/${GLIBC_VERSION}" |
jq --arg name "glibc-${GLIBC_VERSION}.apk" -r '.assets | .[] | select(.name | contains($name)) | .url') jq --arg name "glibc-${GLIBC_VERSION}.apk" -r '.assets | .[] | select(.name | contains($name)) | .url')
curl --retry 5 --retry-delay 5 -sL -o "glibc-${GLIBC_VERSION}.apk" \ curl --retry 5 --retry-delay 5 -sL -o "glibc-${GLIBC_VERSION}.apk" \
-H "Accept: application/octet-stream" \ -H "Accept: application/octet-stream" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"${url}" "${url}"
apk add --no-cache "glibc-${GLIBC_VERSION}.apk" apk add --no-cache "glibc-${GLIBC_VERSION}.apk"
rm "glibc-${GLIBC_VERSION}.apk" rm "glibc-${GLIBC_VERSION}.apk"

View file

@ -6,12 +6,12 @@ set -x
apk add curl jq apk add curl jq
url=$(curl -s \ url=$(curl -s \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"https://api.github.com/repos/sgerrand/alpine-pkg-glibc/releases/tags/${GLIBC_VERSION}" | "https://api.github.com/repos/sgerrand/alpine-pkg-glibc/releases/tags/${GLIBC_VERSION}" |
jq --arg name "glibc-${GLIBC_VERSION}.apk" -r '.assets | .[] | select(.name | contains($name)) | .url') jq --arg name "glibc-${GLIBC_VERSION}.apk" -r '.assets | .[] | select(.name | contains($name)) | .url')
curl --retry 5 --retry-delay 5 -sL -o "glibc-${GLIBC_VERSION}.apk" \ curl --retry 5 --retry-delay 5 -sL -o "glibc-${GLIBC_VERSION}.apk" \
-H "Accept: application/octet-stream" \ -H "Accept: application/octet-stream" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"${url}" "${url}"
apk add --no-cache \ apk add --no-cache \
bash \ bash \

View file

@ -9,12 +9,12 @@ set -euo pipefail
mkdir -p "${PWSH_DIRECTORY}" mkdir -p "${PWSH_DIRECTORY}"
url=$(curl -s \ url=$(curl -s \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"https://api.github.com/repos/powershell/powershell/releases/${PWSH_VERSION}" | "https://api.github.com/repos/powershell/powershell/releases/${PWSH_VERSION}" |
jq -r '.assets | .[] | select(.name | contains("linux-alpine-x64")) | .url') jq -r '.assets | .[] | select(.name | contains("linux-alpine-x64")) | .url')
curl --retry 5 --retry-delay 5 -sL \ curl --retry 5 --retry-delay 5 -sL \
-H "Accept: application/octet-stream" \ -H "Accept: application/octet-stream" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"${url}" | tar -xz -C "${PWSH_DIRECTORY}" "${url}" | tar -xz -C "${PWSH_DIRECTORY}"
chmod +x "${PWSH_DIRECTORY}/pwsh" chmod +x "${PWSH_DIRECTORY}/pwsh"
ln -sf "${PWSH_DIRECTORY}/pwsh" /usr/bin/pwsh ln -sf "${PWSH_DIRECTORY}/pwsh" /usr/bin/pwsh

View file

@ -9,12 +9,12 @@ apk add --no-cache rakudo zef
###################### ######################
url=$(curl -s \ url=$(curl -s \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"https://api.github.com/repos/checkstyle/checkstyle/releases/tags/checkstyle-${CHECKSTYLE_VERSION}" | "https://api.github.com/repos/checkstyle/checkstyle/releases/tags/checkstyle-${CHECKSTYLE_VERSION}" |
jq --arg name "checkstyle-${CHECKSTYLE_VERSION}-all.jar" -r '.assets | .[] | select(.name==$name) | .url') jq --arg name "checkstyle-${CHECKSTYLE_VERSION}-all.jar" -r '.assets | .[] | select(.name==$name) | .url')
curl --retry 5 --retry-delay 5 -sL -o /usr/bin/checkstyle \ curl --retry 5 --retry-delay 5 -sL -o /usr/bin/checkstyle \
-H "Accept: application/octet-stream" \ -H "Accept: application/octet-stream" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"${url}" "${url}"
chmod a+x /usr/bin/checkstyle chmod a+x /usr/bin/checkstyle
@ -23,12 +23,12 @@ chmod a+x /usr/bin/checkstyle
############################## ##############################
url=$(curl -s \ url=$(curl -s \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"https://api.github.com/repos/google/google-java-format/releases/tags/v${GOOGLE_JAVA_FORMAT_VERSION}" | "https://api.github.com/repos/google/google-java-format/releases/tags/v${GOOGLE_JAVA_FORMAT_VERSION}" |
jq --arg name "google-java-format-${GOOGLE_JAVA_FORMAT_VERSION}-all-deps.jar" -r '.assets | .[] | select(.name==$name) | .url') jq --arg name "google-java-format-${GOOGLE_JAVA_FORMAT_VERSION}-all-deps.jar" -r '.assets | .[] | select(.name==$name) | .url')
curl --retry 5 --retry-delay 5 -sL -o /usr/bin/google-java-format \ curl --retry 5 --retry-delay 5 -sL -o /usr/bin/google-java-format \
-H "Accept: application/octet-stream" \ -H "Accept: application/octet-stream" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"${url}" "${url}"
chmod a+x /usr/bin/google-java-format chmod a+x /usr/bin/google-java-format
@ -43,11 +43,11 @@ cd .. && rm -r lua-5.3.5/
url=$(curl -s \ url=$(curl -s \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
https://api.github.com/repos/cvega/luarocks/releases/latest | jq -r '.tarball_url') https://api.github.com/repos/cvega/luarocks/releases/latest | jq -r '.tarball_url')
curl --retry 5 --retry-delay 5 -sL \ curl --retry 5 --retry-delay 5 -sL \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
"${url}" | tar -xz "${url}" | tar -xz
cd cvega-luarocks-6b1aee6 cd cvega-luarocks-6b1aee6
./configure --with-lua-include=/usr/local/include ./configure --with-lua-include=/usr/local/include