Skip to content

Commit

Permalink
deployment structure re-configure
Browse files Browse the repository at this point in the history
  • Loading branch information
robjharrison committed Sep 3, 2024
1 parent b790f6f commit 51ea82b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 11 deletions.
59 changes: 48 additions & 11 deletions deployment_extracts/systemc/live/test.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#!/bin/bash
# chmod +x test.sh

# This bash file to be run from the downstream repo!
# This bash file to be run from the downstream repo!

# Paths in the upstream repo:
# /workspaces/ssd-data-model/deployment_extracts/systemc/live/
# /workspaces/ssd-data-model/deployment_extracts/mosaic/live/
# /workspaces/ssd-data-model/deployment_extracts/eclipse/live/
# /workspaces/ssd-data-model/deployment_extracts/caredirector/live/
# /workspaces/ssd-data-model/deployment_extracts/azeus/live/

# Check if already in the ssd-deployment directory
if [ ! -d ".git" ]; then
Expand All @@ -26,36 +30,69 @@ fi
# Enable sparse checkout and pull the specific folders from the source repository
git config core.sparseCheckout true

# Add systemc and mosaic paths to sparse-checkout
echo "cms_ssd_extract_sql/systemc/live/" > .git/info/sparse-checkout
echo "cms_ssd_extract_sql/mosaic/live/" >> .git/info/sparse-checkout
# Add paths to sparse-checkout
echo "deployment_extracts/systemc/live/" > .git/info/sparse-checkout
echo "deployment_extracts/mosaic/live/" >> .git/info/sparse-checkout
echo "deployment_extracts/eclipse/live/" >> .git/info/sparse-checkout
echo "deployment_extracts/caredirector/live/" >> .git/info/sparse-checkout
echo "deployment_extracts/azeus/live/" >> .git/info/sparse-checkout

# Checkout the systemc directory
if ! git checkout ssd-data-model/main -- cms_ssd_extract_sql/systemc/live/; then
if ! git checkout ssd-data-model/main -- deployment_extracts/systemc/live/; then
echo "Error: Failed to checkout the systemc folder. Invalid reference or permissions issue."
exit 1
fi

# Checkout the mosaic directory
if ! git checkout ssd-data-model/main -- cms_ssd_extract_sql/mosaic/live/; then
if ! git checkout ssd-data-model/main -- deployment_extracts/mosaic/live/; then
echo "Error: Failed to checkout the mosaic folder. Invalid reference or permissions issue."
exit 1
fi

# Create the systemc and mosaic directories in the downstream repository
# Checkout the eclipse directory
if ! git checkout ssd-data-model/main -- deployment_extracts/eclipse/live/; then
echo "Error: Failed to checkout the eclipse folder. Invalid reference or permissions issue."
exit 1
fi

# Checkout the caredirector directory
if ! git checkout ssd-data-model/main -- deployment_extracts/caredirector/live/; then
echo "Error: Failed to checkout the caredirector folder. Invalid reference or permissions issue."
exit 1
fi

# Checkout the azeus directory
if ! git checkout ssd-data-model/main -- deployment_extracts/azeus/live/; then
echo "Error: Failed to checkout the azeus folder. Invalid reference or permissions issue."
exit 1
fi

# Create the directories in the downstream repository
mkdir -p systemc/
mkdir -p mosaic/
mkdir -p eclipse/
mkdir -p caredirector/
mkdir -p azeus/

# Move the systemc folder's contents to the systemc directory
mv cms_ssd_extract_sql/systemc/live/* systemc/
mv deployment_extracts/systemc/live/* systemc/

# Move the mosaic folder's contents to the mosaic directory
mv cms_ssd_extract_sql/mosaic/live/* mosaic/
mv deployment_extracts/mosaic/live/* mosaic/

# Move the eclipse folder's contents to the eclipse directory
mv deployment_extracts/eclipse/live/* eclipse/

# Move the caredirector folder's contents to the caredirector directory
mv deployment_extracts/caredirector/live/* caredirector/

# Move the azeus folder's contents to the azeus directory
mv deployment_extracts/azeus/live/* azeus/

# Remove the empty directory structures after the move
rm -rf cms_ssd_extract_sql/
rm -rf deployment_extracts/

# Stage, commit, and push the changes to the downstream repository
git add .
git commit -m "Add live SQL files from systemc and mosaic from ssd-data-model repository"
git commit -m "Add live SQL files from multiple folders in the ssd-data-model repository"
git push origin main

0 comments on commit 51ea82b

Please sign in to comment.