drone/drone-starlark/repos/build-docker-folder.star

34 lines
746 B
Plaintext
Raw Normal View History

2020-05-10 16:16:11 +00:00
load("@this//:environment.star", "environment")
def buildDockerFolder(
dockerFile,
image,
tag,
folder,
name,
):
return {
"name": "build-{name}".format(
name = name,
),
"image": "docker:dind",
"volumes": [
{
"name": "dockersock",
"path": "/var/run",
},
],
"environment": environment([
"local-docker-registry",
2020-05-11 13:37:26 +00:00
"registry-password",
2020-05-10 16:16:11 +00:00
]),
"commands": [
"cd {folder}".format(folder=folder),
2020-05-11 14:08:31 +00:00
'docker login $${LOCAL_DOCKER_REGISTRY} --username client --password "$${REGISTRY_PASSWORD}"',
2020-05-10 16:16:11 +00:00
"sh build-docker-folder.sh {dockerFile} {image} {tag}".format(
image = image,
dockerFile = dockerFile,
tag = tag,
),
],
}