Browse Source

Merge "Add wrapper utilities for post-genesis"

Zuul 6 months ago
parent
commit
62267041dc

+ 25
- 0
tools/multi_nodes_gate/airship_gate/bin/drydock.sh View File

@@ -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
+
17
+set -e
18
+
19
+SCRIPT_DIR=$(realpath $(dirname $0))
20
+WORKSPACE=$(realpath ${SCRIPT_DIR}/../../..)
21
+GATE_UTILS=${WORKSPACE}/multi_nodes_gate/airship_gate/lib/all.sh
22
+
23
+source ${GATE_UTILS}
24
+
25
+drydock_cmd $@

+ 25
- 0
tools/multi_nodes_gate/airship_gate/bin/shipyard.sh View File

@@ -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
+
17
+set -e
18
+
19
+SCRIPT_DIR=$(realpath $(dirname $0))
20
+WORKSPACE=$(realpath ${SCRIPT_DIR}/../../..)
21
+GATE_UTILS=${WORKSPACE}/multi_nodes_gate/airship_gate/lib/all.sh
22
+
23
+source ${GATE_UTILS}
24
+
25
+shipyard_cmd $@

+ 26
- 3
tools/multi_nodes_gate/airship_gate/lib/airship.sh View File

@@ -1,9 +1,32 @@
1 1
 #!/bin/bash
2 2
 
3
+shipard_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
+
3 7
 shipyard_cmd() {
4
-  set -o pipefail
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}"
6
-  set +o pipefail
8
+  if [[ ! -z "${LOG_FILE}" ]]
9
+  then
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
+
18
+drydock_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
+}
21
+drydock_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 32
 # Create a shipyard action

+ 1
- 0
tools/multi_nodes_gate/airship_gate/lib/config.sh View File

@@ -10,6 +10,7 @@ export IMAGE_PROMENADE_CLI=${IMAGE_PROMENADE_CLI:-quay.io/airshipit/promenade:ma
10 10
 export IMAGE_PEGLEG_CLI=${IMAGE_PEGLEG_CLI:-quay.io/airshipit/pegleg:ac6297eae6c51ab2f13a96978abaaa10cb46e3d6}
11 11
 export IMAGE_SHIPYARD_CLI=${IMAGE_SHIPYARD_CLI:-quay.io/airshipit/shipyard:master}
12 12
 export IMAGE_COREDNS=${IMAGE_COREDNS:-docker.io/coredns/coredns:1.2.2}
13
+export IMAGE_DRYDOCK_CLI=${IMAGE_DRYDOCK_CLI:-quay.io/airshipit/drydock:master}
13 14
 export PROMENADE_DEBUG=${PROMENADE_DEBUG:-0}
14 15
 export SHIPYARD_PASSWORD=${SHIPYARD_OS_PASSWORD:-password18}
15 16
 export REGISTRY_DATA_DIR=${REGISTRY_DATA_DIR:-/mnt/registry}

Loading…
Cancel
Save