Skip to content

Commit

Permalink
adding GAM
Browse files Browse the repository at this point in the history
  • Loading branch information
dchourasia committed Jul 5, 2024
1 parent f232c5a commit 79aa9ac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/Gated-Auto-Merger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
description: select component
options:
- Dashboard
env:
METADATA: "data/metadata.yaml"

jobs:
gated-auto-merger:
Expand Down Expand Up @@ -35,9 +37,16 @@ jobs:
- name: Copy metadata Json
id: copy_meta
run: |
meta=$(yq -o json $METADATA)
execution_id=$(echo $meta | jq -r '.metadata.execution_id')
mkdir metadata/${execution_id}
cp data/metadata.yaml metadata/${execution_id}/
echo "inside metadata"
cd metadata/${execution_id}/
cp
pwd
ls
cat metadata.yaml
# - name: Commit and push changes to main branch
# uses: actions-js/push@master
# with:
Expand Down
2 changes: 1 addition & 1 deletion src/gam_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def generate_execution_metadata(self):
meta = self.component_config
meta['execution_id'] = self.execution_id
with open('data/metadata.yaml', 'w') as metadata:
metadata.write(yaml.dump(meta))
metadata.write(yaml.dump({'metadata': meta}))
return meta

def post_umb_message(self):
Expand Down
3 changes: 2 additions & 1 deletion src/poc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from datetime import datetime

components = yaml.load(open('../config/gam-config.yaml'), Loader=yaml.SafeLoader)
components = {'name': 'Dashboard', 'cpaas_repos': ['odh-dashboard'], 'non_cpaas_repos': [], 'robot_tags': 'Dashboard', 'Test_Platform': 'Jenkins', 'Jenkins_Job': '', 'execution_id': '050724130415305145'}
print(components)
print(yaml.dump(components))
print(yaml.dump({'metadata': components}))
print(datetime.now().strftime('%d%m%y%H%M%S%f'))

0 comments on commit 79aa9ac

Please sign in to comment.