mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-22 04:32:16 -05:00
split the installation scripts, inline or clean-up as possible
This commit is contained in:
parent
5cbf58c106
commit
c7f01711bd
9 changed files with 137 additions and 117 deletions
33
Dockerfile
33
Dockerfile
|
@ -208,12 +208,39 @@ COPY dependencies/sgerrand.rsa.pub /etc/apk/keys/sgerrand.rsa.pub
|
|||
COPY scripts/install-ktlint.sh /
|
||||
RUN --mount=type=secret,id=GITHUB_TOKEN /install-ktlint.sh && rm -rf /install-ktlint.sh
|
||||
|
||||
####################
|
||||
# Install dart-sdk #
|
||||
####################
|
||||
COPY scripts/install-dart-sdk.sh /
|
||||
RUN --mount=type=secret,id=GITHUB_TOKEN /install-dart-sdk.sh && rm -rf /install-dart-sdk.sh
|
||||
|
||||
################################
|
||||
# Install Bash-Exec #
|
||||
################################
|
||||
COPY --chmod=555 scripts/bash-exec.sh /usr/bin/bash-exec
|
||||
|
||||
#################################################
|
||||
# Install Raku and additional Edge dependencies #
|
||||
#################################################
|
||||
# Basic setup, programs and init
|
||||
COPY scripts/install-raku.sh /
|
||||
RUN --mount=type=secret,id=GITHUB_TOKEN /install-raku.sh && rm -rf /install-raku.sh
|
||||
RUN apk add --no-cache rakudo zef
|
||||
|
||||
######################
|
||||
# Install CheckStyle #
|
||||
######################
|
||||
COPY scripts/install-checkstyle.sh /
|
||||
RUN --mount=type=secret,id=GITHUB_TOKEN /install-checkstyle.sh && rm -rf /install-checkstyle.sh
|
||||
|
||||
##############################
|
||||
# Install google-java-format #
|
||||
##############################
|
||||
COPY scripts/install-google-java-format.sh /
|
||||
RUN --mount=type=secret,id=GITHUB_TOKEN /install-google-java-format.sh && rm -rf /install-google-java-format.sh
|
||||
|
||||
#################################
|
||||
# Install luacheck and luarocks #
|
||||
#################################
|
||||
COPY scripts/install-lua.sh /
|
||||
RUN --mount=type=secret,id=GITHUB_TOKEN /install-lua.sh && rm -rf /install-lua.sh
|
||||
|
||||
################################################################################
|
||||
# Grab small clean image to build python packages ##############################
|
||||
|
|
8
scripts/bash-exec.sh
Executable file
8
scripts/bash-exec.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if ! [[ -x "$1" ]]; then
|
||||
echo "Error: File:[$1] is not executable"
|
||||
exit 1
|
||||
fi
|
14
scripts/install-checkstyle.sh
Executable file
14
scripts/install-checkstyle.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
url=$(curl -s \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"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')
|
||||
curl --retry 5 --retry-delay 5 -sL -o /usr/bin/checkstyle \
|
||||
-H "Accept: application/octet-stream" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"${url}"
|
||||
chmod a+x /usr/bin/checkstyle
|
33
scripts/install-dart-sdk.sh
Executable file
33
scripts/install-dart-sdk.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
case $TARGETARCH in
|
||||
amd64)
|
||||
target=x64
|
||||
;;
|
||||
arm64)
|
||||
target=arm64
|
||||
;;
|
||||
*)
|
||||
echo "$TARGETARCH is not supported"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
url=$(curl -s \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"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')
|
||||
curl --retry 5 --retry-delay 5 -sL -o "glibc-${GLIBC_VERSION}.apk" \
|
||||
-H "Accept: application/octet-stream" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"${url}"
|
||||
apk add --no-cache --force-overwrite "glibc-${GLIBC_VERSION}.apk"
|
||||
rm "glibc-${GLIBC_VERSION}.apk"
|
||||
|
||||
curl --retry 5 --retry-delay 5 -sO "https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-${target}-release.zip"
|
||||
unzip -q dartsdk-linux-${target}-release.zip
|
||||
chmod +x dart-sdk/bin/dart* && mv dart-sdk/bin/* /usr/bin/ && mv dart-sdk/lib/* /usr/lib/ && mv dart-sdk/include/* /usr/include/
|
||||
rm -r dart-sdk/ dartsdk-linux-${target}-release.zip
|
14
scripts/install-google-java-format.sh
Executable file
14
scripts/install-google-java-format.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
url=$(curl -s \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"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')
|
||||
curl --retry 5 --retry-delay 5 -sL -o /usr/bin/google-java-format \
|
||||
-H "Accept: application/octet-stream" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"${url}"
|
||||
chmod a+x /usr/bin/google-java-format
|
|
@ -2,22 +2,6 @@
|
|||
|
||||
set -euo pipefail
|
||||
|
||||
case $TARGETARCH in
|
||||
amd64)
|
||||
target=x64
|
||||
;;
|
||||
arm64)
|
||||
target=arm64
|
||||
;;
|
||||
*)
|
||||
echo "$TARGETARCH is not supported"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
##################
|
||||
# Install ktlint #
|
||||
##################
|
||||
url=$(curl -s \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
|
@ -30,30 +14,3 @@ curl --retry 5 --retry-delay 5 -sL -o "/usr/bin/ktlint" \
|
|||
chmod a+x /usr/bin/ktlint
|
||||
terrascan init
|
||||
cd ~ && touch .chktexrc
|
||||
|
||||
####################
|
||||
# Install dart-sdk #
|
||||
####################
|
||||
url=$(curl -s \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"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')
|
||||
curl --retry 5 --retry-delay 5 -sL -o "glibc-${GLIBC_VERSION}.apk" \
|
||||
-H "Accept: application/octet-stream" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"${url}"
|
||||
apk add --no-cache --force-overwrite "glibc-${GLIBC_VERSION}.apk"
|
||||
rm "glibc-${GLIBC_VERSION}.apk"
|
||||
|
||||
curl --retry 5 --retry-delay 5 -sO "https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-${target}-release.zip"
|
||||
unzip -q dartsdk-linux-${target}-release.zip
|
||||
chmod +x dart-sdk/bin/dart* && mv dart-sdk/bin/* /usr/bin/ && mv dart-sdk/lib/* /usr/lib/ && mv dart-sdk/include/* /usr/include/
|
||||
rm -r dart-sdk/ dartsdk-linux-${target}-release.zip
|
||||
|
||||
################################
|
||||
# Create and install Bash-Exec #
|
||||
################################
|
||||
# shellcheck disable=SC2016
|
||||
printf '#!/bin/bash\nif [[ -x "$1" ]]; then exit 0; else echo "Error: File:[$1] is not executable"; exit 1; fi' >/usr/bin/bash-exec
|
||||
chmod +x /usr/bin/bash-exec
|
||||
|
|
30
scripts/install-lua.sh
Executable file
30
scripts/install-lua.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
curl --retry 5 --retry-delay 5 -s https://www.lua.org/ftp/lua-5.3.5.tar.gz | tar -xz
|
||||
cd lua-5.3.5
|
||||
make linux
|
||||
make install
|
||||
cd .. && rm -r lua-5.3.5/
|
||||
|
||||
url=$(curl -s \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
https://api.github.com/repos/cvega/luarocks/releases/latest | jq -r '.tarball_url')
|
||||
curl --retry 5 --retry-delay 5 -sL \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"${url}" | tar -xz
|
||||
cd cvega-luarocks-6b1aee6
|
||||
./configure --with-lua-include=/usr/local/include
|
||||
make
|
||||
make -b install
|
||||
cd ..
|
||||
rm -r cvega-luarocks-6b1aee6
|
||||
|
||||
luarocks install luacheck
|
||||
luarocks install argparse
|
||||
luarocks install luafilesystem
|
||||
mv /etc/R/* /usr/lib/R/etc/
|
||||
find /usr/ -type f -name '*.md' -exec rm {} +
|
|
@ -1,63 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
apk add --no-cache rakudo zef
|
||||
|
||||
######################
|
||||
# Install CheckStyle #
|
||||
######################
|
||||
url=$(curl -s \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"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')
|
||||
curl --retry 5 --retry-delay 5 -sL -o /usr/bin/checkstyle \
|
||||
-H "Accept: application/octet-stream" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"${url}"
|
||||
chmod a+x /usr/bin/checkstyle
|
||||
|
||||
##############################
|
||||
# Install google-java-format #
|
||||
##############################
|
||||
url=$(curl -s \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"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')
|
||||
curl --retry 5 --retry-delay 5 -sL -o /usr/bin/google-java-format \
|
||||
-H "Accept: application/octet-stream" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"${url}"
|
||||
chmod a+x /usr/bin/google-java-format
|
||||
|
||||
#################################
|
||||
# Install luacheck and luarocks #
|
||||
#################################
|
||||
curl --retry 5 --retry-delay 5 -s https://www.lua.org/ftp/lua-5.3.5.tar.gz | tar -xz
|
||||
cd lua-5.3.5
|
||||
make linux
|
||||
make install
|
||||
cd .. && rm -r lua-5.3.5/
|
||||
|
||||
url=$(curl -s \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
https://api.github.com/repos/cvega/luarocks/releases/latest | jq -r '.tarball_url')
|
||||
curl --retry 5 --retry-delay 5 -sL \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \
|
||||
"${url}" | tar -xz
|
||||
cd cvega-luarocks-6b1aee6
|
||||
./configure --with-lua-include=/usr/local/include
|
||||
make
|
||||
make -b install
|
||||
cd ..
|
||||
rm -r cvega-luarocks-6b1aee6
|
||||
|
||||
luarocks install luacheck
|
||||
luarocks install argparse
|
||||
luarocks install luafilesystem
|
||||
mv /etc/R/* /usr/lib/R/etc/
|
||||
find /usr/ -type f -name '*.md' -exec rm {} +
|
|
@ -1,6 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2016
|
||||
# shellcheck disable=SC2129
|
||||
|
||||
# https://doc.rust-lang.org/rustc/platform-support.html
|
||||
|
||||
|
@ -29,10 +27,12 @@ ln -fsv /usr/lib/.rustup/toolchains/stable-${target}-unknown-linux-musl/bin/rust
|
|||
ln -fsv /usr/lib/.rustup/toolchains/stable-${target}-unknown-linux-musl/bin/cargo /usr/bin/cargo
|
||||
ln -fsv /usr/lib/.rustup/toolchains/stable-${target}-unknown-linux-musl/bin/cargo-clippy /usr/bin/cargo-clippy
|
||||
|
||||
echo '#!/usr/bin/env bash' >/usr/bin/clippy
|
||||
echo 'pushd $(dirname $1)' >>/usr/bin/clippy
|
||||
echo 'cargo-clippy' >>/usr/bin/clippy
|
||||
echo 'rc=$?' >>/usr/bin/clippy
|
||||
echo 'popd' >>/usr/bin/clippy
|
||||
echo 'exit $rc' >>/usr/bin/clippy
|
||||
cat <<'EOF' >/usr/bin/clippy
|
||||
#!/usr/bin/env bash
|
||||
pushd $(dirname $1)
|
||||
cargo-clippy
|
||||
rc=$?
|
||||
popd
|
||||
exit $rc
|
||||
EOF
|
||||
chmod +x /usr/bin/clippy
|
||||
|
|
Loading…
Reference in a new issue