Skip to content

Commit

Permalink
Merge pull request #382 from flacatus/nightly_minishift
Browse files Browse the repository at this point in the history
Create Eclipse Che nightly deployment in minishift
  • Loading branch information
flacatus committed Aug 4, 2020
2 parents 9ed6e37 + 3f7e8d6 commit 5c06925
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions .ci/cico_minishift_nightly.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/bin/bash
#
# Copyright (c) 2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation

set -ex

init() {
export SCRIPT=$(readlink -f "$0")
export SCRIPT_DIR=$(dirname "$SCRIPT")
export RAM_MEMORY=8192
export NAMESPACE="che"
export PLATFORM="openshift"

if [[ ${WORKSPACE} ]] && [[ -d ${WORKSPACE} ]]; then
OPERATOR_REPO=${WORKSPACE};
else
OPERATOR_REPO=$(dirname "$SCRIPT_DIR");
fi

}

installDependencies() {
install_VirtPackages
installStartDocker
start_libvirt
setup_kvm_machine_driver
minishift_installation
installChectl
load_jenkins_vars
}

self_signed_minishift() {
export DOMAIN=*.$(minishift ip).nip.io

source ${OPERATOR_REPO}/.ci/util/che-cert-generation.sh

#Configure Router with generated certificate:
oc login -u system:admin --insecure-skip-tls-verify=true
oc project default
oc delete secret router-certs

cat domain.crt domain.key > minishift.crt
oc create secret tls router-certs --key=domain.key --cert=minishift.crt
oc rollout latest router

oc create namespace che

cp rootCA.crt ca.crt
oc create secret generic self-signed-certificate --from-file=ca.crt -n=che
}

run() {
cat >/tmp/che-cr-patch.yaml <<EOL
spec:
auth:
updateAdminPassword: false
EOL

self_signed_minishift

echo "======= Che cr patch ======="
cat /tmp/che-cr-patch.yaml
chectl server:start --platform=minishift --skip-kubernetes-health-check --installer=operator --chenamespace=${NAMESPACE} --che-operator-cr-patch-yaml=/tmp/che-cr-patch.yaml

# Create and start a workspace
getCheAcessToken # Function from ./util/ci_common.sh
chectl workspace:create --start --devfile=$OPERATOR_REPO/.ci/util/devfile-test.yaml

# Wait for workspace to be up
waitWorkspaceStart # Function from ./util/ci_common.sh
oc get events -n ${NAMESPACE}
}

init
source "${OPERATOR_REPO}"/.ci/util/ci_common.sh
run

0 comments on commit 5c06925

Please sign in to comment.