diff --git a/.drone-home.jsonnet b/.drone-home.jsonnet index 3bcb307..a17e0ac 100644 --- a/.drone-home.jsonnet +++ b/.drone-home.jsonnet @@ -56,7 +56,7 @@ local util = { '_', ), ), - envSet(env): function(step) step { + envSet(env): { environment +: { [util.environment(env)]: util.fromSecret( util.secret(env) @@ -68,7 +68,7 @@ local util = { ], }, }, - printEnv(file, env): function(step) util.envSet(env)(step) { + printEnv(file, env): function(step) step (util.envSet(env)) { settings +: { script +: [ 'echo "export %(environment)s=\'$${%(environment)s}\'" >> %(file)s # "%(secret)s"' % { @@ -188,29 +188,28 @@ local images = { publicSecrets, ) )( - images.ssh - ) - { - name: 'deploy portainer', - settings +: { - username: util.fromSecret("ssh-root-user"), - password: util.fromSecret("ssh-root-password"), - script +: [ - 'set -e', - 'echo go', - ] /*+ - map(export, secrets) + - [ - "export DRONE_REPO_LINK=$${{DRONE_GITEA_SERVER}}/{namespace}/{name}".format(name=ctx.repo.name, namespace=ctx.repo.namespace), - "export DRONE_COMMIT={commit}".format(commit=ctx.build.commit), - "docker network prune -f", - "cd {folder}".format(folder=folder), - "docker stack rm {name}".format(name = name), - "sleep 30", - "docker stack deploy -c {filename} {name}".format(name= name, filename = filename), - ] + commands */ + images.ssh { + name: 'deploy portainer', + settings +: { + username: util.fromSecret("ssh-root-user"), + password: util.fromSecret("ssh-root-password"), + script +: [ + 'set -e', + 'echo go', + ] /*+ + map(export, secrets) + + [ + "export DRONE_REPO_LINK=$${{DRONE_GITEA_SERVER}}/{namespace}/{name}".format(name=ctx.repo.name, namespace=ctx.repo.namespace), + "export DRONE_COMMIT={commit}".format(commit=ctx.build.commit), + "docker network prune -f", + "cd {folder}".format(folder=folder), + "docker stack rm {name}".format(name = name), + "sleep 30", + "docker stack deploy -c {filename} {name}".format(name= name, filename = filename), + ] + commands */ + } } - } + ) ], } ]