Skip to content

Commit

Permalink
fix: scripts for local run
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Orel <[email protected]>
  • Loading branch information
olexii4 committed Jul 24, 2023
1 parent aa83f01 commit 7a872bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions run/build-and-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ echo "[INFO] Patching checluster with the new dashboard image '${CHE_DASHBOARD_I
CHE_NAMESPACE="${CHE_NAMESPACE:-eclipse-che}"
DASHBOARD_POD_NAME=$(kubectl get pods -n $CHE_NAMESPACE -o=custom-columns=:metadata.name | grep dashboard)
CHECLUSTER_CR_NAME=$(kubectl exec $DASHBOARD_POD_NAME -n $CHE_NAMESPACE -- printenv CHECLUSTER_CR_NAME)
PREVIOUS_CHE_DASHBOARD_IMAGE=$(kubectl get checluster -n $CHE_NAMESPACE $CHECLUSTER_CR_NAME -o=json | jq -r '.items[0].spec.components.dashboard.deployment.containers[0].image')
PREVIOUS_CHE_DASHBOARD_IMAGE=$(kubectl get checluster -n $CHE_NAMESPACE $CHECLUSTER_CR_NAME -o=json | jq -r '.spec.components.dashboard.deployment.containers[0].image')

if [ "$PREVIOUS_CHE_DASHBOARD_IMAGE" = "null" ]; then
if [ "$PREVIOUS_CHE_DASHBOARD_IMAGE" == "null" ]; then
kubectl patch -n "$CHE_NAMESPACE" "checluster/$CHECLUSTER_CR_NAME" --type=json -p="[{\"op\": \"replace\", \"path\": \"/spec/components/dashboard\", \"value\": {deployment: {containers: [{image: \"${CHE_DASHBOARD_IMAGE}\", name: che-dasboard}]}}}]"
else
kubectl patch -n "$CHE_NAMESPACE" "checluster/$CHECLUSTER_CR_NAME" --type=json -p="[{\"op\": \"replace\", \"path\": \"/spec/components/dashboard.deployment.containers[0].image\", \"value\": ${CHE_DASHBOARD_IMAGE}}]"
Expand Down
2 changes: 1 addition & 1 deletion run/local-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fi

# consider renaming it to CHE_API_URL since it's not just host
export CHE_HOST=http://localhost:8080
export CHE_HOST_ORIGIN=$(kubectl get checluster -n $CHE_NAMESPACE $CHECLUSTER_CR_NAME -o=json | jq -r '.items[0].status.cheURL')
export CHE_HOST_ORIGIN=$(kubectl get checluster -n $CHE_NAMESPACE $CHECLUSTER_CR_NAME -o=json | jq -r '.status.cheURL')

# do nothing
PRERUN_COMMAND="echo"
Expand Down

0 comments on commit 7a872bc

Please sign in to comment.