diff --git a/build_deploy.sh b/build_deploy.sh new file mode 100755 index 000000000..75fcd3548 --- /dev/null +++ b/build_deploy.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# -------------------------------------------- +# Export vars for helper scripts to use +# -------------------------------------------- +# name of app-sre "application" folder this component lives in; needs to match for quay +export COMPONENT="rhsm" +export APP_NAME=`node -e 'console.log(require("./package.json").insights.appname)'` +export APP_ROOT=$(pwd) +export NODE_BUILD_VERSION=`node -e 'console.log(require("./package.json").engines.node.match(/(\d+)\.\d+\.\d+/)[1])'` +COMMON_BUILDER=https://raw.githubusercontent.com/RedHatInsights/insights-frontend-builder-common/master + +# -------------------------------------------- +# Options that must be configured by app owner +# -------------------------------------------- +IQE_PLUGINS="curiosity" +IQE_MARKER_EXPRESSION="smoke" +IQE_FILTER_EXPRESSION="" + +set -exv +# 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/package.json b/package.json index f76a3f4e2..6d583f48e 100644 --- a/package.json +++ b/package.json @@ -54,10 +54,12 @@ "api:docs": "node ./scripts/openapi.docs.js", "api:proxy-hosts": "bash ./scripts/proxy.api.sh", "build": "run-s -l build:pre build:js build:post test:integration", + "build:ephemeral": "run-s -l build:pre build:js build:post test:integration-ephemeral", "build:js": "export NODE_ENV=production; webpack --config config/webpack.prod.config.js", "build:post": "bash ./scripts/post.sh", "build:pre": "bash ./scripts/pre.sh", "build:deps": "bash ./scripts/dependencies.sh --doctor -u --doctorInstall \"yarn\" --doctorTest \"yarn test:deps\" --reject \"@patternfly/*, @redhat-cloud-services/frontend*, victory*\"", + "build:prod": "run-s build:ephemeral", "dev:chrome": "bash ./scripts/dev.chrome.sh -b prod-stable", "release": "standard-version", "start": "run-p -l api:dev start:js", @@ -66,15 +68,19 @@ "start:proxy": "run-s -l api:proxy-hosts start:js-proxy", "test": "export NODE_ENV=test; run-s test:spell* test:lint test:ci", "test:ci": "export CI=true; jest ./src --coverage", + "test:ci-ephemeral": "export CI=true; TZ=UTC jest ./src --coverage --no-cache", + "test:ephemeral": "export NODE_ENV=test; run-s test:spell* test:lint test:ci-ephemeral", "test:clearCache": "jest --clearCache", "test:dev": "export NODE_ENV=test; run-s test:spell test:lint test:local", "test:deps": "run-s test build", "test:integration": "jest ./tests", + "test:integration-ephemeral": "TZ=UTC jest ./tests --no-cache", "test:integration-dev": "jest --roots=./tests --watch", "test:lint": "eslint --ext=json --ext=js --ext=jsx src", "test:spell-support": "cspell ./README.md ./config/README.md ./CONTRIBUTING.md --config ./config/cspell.config.json", "test:spell": "cspell './public/locales/**/en*json' './src/**/*.js' --config ./config/cspell.config.json", - "test:local": "jest --roots=./src --watch" + "test:local": "jest --roots=./src --watch", + "verify": "run-s test:ephemeral build:ephemeral" }, "dependencies": { "@joi/date": "^2.1.0", diff --git a/pr_check.sh b/pr_check.sh new file mode 100755 index 000000000..b47104046 --- /dev/null +++ b/pr_check.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# -------------------------------------------- +# Export vars for helper scripts to use +# -------------------------------------------- +# name of app-sre "application" folder this component lives in; needs to match for quay +export COMPONENT="rhsm" +export WORKSPACE=${WORKSPACE:-$APP_ROOT} # if running in jenkins, use the build's workspace +export APP_ROOT=$(pwd) +export NODE_BUILD_VERSION=`node -e 'console.log(require("./package.json").engines.node.match(/(\d+)\.\d+\.\d+/)[1])'` +COMMON_BUILDER=https://raw.githubusercontent.com/RedHatInsights/insights-frontend-builder-common/master + +# -------------------------------------------- +# Options that must be configured by app owner +# -------------------------------------------- +IQE_PLUGINS="curiosity" +IQE_MARKER_EXPRESSION="smoke" +IQE_FILTER_EXPRESSION="" + +set -exv +# 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