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
This commit is contained in:
2025-10-04 12:00:30 -03:00
parent 92834cc8aa
commit 067dfaa322
2 changed files with 13 additions and 51 deletions

View File

@@ -23,22 +23,22 @@ This directory contains scripts for building, deploying, and updating the OpenSh
./scripts/deploy-complete.sh ./scripts/deploy-complete.sh
``` ```
### 2. `rollout-restart.sh` - Updates (Recommended) ### 2. Updates (Recommended)
**Purpose**: Update existing deployment with new image **Purpose**: Update existing deployment with new image
**When to use**: After code changes and GitHub Actions has built new image **When to use**: After code changes and GitHub Actions has built new image
**What it does**: **Simple command**:
- Restarts deployment to pull new image
- Waits for rollout completion
- Checks pod status and logs
- Shows application URL
**Usage**:
```bash ```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) **Purpose**: Build and push image manually (when GitHub Actions is not available)
**When to use**: Manual builds or when GitHub Actions is not working **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 ./scripts/build-and-push.sh
``` ```
### 4. `undeploy-complete.sh` - Cleanup ### 3. `undeploy-complete.sh` - Cleanup
**Purpose**: Remove all resources **Purpose**: Remove all resources
**When to use**: When you want to completely remove the application **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 1. Make code changes
2. `git add . && git commit -m "Your changes" && git push` 2. `git add . && git commit -m "Your changes" && git push`
3. Wait for GitHub Actions to build new image 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: ### For Initial Deployment:
1. `./scripts/deploy-complete.sh` 1. `./scripts/deploy-complete.sh`
@@ -79,7 +79,7 @@ echo 'yes' | ./scripts/undeploy-complete.sh
### For Manual Build (if needed): ### For Manual Build (if needed):
1. `podman login quay.io` 1. `podman login quay.io`
2. `./scripts/build-and-push.sh` 2. `./scripts/build-and-push.sh`
3. `./scripts/rollout-restart.sh` 3. `oc rollout restart deployment/resource-governance -n resource-governance`
## Security Notes ## Security Notes

View File

@@ -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}"