nix: add postgrest-docker-login wrapper func

This commit is contained in:
steve-chavez
2020-11-10 22:47:58 -05:00
committed by Steve Chavez
parent 122fea1507
commit 9f8d1af2cd
2 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ jobs:
name: Publish Docker images
command: |
export DOCKER_REPO=postgrest
docker login -u $DOCKER_USER -p $DOCKER_PASS
postgrest-docker-login
postgrest-release-dockerhub
postgrest-release-dockerhubdescription
+10 -1
View File
@@ -41,6 +41,15 @@ let
--replace v${version} \
${releaseFiles}
'';
# Wrapper for login with docker. $DOCKER_USER/$DOCKER_PASS vars come from CircleCI.
# The DOCKER_USER is not the same as DOCKER_REPO because we use the https://hub.docker.com/u/postgrestbot account for uploading to dockerhub.
dockerLogin =
writeShellScriptBin "postgrest-docker-login"
''
set -euo pipefail
docker login -u $DOCKER_USER -p $DOCKER_PASS
'';
# Script for publishing a new release on Docker Hub.
dockerHub =
@@ -97,5 +106,5 @@ let
in
buildEnv {
name = "postgrest-release";
paths = [ github dockerHub dockerHubDescription ];
paths = [ github dockerLogin dockerHub dockerHubDescription ];
}