From 067dfaa322e2832cd601a354120a532f478dc8a1 Mon Sep 17 00:00:00 2001 From: andersonid Date: Sat, 4 Oct 2025 12:00:30 -0300 Subject: [PATCH] Remove unnecessary rollout-restart.sh script - Delete rollout-restart.sh as it was just a simple oc command - Update README.md to show direct oc rollout restart command - Simplify workflow: git push -> GitHub Actions -> oc rollout restart - Keep only essential scripts: deploy-complete.sh, build-and-push.sh, undeploy-complete.sh --- scripts/README.md | 26 +++++++++++++------------- scripts/rollout-restart.sh | 38 -------------------------------------- 2 files changed, 13 insertions(+), 51 deletions(-) delete mode 100755 scripts/rollout-restart.sh diff --git a/scripts/README.md b/scripts/README.md index c8d5c0b..466e791 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -23,22 +23,22 @@ This directory contains scripts for building, deploying, and updating the OpenSh ./scripts/deploy-complete.sh ``` -### 2. `rollout-restart.sh` - Updates (Recommended) +### 2. Updates (Recommended) **Purpose**: Update existing deployment with new image **When to use**: After code changes and GitHub Actions has built new image -**What it does**: -- Restarts deployment to pull new image -- Waits for rollout completion -- Checks pod status and logs -- Shows application URL - -**Usage**: +**Simple command**: ```bash -./scripts/rollout-restart.sh +oc rollout restart deployment/resource-governance -n resource-governance ``` -### 3. `build-and-push.sh` - Manual Build +**With status check**: +```bash +oc rollout restart deployment/resource-governance -n resource-governance +oc rollout status deployment/resource-governance -n resource-governance +``` + +### 2. `build-and-push.sh` - Manual Build **Purpose**: Build and push image manually (when GitHub Actions is not available) **When to use**: Manual builds or when GitHub Actions is not working @@ -56,7 +56,7 @@ podman login quay.io ./scripts/build-and-push.sh ``` -### 4. `undeploy-complete.sh` - Cleanup +### 3. `undeploy-complete.sh` - Cleanup **Purpose**: Remove all resources **When to use**: When you want to completely remove the application @@ -71,7 +71,7 @@ echo 'yes' | ./scripts/undeploy-complete.sh 1. Make code changes 2. `git add . && git commit -m "Your changes" && git push` 3. Wait for GitHub Actions to build new image -4. `./scripts/rollout-restart.sh` +4. `oc rollout restart deployment/resource-governance -n resource-governance` ### For Initial Deployment: 1. `./scripts/deploy-complete.sh` @@ -79,7 +79,7 @@ echo 'yes' | ./scripts/undeploy-complete.sh ### For Manual Build (if needed): 1. `podman login quay.io` 2. `./scripts/build-and-push.sh` -3. `./scripts/rollout-restart.sh` +3. `oc rollout restart deployment/resource-governance -n resource-governance` ## Security Notes diff --git a/scripts/rollout-restart.sh b/scripts/rollout-restart.sh deleted file mode 100755 index f17c2da..0000000 --- a/scripts/rollout-restart.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# Simple rollout restart script for OpenShift Resource Governance Tool -# Use this for updates after GitHub Actions has built the new image - -set -e - -# Source common functions -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -source "$SCRIPT_DIR/common.sh" - -echo -e "${BLUE}Rolling out new image for OpenShift Resource Governance Tool${NC}" - -# Check if connected to cluster -check_openshift_connection - -# Check if deployment exists -check_deployment_exists - -# Restart deployment to pull new image -echo -e "${YELLOW}Restarting deployment to pull new image...${NC}" -oc rollout restart deployment/$DEPLOYMENT_NAME -n $NAMESPACE - -# Wait for rollout to complete -echo -e "${YELLOW}Waiting for rollout to complete...${NC}" -oc rollout status deployment/$DEPLOYMENT_NAME -n $NAMESPACE --timeout=300s - -# Check pod status and logs -check_pod_status - -# Get application URL -get_application_url - -echo -e "${GREEN}SUCCESS: Rollout completed successfully!${NC}" - -echo -e "${BLUE}Process completed!${NC}" -echo -e "${YELLOW}Note: This script only restarts the deployment.${NC}" -echo -e "${YELLOW}For initial deployment, use: ./scripts/deploy-complete.sh${NC}"