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

Commit

Permalink
add toolchain build/push and install scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Ilario <filario@redhat.com>
  • Loading branch information
filariow committed Apr 9, 2024
1 parent d3d7a25 commit 7193d08
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 28 deletions.
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"
42 changes: 42 additions & 0 deletions hack/toolchain_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

set -e

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

# 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
(
kubectl create namespace toolchain-host-operator --dry-run=client --output=yaml | \
kubectl apply -f -
kubectl create namespace toolchain-member-operator --dry-run=client --output=yaml | \
kubectl apply -f -

cd "$f/toolchain-e2e"

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

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

# restart operator
oc delete pods --all -n toolchain-host-operator
File renamed without changes.

0 comments on commit 7193d08

Please sign in to comment.