summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-10-15 14:51:13 +0000
committerGerrit Code Review <review@openstack.org>2018-10-15 14:51:13 +0000
commit62267041dc5bfb4a06230c738f39d47625db0a98 (patch)
tree3224af24a73938f5e24e514c841a407b82d78e13
parent00d35c441dec5a34788ef2a06d79f0e9d7f51551 (diff)
parenta3a17920f715a8c68cfaae41c798e72dbff476d9 (diff)
Merge "Add wrapper utilities for post-genesis"
-rwxr-xr-xtools/multi_nodes_gate/airship_gate/bin/drydock.sh25
-rwxr-xr-xtools/multi_nodes_gate/airship_gate/bin/shipyard.sh25
-rw-r--r--tools/multi_nodes_gate/airship_gate/lib/airship.sh29
-rw-r--r--tools/multi_nodes_gate/airship_gate/lib/config.sh1
4 files changed, 77 insertions, 3 deletions
diff --git a/tools/multi_nodes_gate/airship_gate/bin/drydock.sh b/tools/multi_nodes_gate/airship_gate/bin/drydock.sh
new file mode 100755
index 0000000..273d7ef
--- /dev/null
+++ b/tools/multi_nodes_gate/airship_gate/bin/drydock.sh
@@ -0,0 +1,25 @@
1
2#!/usr/bin/env bash
3# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17set -e
18
19SCRIPT_DIR=$(realpath $(dirname $0))
20WORKSPACE=$(realpath ${SCRIPT_DIR}/../../..)
21GATE_UTILS=${WORKSPACE}/multi_nodes_gate/airship_gate/lib/all.sh
22
23source ${GATE_UTILS}
24
25drydock_cmd $@
diff --git a/tools/multi_nodes_gate/airship_gate/bin/shipyard.sh b/tools/multi_nodes_gate/airship_gate/bin/shipyard.sh
new file mode 100755
index 0000000..63e8917
--- /dev/null
+++ b/tools/multi_nodes_gate/airship_gate/bin/shipyard.sh
@@ -0,0 +1,25 @@
1
2#!/usr/bin/env bash
3# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17set -e
18
19SCRIPT_DIR=$(realpath $(dirname $0))
20WORKSPACE=$(realpath ${SCRIPT_DIR}/../../..)
21GATE_UTILS=${WORKSPACE}/multi_nodes_gate/airship_gate/lib/all.sh
22
23source ${GATE_UTILS}
24
25shipyard_cmd $@
diff --git a/tools/multi_nodes_gate/airship_gate/lib/airship.sh b/tools/multi_nodes_gate/airship_gate/lib/airship.sh
index e4ee1d3..9ed44ce 100644
--- a/tools/multi_nodes_gate/airship_gate/lib/airship.sh
+++ b/tools/multi_nodes_gate/airship_gate/lib/airship.sh
@@ -1,9 +1,32 @@
1#!/bin/bash 1#!/bin/bash
2 2
3shipard_cmd_stdout() {
4 ssh_cmd "${GENESIS_NAME}" docker run -t --network host -v "${GENESIS_WORK_DIR}:/work" -e OS_AUTH_URL=http://keystone.ucp.svc.cluster.local:80/v3 -e OS_USERNAME=shipyard -e OS_USER_DOMAIN_NAME=default -e OS_PASSWORD="${SHIPYARD_PASSWORD}" -e OS_PROJECT_DOMAIN_NAME=default -e OS_PROJECT_NAME=service --entrypoint /usr/local/bin/shipyard "${IMAGE_SHIPYARD_CLI}" $* 2>&1
5}
6
3shipyard_cmd() { 7shipyard_cmd() {
4 set -o pipefail 8 if [[ ! -z "${LOG_FILE}" ]]
5 ssh_cmd "${GENESIS_NAME}" docker run -t --network host -v "${GENESIS_WORK_DIR}:/work" -e OS_AUTH_URL=http://keystone.ucp.svc.cluster.local:80/v3 -e OS_USERNAME=shipyard -e OS_USER_DOMAIN_NAME=default -e OS_PASSWORD="${SHIPYARD_PASSWORD}" -e OS_PROJECT_DOMAIN_NAME=default -e OS_PROJECT_NAME=service "${IMAGE_SHIPYARD_CLI}" $* 2>&1 | tee -a "${LOG_FILE}" 9 then
6 set +o pipefail 10 set -o pipefail
11 shipard_cmd_stdout $* | tee -a "${LOG_FILE}"
12 set +o pipefail
13 else
14 shipard_cmd_stdout $*
15 fi
16}
17
18drydock_cmd_stdout() {
19 ssh_cmd "${GENESIS_NAME}" docker run -t --network host -v "${GENESIS_WORK_DIR}:/work" -e DD_URL=http://drydock-api.ucp.svc.cluster.local:9000 -e OS_AUTH_URL=http://keystone.ucp.svc.cluster.local:80/v3 -e OS_USERNAME=shipyard -e OS_USER_DOMAIN_NAME=default -e OS_PASSWORD="${SHIPYARD_PASSWORD}" -e OS_PROJECT_DOMAIN_NAME=default -e OS_PROJECT_NAME=service --entrypoint /usr/local/bin/drydock "${IMAGE_DRYDOCK_CLI}" $* 2>&1
20}
21drydock_cmd() {
22 if [[ ! -z "${LOG_FILE}" ]]
23 then
24 set -o pipefail
25 drydock_cmd_stdout $* | tee -a "${LOG_FILE}"
26 set +o pipefail
27 else
28 drydock_cmd_stdout $*
29 fi
7} 30}
8 31
9# Create a shipyard action 32# Create a shipyard action
diff --git a/tools/multi_nodes_gate/airship_gate/lib/config.sh b/tools/multi_nodes_gate/airship_gate/lib/config.sh
index ed301c0..ec165b1 100644
--- a/tools/multi_nodes_gate/airship_gate/lib/config.sh
+++ b/tools/multi_nodes_gate/airship_gate/lib/config.sh
@@ -10,6 +10,7 @@ export IMAGE_PROMENADE_CLI=${IMAGE_PROMENADE_CLI:-quay.io/airshipit/promenade:ma
10export IMAGE_PEGLEG_CLI=${IMAGE_PEGLEG_CLI:-quay.io/airshipit/pegleg:ac6297eae6c51ab2f13a96978abaaa10cb46e3d6} 10export IMAGE_PEGLEG_CLI=${IMAGE_PEGLEG_CLI:-quay.io/airshipit/pegleg:ac6297eae6c51ab2f13a96978abaaa10cb46e3d6}
11export IMAGE_SHIPYARD_CLI=${IMAGE_SHIPYARD_CLI:-quay.io/airshipit/shipyard:master} 11export IMAGE_SHIPYARD_CLI=${IMAGE_SHIPYARD_CLI:-quay.io/airshipit/shipyard:master}
12export IMAGE_COREDNS=${IMAGE_COREDNS:-docker.io/coredns/coredns:1.2.2} 12export IMAGE_COREDNS=${IMAGE_COREDNS:-docker.io/coredns/coredns:1.2.2}
13export IMAGE_DRYDOCK_CLI=${IMAGE_DRYDOCK_CLI:-quay.io/airshipit/drydock:master}
13export PROMENADE_DEBUG=${PROMENADE_DEBUG:-0} 14export PROMENADE_DEBUG=${PROMENADE_DEBUG:-0}
14export SHIPYARD_PASSWORD=${SHIPYARD_OS_PASSWORD:-password18} 15export SHIPYARD_PASSWORD=${SHIPYARD_OS_PASSWORD:-password18}
15export REGISTRY_DATA_DIR=${REGISTRY_DATA_DIR:-/mnt/registry} 16export REGISTRY_DATA_DIR=${REGISTRY_DATA_DIR:-/mnt/registry}