From 099a951dfd20e10aeb047e4454837e071a48f870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Wed, 26 Oct 2016 11:04:36 +0200 Subject: [PATCH] changes to postinstall.sh (#308) * remove contrib/packager.io dir / move cleanup.sh back top contrib / moved postinstall.sh to contrib/pkgr-postinstall.sh / fixed path in .pkgr.yml * added localhost to nginx.conf servername to get a running version for local testers * added message with browserlink of zamad to postinstall.sh * reoved zammad.example.com fromk nginx config --- .pkgr.yml | 4 ++-- contrib/{packager.io => }/cleanup.sh | 0 contrib/nginx/sites-available/zammad.conf | 2 +- .../postinstall.sh => pkgr-postinstall.sh} | 14 ++++++++++++-- 4 files changed, 15 insertions(+), 5 deletions(-) rename contrib/{packager.io => }/cleanup.sh (100%) rename contrib/{packager.io/postinstall.sh => pkgr-postinstall.sh} (78%) diff --git a/.pkgr.yml b/.pkgr.yml index 4984a9990..30bbf9f8a 100644 --- a/.pkgr.yml +++ b/.pkgr.yml @@ -25,11 +25,11 @@ before: - cp config/database.yml.pkgr config/database.yml - echo "gem 'mysql2'" >> Gemfile.local - "cat Gemfile.lock" - - contrib/packager.io/cleanup.sh + - contribcleanup.sh env: - RAILS_ENV=production - PORT=3000 - RAILS_SERVE_STATIC_FILES=true services: - postgres -after_install: contrib/packager.io/postinstall.sh +after_install: contrib/pkgr-postinstall.sh diff --git a/contrib/packager.io/cleanup.sh b/contrib/cleanup.sh similarity index 100% rename from contrib/packager.io/cleanup.sh rename to contrib/cleanup.sh diff --git a/contrib/nginx/sites-available/zammad.conf b/contrib/nginx/sites-available/zammad.conf index 731c4d8b8..b1726e411 100644 --- a/contrib/nginx/sites-available/zammad.conf +++ b/contrib/nginx/sites-available/zammad.conf @@ -14,7 +14,7 @@ upstream zammad-websocket { server { listen 80; - server_name zammad.example.com; + server_name localhost; root /opt/zammad/public; access_log /var/log/nginx/zammad.access.log; diff --git a/contrib/packager.io/postinstall.sh b/contrib/pkgr-postinstall.sh similarity index 78% rename from contrib/packager.io/postinstall.sh rename to contrib/pkgr-postinstall.sh index d696e555f..1487df3fe 100755 --- a/contrib/packager.io/postinstall.sh +++ b/contrib/pkgr-postinstall.sh @@ -57,8 +57,18 @@ systemctl start zammad if [ -d /etc/nginx/sites-enabled ]; then # copy nginx config test -f /etc/nginx/sites-available/zammad.conf || cp ${ZAMMAD_DIR}/contrib/nginx/sites-available/zammad.conf /etc/nginx/sites-available/zammad.conf - # creating symlink - test -f /etc/nginx/sites-available/zammad.conf || ln -s /etc/nginx/sites-available/zammad.conf /etc/nginx/sites-enabled/zammad.conf + + if [ ! -f /etc/nginx/sites-available/zammad.conf ] + # creating symlink + ln -s /etc/nginx/sites-available/zammad.conf /etc/nginx/sites-enabled/zammad.conf + + # show message + echo -e "\nOpen http://localhost in your browser to start or add your FQDN to servername directive in /etc/nginx/sites/enabled/zammad.conf if you're not testing localy!\n" + fi + # restart nginx systemctl restart nginx +else + # show message + echo -e "\nOpen http://localhost:3000 in your browser to start!\n" fi