Closes #27 - Optimize the update process.
This commit is contained in:
parent
c891b00605
commit
856770bb7e
15
update.sh
15
update.sh
|
@ -1,9 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -q -y software-properties-common
|
||||
sudo apt-add-repository ppa:ansible/ansible
|
||||
sudo apt-get update
|
||||
sudo apt-get install -q -y ansible python-mysqldb
|
||||
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' ansible|grep "install ok installed")
|
||||
echo Checking for Ansible: $PKG_OK
|
||||
|
||||
if [ "" == "$PKG_OK" ]; then
|
||||
sudo apt-get update
|
||||
sudo apt-get install -q -y software-properties-common
|
||||
sudo apt-add-repository ppa:ansible/ansible
|
||||
sudo apt-get update
|
||||
sudo apt-get install -q -y ansible python-mysqldb
|
||||
fi
|
||||
|
||||
ansible-playbook util/ansible/update.yml --inventory=util/ansible/hosts --extra-vars "app_env=production"
|
|
@ -2,6 +2,7 @@
|
|||
- name: Install Composer
|
||||
become: true
|
||||
shell: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
|
||||
creates: /usr/bin/composer
|
||||
args:
|
||||
warn: no
|
||||
|
||||
|
|
|
@ -2,17 +2,21 @@
|
|||
- name: Add PHP PPA repository
|
||||
become: true
|
||||
apt_repository: repo=ppa:ondrej/php
|
||||
register: installed_php_ppa
|
||||
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty'
|
||||
|
||||
- name: Add Phalcon PPA repository
|
||||
become: true
|
||||
shell: curl -s https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh | sudo bash
|
||||
register: installed_phalcon_ppa
|
||||
creates: /etc/apt/sources.list.d/phalcon_stable.list
|
||||
args:
|
||||
warn: no
|
||||
|
||||
- name: Update apt again
|
||||
become: true
|
||||
apt: update_cache=yes
|
||||
when: installed_phalcon_ppa.changed or installed_php_ppa.changed
|
||||
|
||||
- name: Install PHP Libraries
|
||||
become: true
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
roles:
|
||||
- init
|
||||
- azuracast-update
|
||||
- azuracast-radio
|
||||
- php-phalcon
|
||||
- composer
|
||||
- azuracast-cron
|
||||
- azuracast-update
|
||||
- azuracast-cron
|
Loading…
Reference in New Issue