Created
March 8, 2023 17:56
-
-
Save damsdev1/725668b5bd67229862a72ed905d977d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: pipeline | |
type: docker | |
name: default | |
steps: | |
- name: Stop Container | |
image: docker:dind | |
volumes: | |
- name: dockersock | |
path: /var/run/docker.sock | |
commands: | |
- docker stop container_name | |
- docker rm container_name | |
when: | |
status: | |
- success | |
- failure | |
- name: Start Container | |
image: docker:dind | |
volumes: | |
- name: dockersock | |
path: /var/run/docker.sock | |
- name: compose | |
path: /data | |
commands: | |
- cd /data/ | |
- docker image prune -a -f | |
- docker-compose up -d | |
- docker start container_name | |
when: | |
status: | |
- success | |
- failure | |
volumes: | |
- name: compose | |
host: | |
path: /path/to/your/container/folder/with/docker/compose/yml | |
- name: dockersock | |
host: | |
path: /var/run/docker.sock | |
trigger: | |
event: | |
exclude: | |
- pull_request |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment