ci: drone config
This commit is contained in:
parent
6a9cb21b12
commit
a0eb3d392a
53
.drone.yml
Normal file
53
.drone.yml
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: docker-compose-deploy
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: dockerize
|
||||||
|
image: plugins/docker
|
||||||
|
environment:
|
||||||
|
DOCKER_BUILDKIT: 1
|
||||||
|
settings:
|
||||||
|
repo: localhost:8091/thek4n/thek4n.ru
|
||||||
|
tags:
|
||||||
|
- latest
|
||||||
|
- ${DRONE_TAG}
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
registry: localhost:8091
|
||||||
|
insecure: true
|
||||||
|
build_args:
|
||||||
|
- APP_VERSION=${DRONE_TAG}
|
||||||
|
volumes:
|
||||||
|
- name: docker-socket
|
||||||
|
path: /var/run/docker.sock
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- promote
|
||||||
|
target:
|
||||||
|
- production
|
||||||
|
- development
|
||||||
|
ref:
|
||||||
|
- refs/tags/*
|
||||||
|
|
||||||
|
- name: deploy-to-production
|
||||||
|
image: appleboy/drone-ssh
|
||||||
|
settings:
|
||||||
|
host:
|
||||||
|
- 192.168.50.5
|
||||||
|
username: thek4n
|
||||||
|
key:
|
||||||
|
from_secret: ssh_key
|
||||||
|
port: 22
|
||||||
|
script:
|
||||||
|
- |
|
||||||
|
cd "/home/thek4n/services/thek4n.ru" && \
|
||||||
|
IMAGE_TAG="${DRONE_TAG}" docker compose up -d
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- promote
|
||||||
|
target:
|
||||||
|
- production
|
||||||
|
ref:
|
||||||
|
- refs/tags/*
|
||||||
|
depends_on:
|
||||||
|
- dockerize
|
||||||
@ -34,4 +34,4 @@ FROM scratch
|
|||||||
|
|
||||||
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/thek4n-ru /usr/local/bin/thek4n-ru
|
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/thek4n-ru /usr/local/bin/thek4n-ru
|
||||||
|
|
||||||
CMD ["/usr/local/bin/thek4n-ru"]
|
CMD ["/usr/local/bin/thek4n-ru", "--host", "0.0.0.0", "--port", "80", "--config", "/configs/config.toml"]
|
||||||
|
|||||||
21
docker-compose.yaml
Normal file
21
docker-compose.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
services:
|
||||||
|
paste:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
|
||||||
|
image: 'thek4n/thek4n.ru'
|
||||||
|
|
||||||
|
pull_policy: build
|
||||||
|
|
||||||
|
container_name: 'thek4n.ru'
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- 8081:80
|
||||||
|
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- "/etc/timezone:/etc/timezone:ro"
|
||||||
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
|
- "./configs:/configs"
|
||||||
Loading…
x
Reference in New Issue
Block a user