post_install() {
    systemd-tmpfiles --create gitlab.conf

    echo "Copy a database example config from /usr/share/doc/gitlab/ to /etc/webapps/gitlab/database.yml and configure it"
    echo "Setup the database:"
    echo "# su - gitlab -s /bin/sh -c \"cd '/usr/share/webapps/gitlab'; bundle-2.1 exec rake gitlab:setup RAILS_ENV=production\""
    echo "Put a secret bytestring to /etc/webapps/gitlab/secret"
    echo "Finally run the following commands to check your installation:"
    echo "# su - gitlab -s /bin/sh -c \"cd '/usr/share/webapps/gitlab'; bundle-2.1 exec rake gitlab:env_info RAILS_ENV=production\""
    echo "# su - gitlab -s /bin/sh -c \"cd '/usr/share/webapps/gitlab'; bundle-2.1 exec rake gitlab:check RAILS_ENV=production\""
}

post_upgrade() {
    echo "You should upgrade your database:"
    echo "# su - gitlab -s /bin/sh -c \"cd '/usr/share/webapps/gitlab'; bundle-2.1 exec rake db:migrate RAILS_ENV=production\""
    echo "Afterwards, restart gitlab"
}
