prepare for multi-CI
split things out so more can be shared between CIs
This commit is contained in:
parent
7a8122c5f4
commit
6b517528ee
7 changed files with 53 additions and 45 deletions
22
docker-login
Executable file
22
docker-login
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# A simplified docker login approach that doesn't depends on the docker binary
|
||||
#
|
||||
# Usage: ./docker-login <registry> <username> <password>
|
||||
set -euo pipefail
|
||||
|
||||
registry=$1
|
||||
username=$2
|
||||
password=$3
|
||||
|
||||
mkdir ~/.docker
|
||||
|
||||
cat <<DOCKER_CONF > ~/.docker/config.json
|
||||
{
|
||||
"auths": {
|
||||
"$CI_REGISTRY": {
|
||||
"auth": "$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64)"
|
||||
}
|
||||
}
|
||||
}
|
||||
DOCKER_CONF
|
Loading…
Add table
Add a link
Reference in a new issue