-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update morpheus module config to use proper device mappings for …
…NVMe EBS volumes
- Loading branch information
Showing
2 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # Repository Sync Script | ||
|
|
||
| This script automates the process of committing and pushing changes across multiple image pipeline repositories. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| ./scripts/sync-repos.sh | ||
| ``` | ||
|
|
||
| The script will: | ||
| 1. Look for changes in each repository | ||
| 2. Commit changes with predefined commit messages | ||
| 3. Push to both 'hpw' and 'origin' remotes | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Git repositories must be cloned in the same parent directory | ||
| - Both 'hpw' and 'origin' remotes must be configured | ||
| - Script must be run from the aws-image-pipeline directory | ||
| - Appropriate git credentials/SSH keys must be configured | ||
|
|
||
| ## Modifying Commit Messages | ||
|
|
||
| To update the commit messages, edit the `REPOS` array in the script. Each repository has an associated commit message: | ||
|
|
||
| ```bash | ||
| declare -A REPOS=( | ||
| ["aws-image-pipeline"]="your commit message here" | ||
| ["image-pipeline-ansible-playbooks"]="your commit message here" | ||
| ["linux-image-pipeline"]="your commit message here" | ||
| ) | ||
| ``` | ||
|
|
||
| ## Error Handling | ||
|
|
||
| The script will: | ||
| - Continue even if one repository fails | ||
| - Report failures to push to either remote | ||
| - Skip repositories with no changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| # Directory containing all repos | ||
| BASE_DIR=/home/a/arnol377/git | ||
|
|
||
| # Define repositories and their commit messages | ||
| declare -A REPOS | ||
| REPOS["aws-image-pipeline"]="fix: update morpheus module config to use proper device mappings for NVMe EBS volumes" | ||
| REPOS["image-pipeline-ansible-playbooks"]="fix: update volume mounting to handle NVMe device mapping and add enhanced error checking" | ||
| REPOS["linux-image-pipeline"]="fix: update packer configuration to properly handle root volume and NVMe device mappings" | ||
|
|
||
| # Function to commit and push changes | ||
| commit_and_push() { | ||
| local repo=$1 | ||
| local message=$2 | ||
| local dir="${BASE_DIR}/${repo}" | ||
|
|
||
| echo "Processing ${repo}..." | ||
|
|
||
| if [ ! -d "$dir" ]; then | ||
| echo "Error: Directory $dir does not exist" | ||
| return 1 | ||
| fi | ||
|
|
||
| cd "$dir" | ||
|
|
||
| # Check if there are changes to commit | ||
| if git status --porcelain | grep -q '^'; then | ||
| echo "Changes detected in ${repo}, committing..." | ||
| git add . | ||
| git commit -m "$message" | ||
|
|
||
| # Push to both remotes | ||
| echo "Pushing to hpw..." | ||
| git push hpw main || echo "Warning: Failed to push to hpw remote" | ||
|
|
||
| echo "Pushing to origin..." | ||
| git push origin main || echo "Warning: Failed to push to origin remote" | ||
| else | ||
| echo "No changes to commit in ${repo}" | ||
| fi | ||
| } | ||
|
|
||
| # Main execution | ||
| for repo in "${!REPOS[@]}"; do | ||
| commit_message=${REPOS[$repo]} | ||
| commit_and_push "$repo" "$commit_message" || echo "Failed to process ${repo}" | ||
| done | ||
|
|
||
| echo "All repositories processed successfully!" |