Some checks failed
continuous-integration/drone/push Build encountered an error
55 lines
1.2 KiB
YAML
55 lines
1.2 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
- name: go test
|
|
image: golang:1.25-alpine3.21
|
|
commands:
|
|
- apk add --no-cache git curl
|
|
- go mod tidy
|
|
- go test ./...
|
|
|
|
- name: build docker image
|
|
image: docker:24
|
|
privileged: true
|
|
volumes:
|
|
- name: dockersock
|
|
path: /var/run/docker.sock
|
|
commands:
|
|
- docker build -t localhost:5000/link-shortener:latest -f dockerfile .
|
|
|
|
- name: deploy with compose
|
|
image: docker/compose:2.22.0
|
|
privileged: true
|
|
volumes:
|
|
- name: dockersock
|
|
path: /var/run/docker.sock
|
|
- name: workspace
|
|
path: /opt/app
|
|
environment:
|
|
IMAGE: localhost:5000/link-shortener:latest
|
|
SERVER_HOST: link.dusiburg.ru
|
|
VIRTUAL_HOST: link.dusiburg.ru
|
|
VIRTUAL_PORT: 80
|
|
LETSENCRYPT_HOST: link.dusiburg.ru
|
|
LETSENCRYPT_EMAIL:
|
|
from_secret: LETSENCRYPT_EMAIL
|
|
SERVER_PORT: 80
|
|
REDIS_URL: redis://redis:6379
|
|
commands:
|
|
- cd /opt/app
|
|
- docker-compose pull
|
|
- docker-compose up -d
|
|
|
|
volumes:
|
|
- name: dockersock
|
|
host:
|
|
path: /var/run/docker.sock
|
|
- name: workspace
|
|
host:
|
|
path: ./
|
|
|
|
trigger:
|
|
branch:
|
|
- main |