Skip to content

Instantly share code, notes, and snippets.

@tboerger
Created October 9, 2019 12:21
Show Gist options
  • Select an option

  • Save tboerger/d0b6cfc96d1cb1ff0a9abf18c7f2b971 to your computer and use it in GitHub Desktop.

Select an option

Save tboerger/d0b6cfc96d1cb1ff0a9abf18c7f2b971 to your computer and use it in GitHub Desktop.
Drone Starlark example
def main(ctx):
return [
pipeline(),
]
def pipeline():
return {
'kind': 'pipeline',
'type': 'docker',
'name': 'linux',
'platform': {
'os': 'linux',
'arch': arch,
},
'steps': [
test(),
build(),
docker(),
],
}
def test():
return {
'name': 'test',
'image': 'golang:1.13',
'commands': [
'go test ./...',
],
}
def build():
return {
'name': 'build',
'image': 'golang:1.13',
'commands': [
'go build',
],
}
def docker():
return {
'name': 'publish',
'image': 'plugins/docker',
'settings': {
'auto_tag': True,
'auto_tag_suffix': 'linux-amd64',
'repo': 'octocat/hello',
'username': {
'from_secret': 'docker_username',
},
'password': {
'from_secret': 'docker_password',
},
},
'when': {
'event': [
'push',
'tag',
],
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment