2020-02-26 23:33:46 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# run zammad tests
|
|
|
|
#
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
docker-compose logs --timestamps --follow &
|
|
|
|
|
2021-03-18 20:53:46 +00:00
|
|
|
until (curl -I --silent --fail localhost:8080 | grep -iq "HTTP/1.1 200 OK"); do
|
2020-02-26 23:33:46 +00:00
|
|
|
echo "wait for zammad to be ready..."
|
|
|
|
sleep 15
|
|
|
|
done
|
|
|
|
|
2020-02-27 11:42:06 +00:00
|
|
|
sleep 30
|
2020-02-26 23:33:46 +00:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Success - Zammad is up :)"
|
|
|
|
echo
|
2020-03-13 13:01:02 +00:00
|
|
|
|
2021-10-05 19:25:26 +00:00
|
|
|
echo
|
2020-02-27 23:38:52 +00:00
|
|
|
echo "Execute autowizard..."
|
|
|
|
echo
|
|
|
|
|
2023-06-14 09:36:39 +00:00
|
|
|
docker exec --env=AUTOWIZARD_RELATIVE_PATH=var/auto_wizard.json --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-docker-compose_zammad-railsserver_1 rake zammad:setup:auto_wizard
|
2020-02-27 23:38:52 +00:00
|
|
|
|
2021-10-05 19:25:26 +00:00
|
|
|
echo
|
2020-03-07 12:21:46 +00:00
|
|
|
echo "Autowizard executed successful :)"
|
2021-10-05 19:25:26 +00:00
|
|
|
echo
|
2020-02-27 23:38:52 +00:00
|
|
|
|
2020-03-13 01:23:39 +00:00
|
|
|
|
2023-06-14 09:36:39 +00:00
|
|
|
echo
|
|
|
|
echo "Check DB for AutoWizard user"
|
|
|
|
echo
|
|
|
|
|
|
|
|
docker exec --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-docker-compose_zammad-railsserver_1 rails r "p User.find_by(email: 'info@zammad.org')" | grep 'info@zammad.org'
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Check DB for AutoWizard user successfull :)"
|
|
|
|
echo
|
|
|
|
|
2021-10-05 19:25:26 +00:00
|
|
|
echo
|
2020-03-13 13:01:02 +00:00
|
|
|
echo "Fill DB with some random data"
|
2023-06-14 09:36:39 +00:00
|
|
|
echo
|
|
|
|
|
|
|
|
docker exec --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-docker-compose_zammad-railsserver_1 rails r "FillDb.load(agents: 1,customers: 1,groups: 1,organizations: 1,overviews: 1,tickets: 1)"
|
2020-03-13 13:01:02 +00:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "DB fill successful :)"
|
|
|
|
echo
|