From bc6c0eec676ac57b248dad6782791187c113b3f5 Mon Sep 17 00:00:00 2001 From: Giles Bradshaw Date: Mon, 11 May 2020 15:08:31 +0100 Subject: [PATCH] . --- drone-starlark/repos/build-docker-folder.star | 2 +- drone-starlark/repos/build-folder.star | 2 +- drone-starlark/repos/build.star | 2 +- drone-starlark/repos/deploy.star | 2 +- drone-starlark/repos/pull.star | 7 +++++-- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drone-starlark/repos/build-docker-folder.star b/drone-starlark/repos/build-docker-folder.star index 61b1f76..66dd30b 100644 --- a/drone-starlark/repos/build-docker-folder.star +++ b/drone-starlark/repos/build-docker-folder.star @@ -23,7 +23,7 @@ def buildDockerFolder( ]), "commands": [ "cd {folder}".format(folder=folder), - "docker login $${LOCAL_DOCKER_REGISTRY} --username client --password '$${REGISTRY_PASSWORD}'", + 'docker login $${LOCAL_DOCKER_REGISTRY} --username client --password "$${REGISTRY_PASSWORD}"', "sh build-docker-folder.sh {dockerFile} {image} {tag}".format( image = image, dockerFile = dockerFile, diff --git a/drone-starlark/repos/build-folder.star b/drone-starlark/repos/build-folder.star index 87876d1..1a43f1c 100644 --- a/drone-starlark/repos/build-folder.star +++ b/drone-starlark/repos/build-folder.star @@ -18,7 +18,7 @@ def buildFolder(name, folder): ]), "commands": [ "cd {folder}".format(folder=folder), - "docker login $${LOCAL_DOCKER_REGISTRY} --username client --password '$${REGISTRY_PASSWORD}'", + 'docker login $${LOCAL_DOCKER_REGISTRY} --username client --password "$${REGISTRY_PASSWORD}"', "sh build.sh {name} $${{LOCAL_DOCKER_REGISTRY}}".format(name = name), ], } diff --git a/drone-starlark/repos/build.star b/drone-starlark/repos/build.star index 2836037..c095ae9 100644 --- a/drone-starlark/repos/build.star +++ b/drone-starlark/repos/build.star @@ -16,7 +16,7 @@ def build(name): ]), "commands": [ "cd {name}".format(name=name), - "docker login $${LOCAL_DOCKER_REGISTRY} --username client --password '$${REGISTRY_PASSWORD}'", + 'docker login $${LOCAL_DOCKER_REGISTRY} --username client --password "$${REGISTRY_PASSWORD}"', "docker build . -t $${{LOCAL_DOCKER_REGISTRY}}{name}".format(name=name), "docker push $${{LOCAL_DOCKER_REGISTRY}}{name}".format(name=name), ], diff --git a/drone-starlark/repos/deploy.star b/drone-starlark/repos/deploy.star index be6a52e..9e59892 100644 --- a/drone-starlark/repos/deploy.star +++ b/drone-starlark/repos/deploy.star @@ -30,7 +30,7 @@ def deploy( "export DRONE_COMMIT={commit}".format(commit=ctx.build.commit), "docker network prune -f", "cd {folder}".format(folder=folder), - "docker login $${LOCAL_DOCKER_REGISTRY} --username client --password '$${REGISTRY_PASSWORD}'", + 'docker login $${LOCAL_DOCKER_REGISTRY} --username client --password "$${REGISTRY_PASSWORD}"', "docker stack rm {name}".format(name = name), "sleep 30", "docker stack deploy -c {filename} {name}".format(name= name, filename = filename), diff --git a/drone-starlark/repos/pull.star b/drone-starlark/repos/pull.star index d3b90e2..c24c577 100644 --- a/drone-starlark/repos/pull.star +++ b/drone-starlark/repos/pull.star @@ -7,7 +7,10 @@ def pull( name, images, ): - secrets = [ "local-docker-registry"] + secrets = [ + "local-docker-registry", + "registry-password", + ] return { "name": name, "image": "appleboy/drone-ssh", @@ -22,7 +25,7 @@ def pull( "set -e" ] + map(export, secrets) + - ["docker login $${LOCAL_DOCKER_REGISTRY} --username client --password '$${REGISTRY_PASSWORD}'"] + + ['docker login $${LOCAL_DOCKER_REGISTRY} --username client --password "$${REGISTRY_PASSWORD}"'] + ["docker pull $${{LOCAL_DOCKER_REGISTRY}}{image}".format(image=image) for image in images ] } }