Add suggestions

Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
pull/812/head
Flavius Lacatusu 2021-05-13 11:35:36 +02:00
parent c556dcf1af
commit 0fe011865d
No known key found for this signature in database
GPG Key ID: 3C0A7685C14681A8
2 changed files with 18 additions and 25 deletions

View File

@ -29,7 +29,7 @@ export REG_CREDS=${XDG_RUNTIME_DIR}/containers/auth.json
export ORGANIZATION="eclipse"
export TAG_NIGHTLY="nightly"
#Stop execution on any error
# catch and stop execution on any error
trap "catchDisconnectedJenkinsFinish" EXIT SIGINT
# Catch an error after existing from jenkins Workspace
@ -85,7 +85,7 @@ fi
# Login to internal registry using podman
podman login -u "${INTERNAL_REG_USERNAME}" -p "${INTERNAL_REG_PASS}" --tls-verify=false ${INTERNAL_REGISTRY_URL} --authfile=${REG_CREDS}
# Build che-machine-exec,che-plugin-registry and che-devfile-registry from Github Sources
# Build che-plugin-registry and che-devfile-registry from Github Sources
# Che-Devfile-Registry Build
git clone git@github.com:eclipse/che-devfile-registry.git
cd che-devfile-registry
@ -100,7 +100,8 @@ cd .. && rm -rf che-devfile-registry
git clone git@github.com:eclipse-che/che-plugin-registry.git
cd che-plugin-registry
export SKIP_TEST=true && ./build.sh --organization "${ORGANIZATION}" \
export SKIP_TEST=true
./build.sh --organization "${ORGANIZATION}" \
--registry "${INTERNAL_REGISTRY_URL}" \
--tag "${TAG_NIGHTLY}" \
--offline \
@ -108,18 +109,11 @@ export SKIP_TEST=true && ./build.sh --organization "${ORGANIZATION}" \
cd .. && rm -rf che-plugin-registry
# Build Che-Machine-Exec
git clone git@github.com:eclipse-che/che-machine-exec.git
cd che-machine-exec
podman build -f build/dockerfiles/Dockerfile -t "${INTERNAL_REGISTRY_URL}"/"${ORGANIZATION}"/che-machine-exec:"${TAG_NIGHTLY}" .
cd .. && rm -rf che-machine-exec
# Push che-machine-exec, devfile and plugins image to private registry
# Push devfile and plugins image to private registry
podman push --authfile="${REG_CREDS}" --tls-verify=false "${INTERNAL_REGISTRY_URL}"/"${ORGANIZATION}"/che-devfile-registry:"${TAG_NIGHTLY}"
podman push --authfile="${REG_CREDS}" --tls-verify=false "${INTERNAL_REGISTRY_URL}"/"${ORGANIZATION}"/che-plugin-registry:"${TAG_NIGHTLY}"
podman push --authfile="${REG_CREDS}" --tls-verify=false "${INTERNAL_REGISTRY_URL}"/"${ORGANIZATION}"/che-machine-exec:"${TAG_NIGHTLY}"
# Get all containers images used in eclipse-che deployment(postgresql, che-server-che-broket...)
# Get all containers images used in eclipse-che deployment(postgresql, che-server, che-dashboard, keycloak...)
curl -sSLo- https://raw.githubusercontent.com/eclipse-che/che-operator/main/deploy/operator.yaml > /tmp/yam.yaml
export ARRAY_OF_IMAGES=$(cat /tmp/yam.yaml | yq '.spec.template.spec.containers[0].env[] | select(.name|test("RELATED_")) | .value' -r)
@ -148,15 +142,13 @@ done
# Copy Che Operator into private registry
sudo skopeo copy --authfile=${REG_CREDS} --dest-tls-verify=false docker://quay.io/eclipse/che-operator:nightly docker://${INTERNAL_REGISTRY_URL}/eclipse/che-operator:nightly
# OBTAIN PLUGINS
# Filter all necessary plugins need it to start a workspace in disconnected en
IFS=$'\r\n' GLOBIGNORE='*' command eval 'PLUGINS_IMAGES=($(podman run --authfile=${XDG_RUNTIME_DIR}/containers/auth.json -it --rm \
--entrypoint cat ${INTERNAL_REGISTRY_URL}/eclipse/che-plugin-registry:nightly /var/www/html/v3/external_images.txt))'
for container in "${PLUGINS_IMAGES[@]}"
for container in "${PLUGINS_IMAGES[@]}";
do
:
if [[ $container != *"che-plugin-sidecar"* ]] &&
[[ $container != *"che-editor"* ]] && \
[[ $container != *"che-machine-exec"* ]] && \
[[ $container != *"codercom"* ]] && \
[[ $container != "docker.io"* ]]; then
REGISTRY_IMG_NAME=$(echo $container | sed -e "s/quay.io/"${INTERNAL_REGISTRY_URL}"/g")
@ -164,19 +156,17 @@ do
fi
done
# Obtain SIDECAR_IMAGE
# Obtain workspace golang SIDECAR_IMAGE and copy to internal registry
podman run --authfile=${XDG_RUNTIME_DIR}/containers/auth.json -it --rm \
--entrypoint cat "${INTERNAL_REGISTRY_URL}"/eclipse/che-plugin-registry:nightly /var/www/html/v3/plugins/golang/go/latest/meta.yaml > /tmp/workspace.yaml
export SIDECAR_IMAGE=$(cat /tmp/workspace.yaml | yq '.spec.containers[] | .image' -r)
if [[ "$SIDECAR_IMAGE" =~ ^quay.io* ]]; then
REGISTRY_IMG_NAME=$(echo $SIDECAR_IMAGE | sed -e "s/quay.io/"${INTERNAL_REGISTRY_URL}"/g")
echo $SIDECAR_IMAGE
sudo skopeo copy --authfile=${REG_CREDS} --dest-tls-verify=false docker://"${SIDECAR_IMAGE}" docker://"${REGISTRY_IMG_NAME}"
fi
# Obtain golang devfile
# Obtain the golang image and push to internal Registry
IFS=$'\r\n' GLOBIGNORE='*' command eval 'DEVFILE_IMAGES=($(podman run --authfile=${XDG_RUNTIME_DIR}/containers/auth.json -it --rm \
--entrypoint cat ${INTERNAL_REGISTRY_URL}/eclipse/che-devfile-registry:nightly /var/www/html/devfiles/external_images.txt))'
@ -191,6 +181,7 @@ done
# Get the ocp domain for che custom resources
export DOMAIN=$(oc get dns cluster -o json | jq .spec.baseDomain | sed -e 's/^"//' -e 's/"$//')
# Define the CR patch specifying the airgap registry and nonProxy-hosts
cat >/tmp/che-cr-patch.yaml <<EOL
spec:
auth:
@ -201,15 +192,17 @@ spec:
nonProxyHosts: oauth-openshift.apps.$DOMAIN
EOL
# Start a golang workspace
# Provision test user to openshift cluster
initDefaults
provisionOpenShiftOAuthUser
# Deploy Eclipse Che
# Deploy Eclipse Che and retrieve golang devfile from devfile-registry
chectl server:deploy --telemetry=off --k8spodwaittimeout=1800000 --che-operator-cr-patch-yaml=/tmp/che-cr-patch.yaml --che-operator-image=${INTERNAL_REGISTRY_URL}/eclipse/che-operator:nightly --platform=openshift --installer=operator
DEVFILEURL=$(oc get checluster/eclipse-che -n eclipse-che -o "jsonpath={.status.devfileRegistryURL}")
curl -sSLo- -vk "${DEVFILEURL}/devfiles/go/devfile.yaml" > /tmp/devfile.yaml
# Link openshift User with keycloak and start golang workspace
provisionOAuth
chectl auth:login -u admin -p admin
chectl workspace:create --start --devfile="https://raw.githubusercontent.com/eclipse-che/che-devfile-registry/master/devfiles/go/devfile.yaml"
chectl workspace:create --start --devfile=/tmp/devfile.yaml
waitWorkspaceStart

View File

@ -1,5 +1,5 @@
{
"channel":"che-qe-notifications",
"channel":"devtools-che-deploy",
"blocks": [
{
"type": "header",