update(144.76.113.134):
  tags:
  - 144.76.113.134
  only:
    - master@open-source/MetaGer
  before_script:
    # Abhängigkeiten überprüfen
    - which composer
    - which git
    - which php7.0
    - which sqlite3
  script:
    # Pfad zum neu geklonten Repo
    - path=`pwd`
    - cd ~/
    - if [ -d MetaGer_neu ]; then rm -rf MetaGer_neu;fi
    - git clone "$path" MetaGer_neu
    - cd MetaGer_neu
    - composer install
    - scp -P 63824 metager@metager3.de:~/.env .
    - scp -P 63824 metager@metager3.de:~/sumas.xml config/
    - scp -P 63824 metager@metager3.de:~/sumasEn.xml config/
    - scp -P 63824 metager@metager3.de:~/blacklistUrl.txt config/
    - scp -P 63824 metager@metager3.de:~/blacklistDomains.txt config/
    - touch storage/logs/laravel.log
    - touch storage/logs/worker.log
    - chmod 777 config/sumas.xml config/sumasEn.xml database/metager.sqlite
    - chmod -R 777 storage
    - chmod -R 777 bootstrap/cache
    - ./gulpbuild.sh
    - if [ -f ~/MetaGer/artisan ]; then php ~/MetaGer/artisan down;fi
    - cd ~/
    - while [ -d ~/MetaGer ]; do rm -rf ~/MetaGer;done
    - mv MetaGer_neu MetaGer
    - php ~/MetaGer/artisan migrate --force
    - sudo pkill --signal SIGHUP supervisord
    - php ~/MetaGer/artisan up
   
update(metager2):
  tags:
  - metager2
  only:
    - master@open-source/MetaGer
  before_script:
    # Abhängigkeiten überprüfen
    - which composer
    - which git
    - which php7.0
    - which sqlite3
  script:
    # Pfad zum neu geklonten Repo
    - path=`pwd`
    - cd ~/
    - if [ -d MetaGer_neu ]; then rm -rf MetaGer_neu;fi
    - git clone "$path" MetaGer_neu
    - cd MetaGer_neu
    - composer install
    - scp -P 63824 metager@metager3.de:~/.env .
    - scp -P 63824 metager@metager3.de:~/sumas.xml config/
    - scp -P 63824 metager@metager3.de:~/sumasEn.xml config/
    - scp -P 63824 metager@metager3.de:~/blacklistUrl.txt config/
    - scp -P 63824 metager@metager3.de:~/blacklistDomains.txt config/
    - touch storage/logs/laravel.log
    - touch storage/logs/worker.log
    - chmod 777 config/sumas.xml config/sumasEn.xml database/metager.sqlite
    - chmod -R 777 storage
    - chmod -R 777 bootstrap/cache
    - ./gulpbuild.sh
    - if [ -f ~/MetaGer/artisan ]; then php ~/MetaGer/artisan down;fi
    - cd ~/
    - while [ -d ~/MetaGer ]; do rm -rf ~/MetaGer;done
    - mv MetaGer_neu MetaGer
    - php ~/MetaGer/artisan migrate --force
    - sudo pkill --signal SIGHUP supervisord
    - php ~/MetaGer/artisan up
    
update(metager3.de):
  tags:
  - metager3
  only:
    - development@open-source/MetaGer
  before_script:
    # Abhängigkeiten überprüfen
    - which composer
    - which git
    - which php7.0
    - which sqlite3
  script:
    # Pfad zum neu geklonten Repo
    - path=`pwd`
    - cd ~/
    - if [ -d MetaGer_neu ]; then rm -rf MetaGer_neu;fi
    - git clone "$path" MetaGer_neu
    - cd MetaGer_neu
    - composer install
    - scp -P 63824 metager@metager3.de:~/.env .
    - scp -P 63824 metager@metager3.de:~/sumas.xml config/
    - scp -P 63824 metager@metager3.de:~/sumasEn.xml config/
    - scp -P 63824 metager@metager3.de:~/blacklistUrl.txt config/
    - scp -P 63824 metager@metager3.de:~/blacklistDomains.txt config/
    - touch storage/logs/laravel.log
    - touch storage/logs/worker.log
    - chmod 777 config/sumas.xml config/sumasEn.xml database/metager.sqlite
    - chmod -R 777 storage
    - chmod -R 777 bootstrap/cache
    - ./gulpbuild.sh
    - if [ -f ~/MetaGer/artisan ]; then php ~/MetaGer/artisan down;fi
    - cd ~/
    - while [ -d ~/MetaGer ]; do rm -rf ~/MetaGer;done
    - mv MetaGer_neu MetaGer
    - php ~/MetaGer/artisan migrate --force
    - sudo pkill --signal SIGHUP supervisord
    - php ~/MetaGer/artisan up