Skip to content

Instantly share code, notes, and snippets.

@bandesz
Created December 14, 2021 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bandesz/cafcc514c95fbc4b4672a10264252841 to your computer and use it in GitHub Desktop.
Save bandesz/cafcc514c95fbc4b4672a10264252841 to your computer and use it in GitHub Desktop.
Drone CI - Faking steps, services and pipelines
def fake_step(step):
return {
"name": step["name"],
"image": "busybox:1.34",
"commands": [
"echo 'Faking %s'" % step["name"],
],
"depends_on": step.get("depends_on", []),
"when": step.get("when", {}),
}
def fake_service(step):
return {
"name": step["name"],
"image": "busybox:1.34",
"commands": [
"echo 'Faking service %s'" % step["name"],
"sleep 1000",
],
"depends_on": step.get("depends_on", []),
"when": step.get("when", {}),
}
def fake_pipeline(pipeline):
fake_steps = []
for step in pipeline["steps"]:
fake_steps.append(fake_step(step))
fake_services = []
for service in pipeline.get("services", []):
fake_services.append(fake_service(service))
pipeline["steps"] = fake_steps
pipeline["services"] = fake_services
pipeline["clone"] = {
"disable": True,
}
return pipeline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment