{"id":19392839,"url":"https://github.com/ruanbekker/drone-ci-testing","last_synced_at":"2025-04-24T02:30:43.361Z","repository":{"id":139706845,"uuid":"182036398","full_name":"ruanbekker/drone-ci-testing","owner":"ruanbekker","description":"Repository with Drone CI Examples","archived":false,"fork":false,"pushed_at":"2024-09-11T21:14:27.000Z","size":121,"stargazers_count":21,"open_issues_count":1,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-12T07:36:11.132Z","etag":null,"topics":["ci-cd","continuous-delivery","docker","drone"],"latest_commit_sha":null,"homepage":"https://ruan.dev","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruanbekker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-18T07:16:34.000Z","updated_at":"2024-09-11T21:14:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0c3a2ce-e179-4d5c-afdd-b32ff759b854","html_url":"https://github.com/ruanbekker/drone-ci-testing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanbekker%2Fdrone-ci-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanbekker%2Fdrone-ci-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanbekker%2Fdrone-ci-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanbekker%2Fdrone-ci-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruanbekker","download_url":"https://codeload.github.com/ruanbekker/drone-ci-testing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223941328,"owners_count":17228999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci-cd","continuous-delivery","docker","drone"],"created_at":"2024-11-10T10:32:27.864Z","updated_at":"2024-11-10T10:33:48.890Z","avatar_url":"https://github.com/ruanbekker.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# drone-ci-testing [![Build Status](https://drone.rbkr.xyz/api/badges/ruanbekker/drone-ci-testing/status.svg)](https://cloud.drone.io/ruanbekker/drone-ci-testing)\ntesting cloud.drone.io\n\n## Contents\n\nContents of this page\n\n* [Setups]()\n  * [Drone CLI Setup](#drone-cli-setup)\n  * [Drone CLI Secrets](#drone-cli-secrets)\n  \n* [Pipeline Examples]()\n  * [Shell Commands in a Step](#run-shell-commands-in-a-step)\n  * [Secrets in Environment Variables](#secrets-in-environment-variables)\n  * [Publish to Dockerhub](#publish-to-dockerhub)\n  * [Publish to S3](#publish-to-s3-object-storage)\n  * [Slack Notifications](#slack-notifications)\n  * [Telegram Notifications](#telegram-notifications)\n  * [Email Notifications](#email-notifications)\n  * [SSH Example](#ssh-example)\n  * [SCP Example](#scp-example)\n  * [Rsync Example](#rsync-example)\n  * [Volumes: Persistence](#volumes-persistence)\n  * [Volumes: Temporary and Bind Mounts](#volumes-temporary-and-bind-mounts)\n  * [Parallel Builds](#parallel-builds)\n  * [Docker Remote Tunnel Example](#docker-remote-tunnel-example)\n  * [Use Services with Pipelines](#use-services-with-pipelines)\n  * [Multipipeline Depends on Steps](#multipipeline-depends-on-steps)\n  * [3 Times Multiple Pipeline Dependencies with Volumes](#3-times-multiple-pipeline-dependencies-with-volumes)\n  * [Full Pipeline Examples](#pipeline-examples)\n\n## Notes\n\n- Drone clones github repo to `/drone/src`\n- Context of the data gets transferred to each step\n- Having each step do `hostname \u003e\u003e data.txt`, will output this result on the 3rd step:\n\n```\n+ hostname \u003e\u003e data.txt\n312\t+ cat data.txt\n313\t2cf48dff07ac\n314\t8f9b2662253a\n315\t90c191ee99cc\n```\n\n- To mount volumes, you need to have yourself as admin and enable the repo as trusted in the settings\n\n## Drone CLI\n\n### Drone CLI Setup\n\n[Docs](https://docs.drone.io/cli/install/)\n\n```\ncurl -L https://github.com/drone/drone-cli/releases/download/v1.0.7/drone_darwin_amd64.tar.gz | tar zx\nsudo cp drone /usr/local/bin\n```\n\nGet your account details at https://drone.your-domain.com/account\n\n```\nexport DRONE_SERVER=https://yourdomain\nexport DRONE_TOKEN=xx\ndrone info\n```\n\n### Drone CLI Secrets\n\nCreating Secrets:\n\n```\n$ drone secret add --repository ruanbekker/drone-ci-testing -name SSH_PASSWORD -value secret-password\n$ drone secret add --repository ruanbekker/drone-ci-testing -name SSH_KEY -value @/home/myuser/.ssh/id_rsa\n```\n\nPipeline with Secrets:\n- [Ref](https://knowledge.rootknecht.net/drone)\n\n```\npipeline:\n  deploy:\n    image:    appleboy/drone-scp\n    host:     HOST\n    port:     22\n    secrets: [ SSH_USERNAME, SSH_PASSWORD ]\n    rm: true\n    script:\n      - echo \"Hello World\" \u003e /var/www/html/data.txt\n    source:\n      - src/\n    target:\n      - /var/www/html\n    strip_components: 1\n```\n\n## Usage\n\n### Run shell commands in a step\n\n```\nkind: pipeline\nname: default\n\nsteps:\n  - name: test\n    image: alpine\n    environment:\n      MYUSERNAME:\n        from_secret: myusername\n    commands:\n      - echo \"echo secret\"\n      - echo $${MYUSERNAME}\n      - echo \"run env command\"\n      - env\n```\n\nor:\n\n```\npipeline:\n  docker:\n    image: alpine\n    secrets: [ myusername ]\n    commands:\n      - echo \"echo secret\"\n      - echo $${MYUSERNAME}\n      - echo \"run env command\"\n      - env\n```\n\nThis will output:\n\n```\n+ echo \"echo secret\"\necho secret\n+ echo ${MYUSERNAME}\n********\n+ echo \"run env command\"\nrun env command\n+ env\nDRONE_SYSTEM_HOST=cloud.drone.io\nDRONE_COMMIT_AUTHOR_AVATAR=https://avatars0.githubusercontent.com/u/567298?v=4\nDRONE_BRANCH=master\nDRONE_GIT_SSH_URL=git@github.com:ruanbekker/drone-ci-testing.git\nDRONE_JOB_FINISHED=1555573281\nCI=true\nHOSTNAME=7a20b000f25c\nCI_BUILD_STARTED=1555573280\nDRONE_REPO_LINK=https://github.com/ruanbekker/drone-ci-testing\nDRONE_TARGET_BRANCH=master\nDRONE_REPO_NAMESPACE=ruanbekker\nDRONE_STAGE_OS=linux\nDRONE_COMMIT_AUTHOR=ruanbekker\nCI_WORKSPACE=/drone/src\nDRONE_GIT_HTTP_URL=https://github.com/ruanbekker/drone-ci-testing.git\nDRONE_RUNNER_HOSTNAME=15e89c0f84f1\nSHLVL=1\nDRONE_COMMIT_BRANCH=master\nHOME=/root\nDRONE_REPO_SCM=\nDRONE_REPO_PRIVATE=false\nDRONE_SYSTEM_PROTO=https\nDRONE_STEP_NUMBER=2\nDRONE_REPO_VISIBILITY=public\nDRONE_BUILD_STATUS=success\nDRONE_BUILD_ACTION=\nDRONE_RUNNER_PLATFORM=linux/amd64\nDRONE_WORKSPACE_BASE=/drone/src\nDRONE_COMMIT_BEFORE=138bc48338f44be2ef4ad8a57d63d4bf2403da3c\nCI_JOB_STARTED=1555573280\nDRONE_STAGE_ARCH=amd64\nCI_WORKSPACE_PATH=\nDRONE_STAGE_STATUS=success\nDRONE_SOURCE_BRANCH=master\nDRONE_STAGE_NAME=default\nDRONE_REPO_BRANCH=master\nDRONE_COMMIT_MESSAGE=add envvar\nDRONE_DEPLOY_TO=\nCI_BUILD_FINISHED=1555573281\nDRONE_SYSTEM_HOSTNAME=cloud.drone.io\nDRONE_REMOTE_URL=https://github.com/ruanbekker/drone-ci-testing.git\nDRONE_JOB_STATUS=success\nMYUSERNAME=********\nDRONE_REPO_OWNER=ruanbekker\nDRONE_STAGE_KIND=pipeline\nPATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\nDRONE=true\nDRONE_BUILD_NUMBER=15\nDRONE_BUILD_STARTED=1555573280\nDRONE_BUILD_LINK=https://cloud.drone.io/ruanbekker/drone-ci-testing/15\nCI_JOB_FINISHED=1555573281\nDRONE_WORKSPACE=/drone/src\nDRONE_STAGE_VARIANT=\nDRONE_STAGE_DEPENDS_ON=\nDRONE_COMMIT_AFTER=05818a52403e07b2cab4d980522e7264be4aa18c\nDRONE_STAGE_NUMBER=1\nDRONE_STAGE_STARTED=1555573280\nDRONE_COMMIT=05818a52403e07b2cab4d980522e7264be4aa18c\nDRONE_RUNNER_HOST=15e89c0f84f1\nDRONE_JOB_STARTED=1555573280\nDRONE_WORKSPACE_PATH=\nDRONE_BUILD_EVENT=push\nDRONE_COMMIT_SHA=05818a52403e07b2cab4d980522e7264be4aa18c\nDRONE_BUILD_CREATED=1555573279\nDRONE_COMMIT_AUTHOR_EMAIL=ruan@example.com\nDRONE_REPO_NAME=drone-ci-testing\nDRONE_STAGE_MACHINE=15e89c0f84f1\nDRONE_COMMIT_REF=refs/heads/master\nCI_BUILD_STATUS=success\nDRONE_MACHINE=15e89c0f84f1\nCI_WORKSPACE_BASE=/drone/src\nPWD=/drone/src\nDRONE_BUILD_FINISHED=1555573281\nDRONE_COMMIT_LINK=https://github.com/ruanbekker/drone-ci-testing/compare/138bc48338f4...05818a52403e\nDRONE_REPO=ruanbekker/drone-ci-testing\nDRONE_STEP_NAME=test\nDRONE_SYSTEM_VERSION=1.0.0\nDRONE_COMMIT_AUTHOR_NAME=Ruan Bekker\nCI_JOB_STATUS=success\nDRONE_STAGE_FINISHED=1555573281\n```\n\n### Secrets in Environment Variables\n\nSecrets are exposed to your pipeline steps and can be referenced with uppercase names: [reference](https://discourse.drone.io/t/secret-problems/2863)\n\n```\npipeline:\n  docker:\n    image: docker\n    secrets: [ swarm_key ]\n    commands:\n    - echo $${SWARM_KEY}\n    when:\n      branch: [master, develop, release/*]\n```\n\nwill result in:\n\n```\necho ${SWARM_KEY}\n-----rsa key ----- \n```\n\n### Publish to Dockerhub:\n- http://plugins.drone.io/drone-plugins/drone-docker/\n\n- Clone\n- Build Docker Image\n- Publish to Dockerhub with `latest` and `git_commit_id` and use credentials from stored secrets\n\nThe `.drone.yml`\n\n```\nkind: pipeline\nname: default\n\nsteps:\n  - name: test\n    image: alpine\n    environment:\n      MYUSERNAME:\n        from_secret: myusername\n    commands:\n      - echo \"echo secret\"\n      - echo $${MYUSERNAME}\n      - echo \"run env command\"\n      - env\n      - echo $${MYUSERNAME} \u003e /tmp/file\n      - mkdir -p /tmp/foo/dir\n      - touch /tmp/foo/dir/test.txt\n      \n  - name: publish\n    image: plugins/docker\n    settings:\n      repo: ruanbekker/dronetest\n      auto_tag: false\n      auto_tag_suffix: alpine\n      tags:\n        - ${DRONE_COMMIT}\n        - latest\n      username: \n        from_secret: dockerhub_username\n      password:\n        from_secret: dockerhub_password\n```\n\n### Publish to S3 Object Storage\n\nPublish data under `public/*` to minio object stroage:\n- http://plugins.drone.io/drone-plugins/drone-s3/\n\n```\nkind: pipeline\nname: default\n\nsteps:\n  - name: test\n    ..\n      \n  - name: publish\n    ..\n        \n  - name: upload\n    image: plugins/s3\n    settings:\n      bucket: dump\n      source: public/*\n      target: /path/to\n      path_style: true\n      access_key:\n        from_secret: minio_access_key\n      secret_key:\n        from_secret: minio_secret_key\n      endpoint: \n        from_secret: minio_host\n\n```\n\nVerifyin the output:\n\n```\n❯ aws --profile objects s3 --endpoint-url=https://objects.domain.com ls --recursive s3://dump/\n2019-04-18 10:47:30          4 path/to/public/data.txt\n```\n\n### Slack Notifications:\n\n- http://plugins.drone.io/drone-plugins/drone-slack/\n\n```\n  - name: slack\n    image: plugins/slack\n    settings:\n      webhook:\n        from_secret: slack_webhook\n      channel: system_events\n      image_url: https://unsplash.it/256/256/?random\n      icon_url: https://unsplash.it/256/256/?random\n      template: \u003e\n        {{#success build.status}}\n          build {{build.number}} succeeded. Good job. link: {{commit.link}} .\n        {{else}}\n          build {{build.number}} failed. Fix me please.\n        {{/success}}\n```\n\nMore verbose info:\n\n```\nkind: pipeline\nname: default\n\nsteps:\n..\n\n  - name: slack\n    image: plugins/slack\n    settings:\n      webhook:\n        from_secret: slack_webhook\n      channel: system_events\n      icon_url: https://www.pngkit.com/png/full/92-920674_drone-logo-png-transparent-drone-ci-logo.png\n      template: \u003e\n        {{#success build.status}}\n           build {{build.number}} status: *{{build.status}}*\n          build link: {{build.link}}\n          build author: {{build.author}}\n          build ref: {{build.ref}}\n          build event: {{build.event}}\n          build commit: {{build.commit}}\n          build branch: {{build.branch}}\n          build deploy: {{build.deployTo}}\n        {{else}}\n          build {{build.number}} failed. Fix me please.\n        {{/success}}\n\n```\n\n### Telegram Notifications:\n\n```\n..\n- name: telegram\n  image: appleboy/drone-telegram\n  settings:\n    token:\n      from_secret: telegram_token\n    to:\n      from_secret: telegram_to\n  when:\n    status: [ success, failure ]\n  photo:\n    - https://cdn.shopify.com/s/files/1/1061/1924/products/Virus_Emoji_large.png?v=1480481048\n  format: markdown\n```\n\n### Email Notifications\n\n```\n  notify:\n    image: drillster/drone-email\n    from: drone@example.com\n    host: smtp.example.com\n    skip_verify: true\n    secrets: [ email_username, email_password ]\n    subject: \u003e\n      [DRONE CI]: {{ build.status }}: {{ repo.owner }}/{{ repo.name }}\n      ({{ commit.branch }} - {{ truncate commit.sha 8 }})\n    recipients:\n      - user@domain.com\n```\n\n### SSH Example\n\n- http://plugins.drone.io/appleboy/drone-ssh/\n\n```\n...\n- name: ssh\n  image: appleboy/drone-ssh\n  pull: true\n  settings:\n    username: root\n    port: 2222\n    host:\n      from_secret: ssh_host\n    key:\n        from_secret: ssh_key\n    script:\n      - ls -lah\n      - find / -name Dockerfile\n      - docker node ls\n```\n\n### SCP Example\n\n- https://github.com/appleboy/drone-scp\n\n```\n myscp-step:\n   image: appleboy/drone-scp\n   host: \n     from_secret: swarm_host\n   username:\n     from_secret: swarm_user\n   key:\n     from_secret: swarm_key\n   target: /root/context\n   source: /root\n   when:\n     event: [push]\n```\n\n### Mount Docker Socket Example\n\nThis will allow your container to run docker commands as you are logged onto the host.\n\nEnsure you set your user as admin:\n\n`--env=DRONE_USER_CREATE=username:youruser,admin:true`\n\nMentioned here:\n- https://discourse.drone.io/t/linter-untrusted-repositories-cannot-mount-host-volumes/3438\n\nAnd that your repository is marked as trusted.\n\nNote that this will run on the host where the drone agent is located.\n\n```\n  deploy:\n    image: docker\n    secrets: [ swarm_key, swarm_host ]\n    commands:\n    - docker node ls\n    volumes:\n      - /var/run/docker.sock:/var/run/docker.sock\n    when:\n      event: [push]\n      branch: [master, develop, release/*]\n```\n\n### Volumes: Persistence\n\n- https://docs.drone.io/user-guide/pipeline/volumes/\n\n```\nkind: pipeline\nname: default\n\nsteps:\n- name: host-persistence\n  image: busybox\n  commands:\n  - find /data\n  volumes:\n  - name: hostvol\n    path: /data1\n\n- name: build-persistence\n  image: busybox\n  commands:\n  - touch /data2/file.txt\n  volumes:\n  - name: buildvol\n    path: /data2/file.txt\n\ndepends_on:\n- after\n\nvolumes:\n- name: hostvol\n  host:\n    path: /tmp/artifacts\n- name: buildvol\n  temp: {}\n```\n\n### Volumes: Temporary and Bind Mounts\n\n- https://docs.drone.io/user-guide/pipeline/volumes/\n\n```\nkind: pipeline\nname: default\n\nsteps:\n  - name: test\n    image: golang:alpine\n    volumes:\n      - name: cache\n        path: /tmp/cache\n    commands:\n      - go test -cover -v\n      - echo $$HOSTNAME \u003e\u003e /tmp/cache/hostname.txt\n      - env\n\n  - name: build\n    image: golang:alpine\n    volumes:\n      - name: cache\n        path: /tmp/cache\n    commands:\n      - go build -o app .\n      - echo $$HOSTNAME \u003e\u003e /tmp/cache/hostname.txt\n      \n  - name: run\n    image: golang:alpine\n    volumes:\n      - name: cache\n        path: /tmp/cache\n    commands:\n      - ./app\n      - echo $$HOSTNAME \u003e\u003e /tmp/cache/hostname.txt\n      \n  - name: docker-build\n    image: docker:dind\n    volumes:\n      - name: docker-socket\n        path: /var/run/docker.sock\n    commands:\n      - docker build -t ruanbekker/golang:$$DRONE_COMMIT_SHA .\n      \n  - name: docker-deploy\n    image: docker:dind\n    volumes:\n      - name: docker-socket\n        path: /var/run/docker.sock\n    commands:\n      - docker run ruanbekker/golang:$$DRONE_COMMIT_SHA\n      - docker ps\n      \nvolumes:\n  - name: docker-socket\n    host:\n      path: /var/run/docker.sock\n  - name: cache\n    temp: {}\n```\n\n### Rsync Example\n\n```\n  push:\n    image: drillster/drone-rsync\n    hosts: \n      from_secret: swarm_host\n    key:\n      from_secret: swarm_key\n    source: _site/*\n    target: ~/example.com\n    recursive: true\n    user:\n      from_secret: swarm_user\n    delete: true\n    script:\n      - chmod -R 755 ~/example.com\n    when:\n      event: [push]\n```\n\n### Parallel Builds\n\nRunning steps in parallel:\n\n```\n- name: step-one\n  image: alpine\n  commands:\n  - date +%s\n\n- name: step-two\n  image: alpine\n  commands:\n  - date +%s\n  \n- name: parallel-step\n  image: alpine\n  depends_on: [ parallel-one, parallel-two ]  \n\n```\n\n### Docker Remote Tunnel Example\n\nUsing docker-remote-tunnel to run docker commands remotely via docker socket\n\n```\n  deploy:\n    image: ruanbekker/docker-remote-tunnel\n    secrets: [ swarm_key_base64, swarm_host ]\n    commands:\n    - echo $${SWARM_KEY_BASE64} | base64 -d \u003e /tmp/key\n    - chmod 600 /tmp/key\n    - docker-tunnel --connect root@$${SWARM_HOST}\n    - sleep 5\n    - source /root/.docker-tunnel.sh\n    - docker ps\n    - docker-tunnel --terminate\n    when:\n      event: [push]\n      branch: [master, develop, release/*]\n\n```\n\n### Use Services with Pipelines\n\nYou can use services like postgres databases in your steps:\n\n```\npipeline:\n  ping:\n    image: postgres\n    commands:\n      - sleep 10\n      - psql -U postgres -d test -h database -p 5432 -c \"CREATE TABLE person( NAME TEXT );\"\n      - psql -U postgres -d test -h database -p 5432 -c \"INSERT INTO person VALUES('john smith');\"\n      - psql -U postgres -d test -h database -p 5432 -c \"INSERT INTO person VALUES('jane doe');\"\n      - psql -U postgres -d test -h database -p 5432 -c \"SELECT * FROM person;\"\n\nservices:\n  database:\n    image: postgres\n    environment:\n      - POSTGRES_USER=postgres\n      - POSTGRES_DB=test\n\nservices:\n- name: mysql\n  image: mysql:5.7\n  environment:\n    MYSQL_DATABASE: rest_api_example\n    MYSQL_ROOT_PASSWORD: password\n    MYSQL_USER: demo\n    MYSQL_PASSWORD: demo\n```\n\n### Multipipeline Depends on Steps\n\nResource:\n- https://docs.drone.io/user-guide/pipeline/multi-machine/\n\nDependency graph, spans across multiple machines. Last step only executes when the frontend, backend pipelines has finished\n\n```\nkind: pipeline\nname: frontend\n\nsteps:\n- name: build\n  image: alpine\n  group: one\n  commands:\n  - sleep 10\n  - echo done\n  - date\n\n- name: build2\n  image: alpine\n  group: one\n  commands:\n  - sleep 10\n  - echo done\n  - date\n\n---\nkind: pipeline\nname: backend\n\nsteps:\n- name: build\n  image: alpine\n  commands:\n  - sleep 10\n  - echo done\n  - date\n\nservices:\n- name: redis\n  image: redis\n\n---\nkind: pipeline\nname: after\n\nsteps:\n- name: notify\n  image: alpine\n  commands:\n  - sleep 10\n  - echo done\n  - date\n\ndepends_on:\n- frontend\n- backend\n```\n\n### 3 Times Multiple Pipeline Dependencies with Volumes\n\n```\nkind: pipeline\ntype: docker\nname: one\n\nsteps:\n- name: one-a\n  image: busybox\n  commands:\n  - touch /data/$$RANDOM.txt\n  - ls\n  volumes:\n  - name: artifacts\n    path: /data\n\nvolumes:\n- name: artifacts\n  host:\n    path: /tmp/artifacts\n---\nkind: pipeline\ntype: docker\nname: two\n\nsteps:\n- name: two-a\n  image: busybox\n  commands:\n  - touch /data/$$RANDOM.txt\n  - ls\n  volumes:\n  - name: artifacts\n    path: /data\n\nvolumes:\n- name: artifacts\n  host:\n    path: /tmp/artifacts\n---\nkind: pipeline\ntype: docker\nname: after\n\nsteps:\n- name: after-a\n  image: busybox\n  commands:\n  - touch /data/after.txt\n  - ls\n  volumes:\n  - name: artifacts\n    path: /data\n\ndepends_on:\n- one\n- two\n\nvolumes:\n- name: artifacts\n  host:\n    path: /tmp/artifacts\n---\nkind: pipeline\ntype: docker\nname: after-after\n\nsteps:\n- name: after-a\n  image: busybox\n  commands:\n  - find /data\n  volumes:\n  - name: artifacts\n    path: /data\n\ndepends_on:\n- after\n\nvolumes:\n- name: artifacts\n  host:\n    path: /tmp/artifacts\n\n```\n\n### Example Pipelines\n\n- [myth/overflow drone pipeline](https://github.com/myth/overflow/blob/master/.drone.yml)\n- [drone/docs pipeline](https://github.com/drone/docs/blob/master/.drone.yml)\n- [cncd/pipelines samples](https://github.com/cncd/pipeline/tree/master/samples)\n- [xueshanf/docker-awscli example](https://github.com/xueshanf/docker-awscli/blob/master/.drone.yml)\n- [owncloud-docker/server pipeline](https://github.com/owncloud-docker/server/blob/master/.drone.yml)\n- [justinbarrick pipeline](https://github.com/justinbarrick/fluxcloud/blob/master/.drone.yml)\n\n### Docker Swarm Stacks\n\n- https://github.com/codestation/drone-stack\n- https://github.com/drone/drone/issues/2277\n\n### Resources\n\n- https://www.slideshare.net/appleboy/drone-cicd-platform\n- https://laszlo.cloud/the-ultimate-droneci-caching-guide\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanbekker%2Fdrone-ci-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruanbekker%2Fdrone-ci-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanbekker%2Fdrone-ci-testing/lists"}