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:
image: docker:26.0.1
image: docker:latest
services:
- docker:26.0.1-dind
- docker:dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
interruptible: true
......@@ -10,21 +10,23 @@ stages:
- pre-build
- build
febio-dl:
image: amazon/aws-cli
get-credentials:
stage: pre-build
variables:
CI_DEBUG_TRACE: "true"
script:
- 'aws --verbose s3 presign s3://$LTS_BUCKET/$LTS_FILE_KEY --endpoint-url $LTS_ENDPOINT --expires-in 600 --output text'
artifacts:
paths:
- "installer/"
- echo "Copying secure file with FeBio login ..."
- cp $CI_SECURE_FILE_PATH/febio_login.txt ./febio_login.txt
- export USERNAME=$(grep 'username:' secure_file.txt | cut -d ':' -f2 | tr -d ' ')
- export PASSWORD=$(grep 'password:' secure_file.txt | cut -d ':' -f2 | tr -d ' ')
- echo "Extracted username: $USERNAME"
- echo "Extracted password: $PASSWORD"
docker-build:
stage: build
dependencies:
- extract-credentials
script:
- 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:latest
FROM ubuntu:jammy
ENV DEBIAN_FRONTEND=noninteractive
ARG USERNAME
ARG PASSWORD
RUN apt-get update && \
apt-get install -y \
zip \
wget \
curl \
jq \
unzip \
libglu1-mesa \
libqt5widgets5 \
......@@ -23,9 +26,15 @@ RUN apt-get update && \
x11-apps \
xorg \
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 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