Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Test
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fortune Iriaye
Test
Commits
7de3428f
Commit
7de3428f
authored
6 months ago
by
Matthew K Defenderfer
Browse files
Options
Downloads
Patches
Plain Diff
move authentication to initial stage, store cookie as an artifact for short time
parent
79d6afaf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+12
-5
12 additions, 5 deletions
.gitlab-ci.yml
with
12 additions
and
5 deletions
.gitlab-ci.yml
+
12
−
5
View file @
7de3428f
...
@@ -10,14 +10,23 @@ stages:
...
@@ -10,14 +10,23 @@ stages:
variables
:
variables
:
SECURE_FILES_DOWNLOAD_PATH
:
'
.secure'
SECURE_FILES_DOWNLOAD_PATH
:
'
.secure'
get-c
redentials
:
get-c
ookie
:
stage
:
pre-build
stage
:
pre-build
image
:
ubuntu:jammy
image
:
ubuntu:jammy
before_script
:
before_script
:
-
apt-get update && apt-get upgrade -y && apt-get install curl -y
-
apt-get update && apt-get upgrade -y && apt-get install curl
jq
-y
script
:
script
:
-
echo "Copying secure file with FeBio login ..."
-
echo "Copying secure file with FeBio login ..."
-
curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash
-
curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash
-
export USERNAME=$(grep 'username:' ${SECURE_FILES_DOWNLOAD_PATH}/febio_login.txt | cut -d ':' -f2 | tr -d ' ')
-
export PASSWORD=$(grep 'password:' ${SECURE_FILES_DOWNLOAD_PATH}/febio_login.txt | cut -d ':' -f2 | tr -d ' ')
-
export ENCODED_USERNAME=$(printf '%s' "${USERNAME}" | jq -sRr @uri)
-
export 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
artifacts
:
paths
:
-
cookies.txt
expire_in
:
5 minutes
docker-build
:
docker-build
:
stage
:
build
stage
:
build
...
@@ -25,10 +34,8 @@ docker-build:
...
@@ -25,10 +34,8 @@ docker-build:
services
:
services
:
-
docker:dind
-
docker:dind
dependencies
:
dependencies
:
-
get-c
redentials
-
get-c
ookie
script
:
script
:
-
export USERNAME=$(grep 'username:' ${SECURE_FILES_DOWNLOAD_PATH}/febio_login.txt | cut -d ':' -f2 | tr -d ' ')
-
export PASSWORD=$(grep 'password:' ${SECURE_FILES_DOWNLOAD_PATH}/febio_login.txt | cut -d ':' -f2 | tr -d ' ')
-
docker pull $CI_REGISTRY_IMAGE:latest ||
true
-
docker pull $CI_REGISTRY_IMAGE:latest ||
true
-
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 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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment