-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial start on rewrite of Andy's script
Signed-off-by: Jared Hocutt <jhocutt@redhat.com>
- Loading branch information
1 parent
d725a5b
commit 2265c12
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eux -o pipefail | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
CLIENTS_DIR=${SCRIPT_DIR}/clients | ||
IMAGES_DIR=${SCRIPT_DIR}/images | ||
BIN_DIR=${SCRIPT_DIR}/bin | ||
REGISTRY_DIR=${SCRIPT_DIR}/registry | ||
|
||
REGISTRY_PASSWORD=$(< /dev/urandom tr -dc A-Za-z0-9 | head -c 30) | ||
|
||
############################################################################### | ||
# User Data Prompts | ||
############################################################################### | ||
|
||
|
||
|
||
############################################################################### | ||
# Mirror Registry - Unpack and Install | ||
############################################################################### | ||
|
||
mkdir -p ${BIN_DIR} | ||
if [[ -f ${BIN_DIR}/mirror-registry ]]; then | ||
echo "Mirror registry has already been extracted, skipping" | ||
else | ||
tar --extract --verbose --directory ${BIN_DIR} --file ${CLIENTS_DIR}/mirror-registry.tar.gz | ||
fi | ||
|
||
mkdir -p ${REGISTRY_DIR} | ||
if $(curl --insecure --silent https://$(hostname --fqdn):8443/status); then | ||
echo "Mirror registry appears to already be running, skipping install" | ||
else | ||
${BIN_DIR}/mirror-registry install \ | ||
--quayHostname $(hostname --fqdn) \ | ||
--quayRoot ${REGISTRY_DIR}/quay-install \ | ||
--quayStorage ${REGISTRY_DIR}/quay-storage \ | ||
--pgStorage ${REGISTRY_DIR}/pg-data \ | ||
--initUser openshift \ | ||
--initPassword ${REGISTRY_PASSWORD} | ||
fi |