Ansible + fix default path
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Meutel 2019-09-27 17:53:32 +02:00
parent 00761ce8bc
commit a30dda5ce7
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" traefik.frontend.rule: "Host:{{ draft_name }}.bouquins.www.meutel.net"
networks: networks:
name: proxybackend name: proxybackend
# TODO volumes volumes:
volumes_from: - bouquins_draft:/root/data
- mydata
# vim:ft=ansible: # 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 registry: reg.meutel.net
repo: reg.meutel.net/go-bouquins repo: reg.meutel.net/go-bouquins
tags: ${DRONE_BRANCH##feature/} tags: ${DRONE_BRANCH##feature/}
debug: true
username: username:
from_secret: registry_login from_secret: registry_login
password: password:
@ -54,32 +53,26 @@ steps:
branch: branch:
- feature/* - 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: trigger:
event: event:
- push - push
- tag - 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 kind: signature
hmac: 2432bc54b5194625c455761323cb615cc117611ee9af4639f9b3463824f158fa hmac: 7a0b174d395933fd3e9826391addd09db9272668e77291f78d23528b370c1cf4
... ...

View File

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