Skip to content

Commit

Permalink
Change master to production and dev to staging
Browse files Browse the repository at this point in the history
  • Loading branch information
code-geek committed Aug 21, 2024
1 parent 79b37da commit 9373fd6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 29 deletions.
56 changes: 28 additions & 28 deletions scripts/quality_and_indexing/pull_and_merge_webapp_automation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,37 @@ if [ "$CURRENT_URL" != "$REPO_URL" ]; then
exit 1
fi

# Checkout and pull master
echo "Checking out master branch..."
git checkout master
echo "Pulling latest changes from master..."
git pull origin master

# Checkout and pull dev
echo "Checking out dev branch..."
git checkout dev
echo "Pulling latest changes from dev..."
git pull origin dev
# Checkout and pull production
echo "Checking out production branch..."
git checkout production
echo "Pulling latest changes from production..."
git pull origin production

# Checkout and pull staging
echo "Checking out staging branch..."
git checkout staging
echo "Pulling latest changes from staging..."
git pull origin staging

# Checkout and pull webapp_config_generation
echo "Checking out webapp_config_generation branch..."
git checkout webapp_config_generation
echo "Pulling latest changes from webapp_config_generation..."
git pull origin webapp_config_generation

# Merge dev into webapp_config_generation
echo "Merging dev into webapp_config_generation..."
git merge -X theirs dev -m "Merge dev into webapp_config_generation branch - auto-resolved conflicts by taking dev changes"
# Merge staging into webapp_config_generation
echo "Merging staging into webapp_config_generation..."
git merge -X theirs staging -m "Merge staging into webapp_config_generation branch - auto-resolved conflicts by taking staging changes"

# Push the changes to webapp_config_generation
echo "Pushing changes to webapp_config_generation..."
git push origin webapp_config_generation

echo "Operation completed successfully!"

### Begin merge of webapp into dev ###
# Check the diff between webapp_config_generation and dev branches, and filter only files outside the allowed directories
DIFF=$(git diff --name-only webapp_config_generation dev | grep -vE 'jobs/|sources/' || true)
### Begin merge of webapp into staging ###
# Check the diff between webapp_config_generation and staging branches, and filter only files outside the allowed directories
DIFF=$(git diff --name-only webapp_config_generation staging | grep -vE 'jobs/|sources/' || true)

if [ -n "$DIFF" ]; then
echo "The following changes were found outside of the allowed directories:"
Expand All @@ -56,21 +56,21 @@ else
echo "All changes are within the allowed directories. Proceeding with the merge."
fi

# Checkout dev branch again
echo "Checking out dev branch..."
git checkout dev
# Checkout staging branch again
echo "Checking out staging branch..."
git checkout staging

# Merge webapp_config_generation into dev
echo "Merging webapp_config_generation into dev..."
git merge webapp_config_generation -m "Merge webapp_config_generation into dev branch"
# Merge webapp_config_generation into staging
echo "Merging webapp_config_generation into staging..."
git merge webapp_config_generation -m "Merge webapp_config_generation into staging branch"

# Push the changes to dev
echo "Pushing changes to dev..."
git push origin dev
# Push the changes to staging
echo "Pushing changes to staging..."
git push origin staging

git checkout master
git checkout production

# Return to the original directory
cd -

echo "webapp_automation and dev merges comleted successfully!"
echo "webapp_automation and staging merges comleted successfully!"
4 changes: 3 additions & 1 deletion sde_collections/models/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,9 @@ def candidate_urls_count(self) -> int:

@property
def sinequa_configuration(self) -> str:
return f"https://github.com/NASA-IMPACT/sde-backend/blob/master/sources/SDE/{self.config_folder}/default.xml"
return (
f"https://github.com/NASA-IMPACT/sde-backend/blob/production/sources/SDE/{self.config_folder}/default.xml"
)

@property
def github_issue_link(self) -> str:
Expand Down

0 comments on commit 9373fd6

Please sign in to comment.