Skip to content
Snippets Groups Projects
Commit 838feb38 authored by Paolo.Brasolin's avatar Paolo.Brasolin
Browse files

ci: #fe split butler installation

parent b3da88f1
No related branches found
No related tags found
No related merge requests found
Pipeline #23151 passed
...@@ -84,9 +84,6 @@ stages: ...@@ -84,9 +84,6 @@ stages:
- echo Success! - echo Success!
fe-deploy-job: fe-deploy-job:
variables:
GLIBC_URL: https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.34-r0/glibc-2.34-r0.apk
BUTLER_URL: https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
image: node:16-alpine image: node:16-alpine
stage: deploy stage: deploy
cache: cache:
...@@ -96,23 +93,7 @@ fe-deploy-job: ...@@ -96,23 +93,7 @@ fe-deploy-job:
paths: paths:
- frontend/node_modules - frontend/node_modules
before_script: before_script:
- "#=[ install tools ]=====================" - ./ci/install-butler-on-alpine.sh
# NOTE: Alpine Linux stuff if linked with muslc. Butler is linked with glibc, and this causes an error -- see https://stackoverflow.com/a/66974607/6438061 for details. We need to install a compatibility layer: https://github.com/sgerrand/alpine-pkg-glibc#installing
- "#-[ install glibc ]---------------------"
- wget -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
- wget -O glibc.apk $GLIBC_URL
- apk add glibc.apk
- rm glibc.apk
- "#-[ install unzip ]---------------------"
- apk add --no-cache unzip
- "#-[ install butler ]--------------------"
- wget -O butler.zip $BUTLER_URL
- unzip butler.zip *.so -d /usr/local/lib
- unzip butler.zip butler -d /usr/local/bin
- chmod +x /usr/local/bin/butler
- rm butler.zip
- butler -V
# NOTE: sometimes this fails with error `runtime/cgo: pthread_create failed: Operation not permitted` and I'm not sure why. A strict Docker's seccomp policy would explain this, but then why is it flaky?!
script: script:
- cd frontend - cd frontend
- npm install - npm install
......
#!/usr/bin/env sh
set -e # exit of first error
#set -o xtrace # trace commands
# NOTE: Alpine Linux stuff if linked with muslc. Butler is linked with glibc, and this causes an error -- see https://stackoverflow.com/a/66974607/6438061 for details. We need to install a compatibility layer: https://github.com/sgerrand/alpine-pkg-glibc#installing
echo "Installing glibc..."
GLIBC_VERSION=2.34-r0
GLIBC_URL=https://github.com/sgerrand/alpine-pkg-glibc/releases/download/$GLIBC_VERSION/glibc-$GLIBC_VERSION.apk
GLIBC_KEY=https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
wget -P /etc/apk/keys $GLIBC_KEY
wget -O glibc.apk $GLIBC_URL
apk add glibc.apk
rm glibc.apk
echo "Installing unzip..."
apk add --no-cache unzip
echo "Installing butler..."
BUTLER_VERSION=LATEST
BUTLER_URL=https://broth.itch.ovh/butler/linux-amd64/$BUTLER_VERSION/archive/default
wget -O butler.zip $BUTLER_URL
unzip butler.zip *.so -d /usr/local/lib
unzip butler.zip butler -d /usr/local/bin
chmod +x /usr/local/bin/butler
rm butler.zip
butler -V
# NOTE: sometimes this fails with error `runtime/cgo: pthread_create failed: Operation not permitted` and I'm not sure why. A strict Docker's seccomp policy would explain this, but then why is it flaky?!
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment