Skip to content

CI/CD Consolidation#47

Merged
CodeGat merged 2 commits intomainfrom
ci-cd-consolidation
Apr 19, 2024
Merged

CI/CD Consolidation#47
CodeGat merged 2 commits intomainfrom
ci-cd-consolidation

Conversation

@CodeGat
Copy link
Copy Markdown
Member

@CodeGat CodeGat commented Apr 15, 2024

An investigation into moving all complexity out of the model repos themselves, and putting it in build-cd.

Copy link
Copy Markdown
Member

@aidanheerdegen aidanheerdegen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@CodeGat CodeGat marked this pull request as ready for review April 17, 2024 04:51
@CodeGat
Copy link
Copy Markdown
Member Author

CodeGat commented Apr 17, 2024

Just realised that this could be mergable since the existing infrastructure is not modified!

@aidanheerdegen
Copy link
Copy Markdown
Member

Another approach to trying to make the bash sections more testable and reusable is to create bash functions, pop them in a file (say functions/thinkofagoodname.sh) and then make sure those functions are in a file that bash will source that file every time it is invoked.

One way to do that is an approach like this:

https://github.com/marketplace/actions/action-setup-bash

which is an action that dumps a function into .bash_profile and sets the default bash to use --login and so source that file.

An example function:

$ cat extract_version.sh 
extract_version() {

   if [ "$#" -ne 2 ]; then
      echo "Illegal number of parameters"
      return 1
   fi

   local node=$1
   local spackyaml=$2

   echo $(yq "${node} | split(\"@git.\") | .[1]" ${spackyaml})

}

Now you could have a bunch of files, one for each function and dump them all into .bash_profile, or put them all in a single file.

Could then have some specialist CI that only gets called when files in that subdirectory changes to test the functions.

Copy link
Copy Markdown
Member

@aidanheerdegen aidanheerdegen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that I reviewed it before, and nothing has changed, I'll trust former me.

@CodeGat CodeGat merged commit aabb186 into main Apr 19, 2024
@CodeGat CodeGat deleted the ci-cd-consolidation branch April 19, 2024 01:50
CodeGat added a commit to ACCESS-NRI/ACCESS-OM3 that referenced this pull request Apr 19, 2024
CodeGat added a commit to ACCESS-NRI/ACCESS-OM3 that referenced this pull request Apr 19, 2024
* Updated the CI/CD to use the simplified format described in ACCESS-NRI/build-cd#47

* cd.yml: om3 instead of om2

* Changed explicit model name to vars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants