Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

add toolchain build/push and install scripts #63

Merged
merged 5 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions hack/demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@

set -e -o pipefail

# parse input
export QUAY_NAMESPACE=${QUAY_NAMESPACE:-workspaces}

CURRENT_DIR="$(readlink -f "$0")"
SCRIPT_DIR="$(dirname "${CURRENT_DIR}")"

( "${SCRIPT_DIR}/install_toolchain.sh" )
( "${SCRIPT_DIR}/install_workspaces.sh" && make -C e2e test )
SUFFIX="e2e$(date +'%d%H%M%S')"
echo "using suffix: ${SUFFIX}"

# build and install toolchain
( "${SCRIPT_DIR}/toolchain_build_push.sh" "${SUFFIX}" )
( "${SCRIPT_DIR}/toolchain_install.sh" "${SUFFIX}" )

# build and install workspaces
( "${SCRIPT_DIR}/workspaces_install.sh" && make -C e2e test )
26 changes: 0 additions & 26 deletions hack/install_toolchain.sh

This file was deleted.

31 changes: 31 additions & 0 deletions hack/toolchain_build_push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

set -e

# parse input
BRANCH=${BRANCH:-pubviewer-mvp}
BUILDER=${BUILDER:-docker}
TAG=${1:-e2etest}

export QUAY_NAMESPACE=${QUAY_NAMESPACE:-konflux-workspaces}

# create a temporary direction
f=$(mktemp --directory /tmp/toolchain.XXXX)
cd "${f}"

# checkout
git clone --depth 2 https://github.com/codeready-toolchain/member-operator.git
git clone --depth 2 --branch "${BRANCH}" https://github.com/filariow/host-operator.git
git clone --depth 1 --branch "${BRANCH}" https://github.com/filariow/toolchain-common.git
git clone --depth 1 --branch "${BRANCH}" https://github.com/filariow/toolchain-api.git api
git clone --depth 1 --branch "${BRANCH}" https://github.com/filariow/registration-service
git clone --depth 1 --branch "${BRANCH}" https://github.com/filariow/toolchain-e2e

# build and publish images
make -C member-operator run-cicd-script \
SCRIPT_PATH=scripts/ci/manage-member-operator.sh \
SCRIPT_PARAMS="-po true -io false -mn toolchain-member-operator -qn ${QUAY_NAMESPACE} -ds ${TAG} -dl false -mr ./"

make -C host-operator run-cicd-script \
SCRIPT_PATH=scripts/ci/manage-host-operator.sh \
SCRIPT_PARAMS="-po true -io false -hn toolchain-host-operator -qn ${QUAY_NAMESPACE} -ds ${TAG} -dl false -hr ./ -rr ../registration-service"
45 changes: 45 additions & 0 deletions hack/toolchain_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

set -e
sadlerap marked this conversation as resolved.
Show resolved Hide resolved

# parse input
BRANCH=${BRANCH:-pubviewer-mvp}
export QUAY_NAMESPACE=${QUAY_NAMESPACE:-workspaces}
TAG=${1:-e2etest}
KUBECLI=${KUBECLI:-kubectl}

# create a temporary direction
f=$(mktemp --directory /tmp/toolchain.XXXX)
cd "${f}"

# checkout
git clone --depth 2 https://github.com/codeready-toolchain/member-operator.git
git clone --depth 2 --branch "${BRANCH}" https://github.com/filariow/toolchain-e2e.git
git clone --depth 2 --branch "${BRANCH}" https://github.com/filariow/host-operator.git
git clone --depth 2 --branch "${BRANCH}" https://github.com/filariow/toolchain-common.git
git clone --depth 2 --branch "${BRANCH}" https://github.com/filariow/toolchain-api.git api
git clone --depth 2 --branch "${BRANCH}" https://github.com/filariow/registration-service

# deploy
(
set -e -o pipefail

${KUBECLI} create namespace toolchain-host-operator --dry-run=client --output=yaml | \
${KUBECLI} apply -f -
${KUBECLI} create namespace toolchain-member-operator --dry-run=client --output=yaml | \
${KUBECLI} apply -f -

cd "${f}/toolchain-e2e"

make dev-deploy-e2e-local PUBLISH_OPERATOR=false DATE_SUFFIX="${TAG}" DEPLOY_LATEST=false
)

# patch configuration
${KUBECLI} patch \
toolchainconfigs.toolchain.dev.openshift.com config \
-n toolchain-host-operator \
--patch='{"spec":{"global":{"publicViewer":{"enabled":true,"username":"public-viewer"}}}}' \
--type=merge

# restart operator
${KUBECLI} delete pods --all -n toolchain-host-operator
File renamed without changes.