Add new env variable for package name
This commit is contained in:
parent
bc6273b6ed
commit
fb4ec80688
|
@ -39,6 +39,7 @@ env:
|
||||||
DISTRIBUTION=debian
|
DISTRIBUTION=debian
|
||||||
DIST_VERSION=9-builded
|
DIST_VERSION=9-builded
|
||||||
MONGODB_VERSION=3.2
|
MONGODB_VERSION=3.2
|
||||||
|
MONOGDB_PACKAGE=mongodb
|
||||||
- >
|
- >
|
||||||
DISTRIBUTION=debian
|
DISTRIBUTION=debian
|
||||||
DIST_VERSION=8-builded
|
DIST_VERSION=8-builded
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
image_name: "ubuntu-upstart:14.04"
|
image_name: "ubuntu-upstart:14.04"
|
||||||
|
mongodb_package: mongodb-org
|
||||||
mongodb_version: "3.6"
|
mongodb_version: "3.6"
|
||||||
mongodb_storage_dbpath: /var/lib/mongodb
|
mongodb_storage_dbpath: /var/lib/mongodb
|
||||||
mongodb_net_bindip: 0.0.0.0
|
mongodb_net_bindip: 0.0.0.0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- mode: sh; -*-
|
# -*- mode: sh; -*-
|
||||||
|
|
||||||
# File: test.sh
|
# File: test.sh
|
||||||
# Time-stamp: <2018-02-26 16:04:24>
|
# Time-stamp: <2018-07-13 11:05:31>
|
||||||
# Copyright (C) 2018 Sergei Antipov
|
# Copyright (C) 2018 Sergei Antipov
|
||||||
# Description:
|
# Description:
|
||||||
|
|
||||||
|
@ -10,40 +10,41 @@
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
|
||||||
|
package=${MONGODB_PACKAGE:-mongodb-org}
|
||||||
# Test 1
|
# Test 1
|
||||||
echo "ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_version=${MONGODB_VERSION} -e image_name=${DISTRIBUTION}:${DIST_VERSION}"
|
echo "ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_package=${package} -e mongodb_version=${MONGODB_VERSION} -e image_name=${DISTRIBUTION}:${DIST_VERSION}"
|
||||||
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_version=${MONGODB_VERSION} -e image_name=${DISTRIBUTION}:${DIST_VERSION}
|
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_package=${package} -e mongodb_version=${MONGODB_VERSION} -e image_name=${DISTRIBUTION}:${DIST_VERSION}
|
||||||
# Idempotence test
|
# Idempotence test
|
||||||
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_version=${MONGODB_VERSION} -e image_name=${DISTRIBUTION}:${DIST_VERSION} | \
|
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_package=${package} -e mongodb_version=${MONGODB_VERSION} -e image_name=${DISTRIBUTION}:${DIST_VERSION} | \
|
||||||
grep -q 'changed=0.*failed=0' && \
|
grep -q 'changed=0.*failed=0' && \
|
||||||
(echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
|
(echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
|
||||||
# Delete all containers
|
# Delete all containers
|
||||||
docker kill mongo{1,2,3} && docker rm mongo{1,2,3}
|
docker kill mongo{1,2,3} && docker rm mongo{1,2,3}
|
||||||
|
|
||||||
# Test 2
|
# Test 2
|
||||||
echo "ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'"
|
echo "ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_package=${package} -e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'"
|
||||||
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'
|
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_package=${package} -e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'
|
||||||
# Idempotence test
|
# Idempotence test
|
||||||
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled' \
|
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_package=${package} -e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled' \
|
||||||
| grep -q 'changed=0.*failed=0' \
|
| grep -q 'changed=0.*failed=0' \
|
||||||
&& (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
|
&& (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
|
||||||
# Delete all containers
|
# Delete all containers
|
||||||
docker kill mongo{1,2,3} && docker rm mongo{1,2,3}
|
docker kill mongo{1,2,3} && docker rm mongo{1,2,3}
|
||||||
|
|
||||||
# Test 3
|
# Test 3
|
||||||
echo "ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'"
|
echo "ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_package=${package} -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'"
|
||||||
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
|
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_package=${package} -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
|
||||||
# Idempotence test
|
# Idempotence test
|
||||||
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs' \
|
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_package=${package} -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs' \
|
||||||
| grep -q 'changed=0.*failed=0' \
|
| grep -q 'changed=0.*failed=0' \
|
||||||
&& (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
|
&& (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
|
||||||
# Delete all containers
|
# Delete all containers
|
||||||
docker kill mongo{1,2,3} && docker rm mongo{1,2,3}
|
docker kill mongo{1,2,3} && docker rm mongo{1,2,3}
|
||||||
|
|
||||||
# Test 4
|
# Test 4
|
||||||
echo "ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs' -e mongodb_security_authorization='enabled'"
|
echo "ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_package=${package} -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs' -e mongodb_security_authorization='enabled'"
|
||||||
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs' -e mongodb_security_authorization='enabled'
|
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_package=${package} -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs' -e mongodb_security_authorization='enabled'
|
||||||
# Idempotence test
|
# Idempotence test
|
||||||
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs' -e mongodb_security_authorization='enabled' \
|
ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION} -e mongodb_package=${package} -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs' -e mongodb_security_authorization='enabled' \
|
||||||
| grep -q 'changed=0.*failed=0' \
|
| grep -q 'changed=0.*failed=0' \
|
||||||
&& (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
|
&& (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
|
||||||
|
|
Loading…
Reference in New Issue