superlint/scripts/install-lua.sh
Marco Ferrari 1ca3ebccd6
build: reduce container image size (#5072)
- Remove build-time dependencies
- Remove cached NPM packages
- Remove cached PyPi packages
- Remove dependency descriptors. These still count against the total space,
  although it's a few KBs
- Install rust-clippy and rust-fmt using the OS package manager instead of
  maintaining our own installation script
- Add tests for build time dependencies that are not supposed to be installed
2023-12-29 19:30:58 +01:00

40 lines
956 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
apk add --no-cache --virtual .lua-build-deps \
gcc \
make \
musl-dev \
readline-dev
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=$(
set -euo pipefail
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
apk del --no-network --purge .lua-build-deps