Skip to content
Snippets Groups Projects
Commit 51c76e0d authored by Matthew K Defenderfer's avatar Matthew K Defenderfer
Browse files

authenticate via secure file and download FEBioStudio from site at build time

parent 012614e0
No related branches found
No related tags found
No related merge requests found
default: default:
image: docker:26.0.1 image: docker:latest
services: services:
- docker:26.0.1-dind - docker:dind
before_script: before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
interruptible: true interruptible: true
...@@ -10,21 +10,23 @@ stages: ...@@ -10,21 +10,23 @@ stages:
- pre-build - pre-build
- build - build
febio-dl: get-credentials:
image: amazon/aws-cli
stage: pre-build stage: pre-build
variables:
CI_DEBUG_TRACE: "true"
script: script:
- 'aws --verbose s3 presign s3://$LTS_BUCKET/$LTS_FILE_KEY --endpoint-url $LTS_ENDPOINT --expires-in 600 --output text' - echo "Copying secure file with FeBio login ..."
artifacts: - cp $CI_SECURE_FILE_PATH/febio_login.txt ./febio_login.txt
paths: - export USERNAME=$(grep 'username:' secure_file.txt | cut -d ':' -f2 | tr -d ' ')
- "installer/" - export PASSWORD=$(grep 'password:' secure_file.txt | cut -d ':' -f2 | tr -d ' ')
- echo "Extracted username: $USERNAME"
- echo "Extracted password: $PASSWORD"
docker-build: docker-build:
stage: build stage: build
dependencies:
- extract-credentials
script: script:
- docker pull $CI_REGISTRY_IMAGE:latest || true - docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:latest . - docker build --build-arg BUILDKIT_INLINE_CACHE=1 --build-arg USERNAME=${USERNAME} --build-arg PASSWORD=${PASSWORD}--cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE:latest - docker push $CI_REGISTRY_IMAGE:latest
FROM ubuntu:jammy FROM ubuntu:jammy
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ARG USERNAME
ARG PASSWORD
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y \ apt-get install -y \
zip \ zip \
wget \ curl \
jq \
unzip \ unzip \
libglu1-mesa \ libglu1-mesa \
libqt5widgets5 \ libqt5widgets5 \
...@@ -23,9 +26,15 @@ RUN apt-get update && \ ...@@ -23,9 +26,15 @@ RUN apt-get update && \
x11-apps \ x11-apps \
xorg \ xorg \
openbox \ openbox \
libgomp1 libgomp1 \
&& rm -rf /var/lib/apt/lists
RUN ENCODED_USERNAME=$(printf '%s' "$USERNAME" | jq -sRr @uri) && \
ENCODED_PASSWORD=$(printf '%s' "$PASSWORD" | jq -sRr @uri) && \
curl -c cookies.txt -X POST -d "log=${ENCODED_USERNAME}&pwd=${ENCODED_PASSWORD}&wp-submit=1" "https://febio.org/wp-login.php" -v && \
curl --output /tmp/febio.zip -b cookies.txt "https://febio.org/download/12171/?tmstv=1729879260" && \
unset USERNAME PASSWORD ENCODED_USERNAME ENCODED_PASSWORD
COPY ./installer/febio_installer.zip /tmp/febio_installer.zip
RUN unzip /tmp/febio_installer.zip RUN unzip /tmp/febio_installer.zip
RUN chmod +x FEBioStudio_linux-x64_2.7_FEBio_4.7.run RUN chmod +x FEBioStudio_linux-x64_2.7_FEBio_4.7.run
......
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