This commit is contained in:
Silver Ghost 2022-11-16 10:01:00 +03:00
parent f112d3df6c
commit 3ce6ec1362
No known key found for this signature in database

View File

@ -29,86 +29,72 @@ volumes:
- name: cache
host:
path: /opt/docker/drone/cache
# ---
# kind: pipeline
# type: docker
# name: build
# steps:
# - name: build
# image: docker
# commands:
# - docker build -t registry.dntsk.dev/audiobooks:${DRONE_BRANCH} .
# - docker push registry.dntsk.dev/audiobooks:${DRONE_BRANCH}
# volumes:
# - name: cache
# path: /root/.cache/pip
# - name: docker_sock
# path: /var/run/docker.sock
# - name: docker_config
# path: /root/.docker
---
kind: pipeline
type: docker
name: build
# volumes:
# - name: cache
# host:
# path: /opt/docker/drone/cache
# - name: docker_sock
# host:
# path: /var/run/docker.sock
# - name: docker_config
# host:
# path: /root/.docker
steps:
- name: build
image: docker
commands:
- docker build -t dntsk/later42:${DRONE_BRANCH} .
- docker tag dntsk/later42:${DRONE_BRANCH} dntsk/later42:latest
- docker push dntsk/later42:${DRONE_BRANCH}
volumes:
- name: cache
path: /root/.cache/pip
- name: docker_sock
path: /var/run/docker.sock
- name: docker_config
path: /root/.docker
# trigger:
# branch:
# - master
# - staging
volumes:
- name: cache
host:
path: /opt/docker/drone/cache
- name: docker_sock
host:
path: /var/run/docker.sock
- name: docker_config
host:
path: /root/.docker
# depends_on:
# - test
trigger:
branch:
- master
# ---
# kind: pipeline
# type: docker
# name: deploy
depends_on:
- test
# steps:
# - name: deploy_staging
# image: appleboy/drone-ssh
# settings:
# host:
# from_secret: ssh_host
# username:
# from_secret: ssh_username
# key:
# from_secret: ssh_key
# port: 22
# script:
# - cd /opt
# - docker-compose pull abooks_staging
# - docker-compose up -d abooks_staging
# when:
# branch: staging
# - name: deploy_production
# image: appleboy/drone-ssh
# settings:
# host:
# from_secret: ssh_host
# username:
# from_secret: ssh_username
# key:
# from_secret: ssh_key
# port: 22
# script:
# - cd /opt
# - docker-compose pull abooks_prod
# - docker-compose up -d abooks_prod
# when:
# branch: master
---
kind: pipeline
type: docker
name: deploy
# depends_on:
# - build
steps:
- name: deploy
image: appleboy/drone-ssh
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_username
key:
from_secret: ssh_key
port: 22
script:
- cd /opt
- docker-compose pull later42
- docker-compose up -d later42 later42_tasks
trigger:
branch:
- master
depends_on:
- build
# ---
# kind: pipeline
# type: docker