From d4dfcdc502e3506358bba852e57b19705b643906 Mon Sep 17 00:00:00 2001 From: Brandon Squizzato Date: Fri, 29 Apr 2022 14:51:17 -0400 Subject: [PATCH] Add fe operator build/deploy configs --- build_deploy.sh | 29 +++++++++++++++++++++++++++++ frontend.yml | 27 +++++++++++++++++++++++++++ pr_check.sh | 28 ++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100755 build_deploy.sh create mode 100644 frontend.yml create mode 100755 pr_check.sh diff --git a/build_deploy.sh b/build_deploy.sh new file mode 100755 index 0000000000..e574e5fc50 --- /dev/null +++ b/build_deploy.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# name of app-sre "application" folder this component lives in; needs to match for quay +export COMPONENT="insights-dashboard-frontend" +export IMAGE="quay.io/cloudservices/$COMPONENT" +export WORKSPACE=${WORKSPACE:-$APP_ROOT} # if running in jenkins, use the build's workspace +export APP_ROOT=$(pwd) +cat /etc/redhat-release +COMMON_BUILDER=https://raw.githubusercontent.com/RedHatInsights/insights-frontend-builder-common/master + +# --------------------------- +# Build and Publish to Quay +# --------------------------- + +set -ex +# source is preferred to | bash -s in this case to avoid a subshell +source <(curl -sSL $COMMON_BUILDER/src/frontend-build.sh) +BUILD_RESULTS=$? + +# Stubbed out for now +mkdir -p $WORKSPACE/artifacts +cat << EOF > $WORKSPACE/artifacts/junit-dummy.xml + + + +EOF + +# teardown docker +exit $BUILD_RESULTS diff --git a/frontend.yml b/frontend.yml new file mode 100644 index 0000000000..29d3c3ca77 --- /dev/null +++ b/frontend.yml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Template +metadata: + name: insights-dashboard +objects: + - apiVersion: cloud.redhat.com/v1alpha1 + kind: Frontend + metadata: + name: chrome + spec: + envName: ${ENV_NAME} + deploymentRepo: https://github.com/RedHatInsights/insights-dashboard + title: Dashboard + image: ${IMAGE}:${IMAGE_TAG} + API: + versions: + - v1 + frontend: + paths: + - /insights/dashboard +parameters: + - name: ENV_NAME + required: true + - name: IMAGE_TAG + required: true + - name: IMAGE + value: quay.io/cloudservices/insights-dashboard-frontend diff --git a/pr_check.sh b/pr_check.sh new file mode 100755 index 0000000000..63613d5393 --- /dev/null +++ b/pr_check.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +export COMPONENT="insights-dashboard-frontend" +export IMAGE="quay.io/cloudservices/$COMPONENT" +export WORKSPACE=${WORKSPACE:-$APP_ROOT} # if running in jenkins, use the build's workspace +export APP_ROOT=$(pwd) +cat /etc/redhat-release +COMMON_BUILDER=https://raw.githubusercontent.com/RedHatInsights/insights-frontend-builder-common/master + +# --------------------------- +# Build and Publish to Quay +# --------------------------- + +set -ex +# source is preferred to | bash -s in this case to avoid a subshell +source <(curl -sSL $COMMON_BUILDER/src/frontend-build.sh) +BUILD_RESULTS=$? + +# Stubbed out for now +mkdir -p $WORKSPACE/artifacts +cat << EOF > $WORKSPACE/artifacts/junit-dummy.xml + + + +EOF + +# teardown docker +exit $BUILD_RESULTS