Skip to content

Instantly share code, notes, and snippets.

@akalipetis
Last active October 16, 2019 12:28
Show Gist options
  • Save akalipetis/df47dbf84ba72e046a8b953d458e6537 to your computer and use it in GitHub Desktop.
Save akalipetis/df47dbf84ba72e046a8b953d458e6537 to your computer and use it in GitHub Desktop.
Drone Swarm deployment stack and example pipeline
pipeline:
test:
image: akalipetis/ci:17.07.0_1.16.1
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
- docker-compose run web python tests.py
build:
image: akalipetis/ci:17.07.0_1.16.1
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
- docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
- docker-compose build
- docker-compose push
secrets:
- source: docker-username
target: docker_username
- source: docker-password
target: docker_password
when:
branch: master
deploy:
image: akalipetis/ci:17.07.0_1.16.1
commands:
- docker stack deploy -c docker-compose.yml my-stack
when:
branch: master
volumes:
- /var/run/docker.sock:/var/run/docker.sock
services:
docker:
image: docker:18.03-dind
command: [ "--storage-driver=aufs", "--tls=false" ]
privileged: true
volumes:
- /mnt/drone-dind:/var/lib/docker
version: '3.5'
services:
drone-server:
image: drone/drone:0.8
ports:
- 80:8000
volumes:
- drone:/var/lib/drone/
environment:
- DRONE_OPEN=true
- DRONE_HOST=${DRONE_HOST}
- DRONE_GITHUB=true
- DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
- DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
- DRONE_SECRET=a-secret-here
- DRONE_ADMIN=<repo_username>
drone-agent:
image: drone/agent:0.8
command: agent
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DRONE_SERVER=drone-server:9000
- DRONE_SECRET=a-secret-here
volumes:
drone:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment