Browse Source

push images to docker hub

pull/700/head
Guillaume Vincent 2 years ago
parent
commit
f326ec275d
2 changed files with 10 additions and 10 deletions
  1. +2
    -0
      .github/workflows/containers-publish.yml
  2. +8
    -10
      containers/deploy

+ 2
- 0
.github/workflows/containers-publish.yml View File

@@ -20,3 +20,5 @@ jobs:
env: env:
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

+ 8
- 10
containers/deploy View File

@@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash


function check_env_variables_are_setted { function check_env_variables_are_setted {
if [ -z "${QUAY_USERNAME}" ] || [ -z "${QUAY_PASSWORD}" ]; then
echo "Need to set QUAY_USERNAME and QUAY_PASSWORD env variables to release containers"
if [ -z "${QUAY_USERNAME}" ] || [ -z "${QUAY_PASSWORD}" ] || [ -z "${DOCKER_PASSWORD}" ] || [ -z "${DOCKER_PASSWORD}" ]; then
echo "Need to set QUAY_USERNAME, QUAY_PASSWORD, DOCKER_PASSWORD and DOCKER_PASSWORD env variables to release containers"
exit 1 exit 1
fi fi
} }
@@ -18,15 +18,13 @@ set -o nounset
function build_and_push_container { function build_and_push_container {
container=$1 container=$1
docker build --tag lesspass/${container} ./${container} docker build --tag lesspass/${container} ./${container}
docker push lesspass/${container}
docker tag lesspass/${container} quay.io/lesspass/${container} docker tag lesspass/${container} quay.io/lesspass/${container}
docker push quay.io/lesspass/${container} docker push quay.io/lesspass/${container}
} }


function build_and_push_containers {
docker login --username="${QUAY_USERNAME}" --password="${QUAY_PASSWORD}" quay.io
build_and_push_container webserver
build_and_push_container backend
build_and_push_container frontend
}

build_and_push_containers
docker login --username="${DOCKER_USERNAME}" --password="${DOCKER_PASSWORD}"
docker login --username="${QUAY_USERNAME}" --password="${QUAY_PASSWORD}" quay.io
build_and_push_container webserver
build_and_push_container backend
build_and_push_container frontend

Loading…
Cancel
Save