Skip to content

Commit

Permalink
update local_docker_stack script
Browse files Browse the repository at this point in the history
Signed-off-by: Anastas Dancha <[email protected]>
  • Loading branch information
anapsix committed Jan 30, 2021
1 parent 1537315 commit be99da4
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions test/bin/local_docker_stack
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

# zabbixapi
#
# Use to deploy local zabbix stack for testing

base_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

stack_deploy_output=$(docker stack deploy --compose-file ${base_dir}/../docker_compose/test_docker_stack.yml zabbix)
echo ${stack_deploy_output} | grep 'this node is not a swarm manager' /dev/null
rc=$?

if [[ ${rc} == 0 ]] ; then
docker swarm init
docker stack deploy --compose-file ${base_dir}/../docker_compose/test_docker_stack.yml zabbix
fi

echo 'Use the following to obtain information about the stack'
echo '## Use the following commands to bring up a fully provisioned'
echo '## Zabbix Server & Zabbix Frontend, backed by PostgreSQL'
echo
echo 'docker-compose -p zabbixapi -f test/docker_compose/test_docker_stack.yml up -d'
echo 'docker-compose -p zabbixapi -f test/docker_compose/test_docker_stack.yml down'
echo 'docker network inspect zabbixapi_zabbix'
echo 'docker container ls | grep zabbixapi_'
echo 'docker logs ${container_name}'
echo
echo 'export ZABBIX_HOST_URL="http://localhost:8080/api_jsonrpc.php"'
echo 'bundle exec rspec spec/*'
echo
echo 'open browser: http://localhost:8080'
echo ' Username: Admin'
echo ' Password: zabbix'

0 comments on commit be99da4

Please sign in to comment.