Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2046 Add "|| true" to remove command for usagov_login #2047

Merged
merged 4 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 34 additions & 73 deletions .github/workflows/increment_sub_hash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,14 @@ on:
workflow_dispatch: # Allows manual trigger

jobs:
# update-submodule-on-release:
# name: update-submodule-on-release
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout repository without submodules
# uses: actions/checkout@v4
# with:
# submodules: false # Do not checkout submodules initially
# fetch-depth: 0 # Fetch all history
#
# - name: Set up Git
# run: |
# git config --global user.name "Xavier Metichecchia"
# git config --global user.email "[email protected]"
# git config --global pull.rebase false # Ensure merge strategy
# git remote set-url origin https://${{ secrets.HASH_PAT }}@github.com/GSA/px-benefit-finder.git
#
# - name: Update submodules on release branch
# continue-on-error: true
# run: |
# # Checkout the release branch
# git checkout release
#
# # Update and initialize submodules
# git submodule update --init
# git submodule set-branch --branch prod usagov-2021
# git submodule update --remote || echo "Expected error: Failed to update all submodules."
#
# # Check Git Status
# git add .
# git commit --allow-empty -m "Updated submodule to the latest commit on release branch"
#
# # Commit the changes
# git status
# git --no-pager diff
#
# # Push changes to release branch
# git push origin release

update-submodule-on-main:
name: update-submodule-on-main
update-submodule:
runs-on: ubuntu-latest

steps:
- name: Checkout repository without submodules
uses: actions/checkout@v4
with:
# submodules: false # Do not checkout submodules initially
submodules: false # Do not checkout submodules initially
fetch-depth: 0 # Fetch all history

- name: Set up Git
Expand All @@ -62,44 +21,46 @@ jobs:
git config --global pull.rebase false # Ensure merge strategy
git remote set-url origin https://${{ secrets.HASH_PAT }}@github.com/GSA/px-benefit-finder.git

- name: Update submodules on release branch
continue-on-error: true
run: |
# Checkout the release branch
git checkout release

# Update and initialize submodules
git submodule update --init
git submodule set-branch --branch prod usagov-2021
git submodule update --remote || echo "Expected error: Failed to update all submodules."

# Check Git Status
git add .
git commit --allow-empty -m "Updated submodule to the latest commit on release branch"

# Commit the changes
git status
git --no-pager diff

# Push changes to release branch
git push origin release

- name: Sync release to main
run: |
# Switch to the main branch
git checkout main

git submodule update --remote

# Pull changes from release into main
git pull origin release

# Push updated main branch
git push origin main

# update-submodule-on-dev:
# name: update-submodule-on-dev
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout repository without submodules
# uses: actions/checkout@v4
# with:
# # submodules: false # Do not checkout submodules initially
# fetch-depth: 0 # Fetch all history
#
# - name: Set up Git
# run: |
# git config --global user.name "Xavier Metichecchia"
# git config --global user.email "[email protected]"
# git config --global pull.rebase false # Ensure merge strategy
# git remote set-url origin https://${{ secrets.HASH_PAT }}@github.com/GSA/px-benefit-finder.git
#
# - name: Sync release to dev
# run: |
# # Switch to the dev branch
# git checkout dev
#
# # Pull changes from release into dev
# git pull origin release
#
# # Push updated dev branch
# git push origin dev
- name: Sync release to dev
run: |
# Switch to the dev branch
git checkout dev

# Pull changes from release into dev
git pull origin release

# Push updated dev branch
git push origin dev
6 changes: 2 additions & 4 deletions scripts/drush-post-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ drush cim --partial --source=modules/custom/usagov_benefit_finder/configuration
drush cr
### USER_PASSWORD_RESET_PLACEHOLDER ###
drush state:set system.maintenance_mode 0 -y
# drush pm:uninstall usagov_login --strict=0
drush pm-list --type=module usagov_login --pipe | grep -q "^usagov_login " && drush pm-uninstall -y usagov_login || echo "Module 'usagov_login' does not exist. Skipping uninstallation."
drush pm:uninstall usagov_login --strict=0 || true
#drush pm-list --type=module --status=enabled | grep -q "usagov_login " && drush pm-uninstall -y usagov_login || echo "Module 'usagov_login' does not exist. Skipping uninstallation."
echo "Post deploy finished!"


Loading