This repository has been archived by the owner on Jan 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
39 lines (37 loc) · 1.34 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
dist: xenial
rvm: 2.5
language: ruby
addons:
ssh_known_hosts:
- dadastaging.okfn.fr
- madada.fr
- 92.243.18.104
before_install:
# export a few variables based on the current branch
- chmod +x set_env_vars_based_on_git_branch.sh
- source ./set_env_vars_based_on_git_branch.sh
# check that the exports were correct
- echo $DEPLOY_SERVER_NAME
- echo $PRIVKEY_FILE
# install ansible for provisioning of server (setup db, nginx, MTA...)
- sudo add-apt-repository --yes ppa:ansible/ansible
- sudo apt-get update -y
- sudo apt-get install ansible
# install capistrano and related packages
- gem install bundler capistrano
- cp ansible/ansible.cfg ~/.ansible.cfg
- sudo touch /var/log/ansible.log
- sudo chown travis /var/log/ansible.log
- ansible-galaxy install --roles-path ansible/roles anxs.postgresql,v1.11.1
install:
- eval "$(ssh-agent -s)" #start the ssh agent
- openssl aes-256-cbc -K $encrypted_e64c44062370_key -iv $encrypted_e64c44062370_iv -in ssh-privkeys.tar.enc -out ssh-privkeys.tar -d
- tar xvf ssh-privkeys.tar
- chmod 600 $PRIVKEY_FILE
- ssh-add $PRIVKEY_FILE
before_script:
# ansible cannot get the vault password from an env var
- echo $ANSIBLE_VAULT_PASSWORD > /tmp/.ansible_vault_pwd
- export ANSIBLE_VAULT_PASSWORD_FILE=/tmp/.ansible_vault_pwd
script:
- ansible-playbook -i ansible/ansible_inventory ansible/site.yml --limit $DEPLOY_SERVER_NAME