Ansible + fix default path

This commit is contained in:
Meutel 2019-09-27 17:53:32 +02:00
parent 2c3f807c09
commit 6ae88a3c79
4 changed files with 22 additions and 26 deletions

View File

@ -14,8 +14,7 @@
traefik.frontend.rule: "Host:{{ draft_name }}.bouquins.www.meutel.net"
networks:
name: proxybackend
# TODO volumes
volumes_from:
- mydata
volumes:
- bouquins_draft:/root/data
# vim:ft=ansible:

4
.ansible/inventory Normal file
View File

@ -0,0 +1,4 @@
ambrosia ansible_host=148.251.42.122 ansible_python_interpreter=/usr/bin/python3 ansible_user=drone
[docker]
ambrosia

View File

@ -45,7 +45,6 @@ steps:
registry: reg.meutel.net
repo: reg.meutel.net/go-bouquins
tags: ${DRONE_BRANCH##feature/}
debug: true
username:
from_secret: registry_login
password:
@ -54,32 +53,26 @@ steps:
branch:
- feature/*
- name: deploy-branch
image: plugins/ansible:1
environment:
draft_name: ${DRONE_BRANCH##feature/}
settings:
playbook: .ansible/deploy-draft.yml
inventory: .ansible/inventory
private_key:
from_secret: drone_ssh_key
when:
branch:
- feature/*
trigger:
event:
- push
- tag
---
kind: pipeline
type: ssh
name: deploy
server:
host: meutel.net
user: drone
ssh_key:
from_secret: drone_ssh_key
steps:
- name: deploy-branch
commands:
- id
depends_on:
- default
---
kind: signature
hmac: 2432bc54b5194625c455761323cb615cc117611ee9af4639f9b3463824f158fa
hmac: 7a0b174d395933fd3e9826391addd09db9272668e77291f78d23528b370c1cf4
...

View File

@ -32,13 +32,13 @@ func ReadConfig() (*bouquins.Conf, error) {
}
// default values
if conf.CalibrePath == "" {
conf.CalibrePath = "."
conf.CalibrePath = "./data"
}
if conf.DbPath == "" {
conf.DbPath = conf.CalibrePath + "/metadata.db"
}
if conf.UserDbPath == "" {
conf.UserDbPath = "./users.db"
conf.UserDbPath = "./data/users.db"
}
if conf.BindAddress == "" {
conf.BindAddress = ":9000"