Skip to content

Commit

Permalink
Merge pull request #92 from esg-epfl-apc/preview-cicd-improve
Browse files Browse the repository at this point in the history
Improvements in Preview CI/CD
  • Loading branch information
dsavchenko authored Feb 19, 2024
2 parents 2991f65 + d754d57 commit 472dee3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/live-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.7"
python-version: "3.8"
- uses: actions/checkout@v3
with:
fetch-depth: 0
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
run: |
cd deploy-preview
dir_list=`for tl in $TOOL_LIST ; do echo $tl | awk -F '/' '{print $2}'; done | uniq`
dir_list=`for tl in $TOOL_LIST ; do echo $tl | awk -F '/' '{for(i=2;i<=(NF-1);i++) printf("%s%s",$i,i==(NF-1)?" ":FS)}'; done | uniq`
for dr in $dir_list; do
tools_list=`for tl in $TOOL_LIST; do if [[ "$tl" == *"$dr"* ]] ; then basename $tl ; fi ; done`
Expand Down
14 changes: 12 additions & 2 deletions deploy-preview/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@


tasks:
- name: Create tool dir
ansible.builtin.file:
path: "{{ dest_tools_dir }}/{{ tool_dir }}_pr{{ pr_num }}"
state: directory
mode: 0755

- name: Sync tool dir
ansible.posix.synchronize:
src: "{{ src_tools_dir }}/{{ tool_dir }}/"
Expand All @@ -29,8 +35,8 @@
- name: Make name unique
replace:
path: "{{ dest_tools_dir }}/{{ tool_dir }}_pr{{ pr_num }}/{{ item }}"
regexp: '<tool(.*)name="([a-z0-9_]+)"'
replace: '<tool\1name="\2_pr{{ pr_num }}"'
regexp: '<tool(.*)name="([^"]+)"'
replace: '<tool\1name="\2 (PR {{ pr_num }})"'
loop: "{{ tools_list }}"

- name: Clean previous references
Expand All @@ -47,3 +53,7 @@
insertafter: '<section id="astro_staging"'
line: ' <tool file="{{ tool_dir }}_pr{{ pr_num }}/{{ item }}" />'
loop: "{{ tools_list }}"

- name: Restart Galaxy
command: galaxyctl restart
changed_when: true

0 comments on commit 472dee3

Please sign in to comment.