Skip to content

Commit

Permalink
Modified behaviour to do asset-management for all branches
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Do committed Jun 5, 2024
1 parent 071d748 commit 95f218e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 30 deletions.
30 changes: 1 addition & 29 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import hashlib
import subprocess

import boto3
Expand Down Expand Up @@ -187,31 +186,4 @@ def clean_bucket():
run_command(f's3cmd --config={bucket_map[S3_TEMP]} del {S3_TEMP}/{asset}')

if __name__ == "__main__":
manage_assets()
# clean_bucket()

# "server-room-light-min.jpg" -> watcloud://v1/sha256:96fc3a9fe38828d5db6146e9f8ddff0556f108fd1097f4c8a8c26721a01af557
# "text2" -> watcloud://v1/sha256:d848ca35a6281600b5da598c7cb4d5df561e0ee63ee7cec0e98e6049996f3ff?name=text2.txt
# print(get_sha256_dict(["server-room-dark-min", "server-room-light-min", "text2"]))

# print(get_assets_in_repo())
# print("hello world")
# print(FILE_PATH)
# print(run_command("ls"))
# print("Temp")
# print(get_assets_in_bucket(bucket_temp))
# print("Perm")
# print(get_assets_in_bucket(bucket_perm))

# print("script ran")

# Boto test
# print(bucket_perm)
# print(bucket_temp)

# download_file("requirements.txt", "temp/sussy.txt", bucket_perm)

# current_dir = os.path.dirname(os.path.abspath(__file__))
# files = os.listdir(current_dir)
# for f in files:
# print(f)
manage_assets()
13 changes: 12 additions & 1 deletion src/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,15 @@ git clone -b hepromark/asset-kubernetes2 [email protected]:WATonomous/infra-config.
# Install libraries
pip install -r requirements.txt

python3 main.py
# Get list of branches
BRANCHES=$(git ls-remote --heads origin | sed 's?.*refs/heads/??')

# Loop through each branch
for BRANCH in $BRANCHES; do
echo "Managing Assets for: $BRANCH"
git checkout $BRANCH
git pull origin $BRANCH

echo "calling main.py"
python3 main.py
done

0 comments on commit 95f218e

Please sign in to comment.