mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-15 21:04:46 +01:00
65 lines
No EOL
1.2 KiB
YAML
65 lines
No EOL
1.2 KiB
YAML
kind: pipeline
|
|
name: default
|
|
|
|
steps:
|
|
|
|
- name: test
|
|
image: golang
|
|
environment:
|
|
GOPATH: /drone/
|
|
CGO_LDFLAGS_ALLOW: '-fopenmp'
|
|
commands:
|
|
- cd server
|
|
- rm -rf plugin/plg_*
|
|
- go get -t ./...
|
|
- go build
|
|
- go test -v ./...
|
|
|
|
- name: publish
|
|
image: plugins/docker
|
|
settings:
|
|
dockerfile: ./docker/prod/Dockerfile
|
|
repo: machines/filestash
|
|
username:
|
|
from_secret: DOCKER_USERNAME
|
|
password:
|
|
from_secret: DOCKER_PASSWORD
|
|
tags: unstable
|
|
|
|
- name: test_service0
|
|
image: machines/filestash:unstable
|
|
detach: true
|
|
- name: test_main
|
|
image: machines/filestash_test
|
|
commands:
|
|
- cd /app
|
|
- CI=true APP_URL=http://test_service0:8334 npm test
|
|
|
|
- name: release
|
|
image: plugins/docker
|
|
when:
|
|
branch: master
|
|
settings:
|
|
dockerfile: ./docker/prod/Dockerfile
|
|
repo: machines/filestash
|
|
username:
|
|
from_secret: DOCKER_USERNAME
|
|
password:
|
|
from_secret: DOCKER_PASSWORD
|
|
tags: latest
|
|
|
|
- name: deploy
|
|
image: appleboy/drone-ssh
|
|
when:
|
|
branch: master
|
|
settings:
|
|
host: hal.kerjean.me
|
|
user:
|
|
from_secret: SSH_USERNAME
|
|
password:
|
|
from_secret: SSH_PASSWORD
|
|
port: 22
|
|
script:
|
|
- cd /app/filestash
|
|
- docker-compose pull
|
|
- docker-compose up -d |