awips2/.github/workflows/update_NDM.yml
Shay Carter b7bf633253 Create new GHA for updating NDM files
- github action for updating ndm files to keep station information up to date with vlabs version
2022-03-28 13:09:11 -06:00

61 lines
2.4 KiB
YAML

name: update station info
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *"
jobs:
update_ndm:
runs-on: ubuntu-latest
environment:
name: VLAB
steps:
# # This may or may not be necessary, but it's what's done in the perl script
# # - name: Create awips-unidata-builds dir
# # - run: |
# # mkdir -p /home/awips/dev/ndm_local
# # cd /home/awips/dev/ndm_local
# # Could possibly just start with this? Where does it checkout the repo? /?
# - name: Checkout awips-unidata-build repo
# uses: actions/checkout@v3
# with:
# repository: unidata/awips-unidata-builds
# ref: main
# # need to add a secret I think, because a-u-b is a private repo?
# token: ''
# Also need to checkout this repo
# this gets the latest code (and is run on the default branch)
- name: Checkout awips2
uses: actions/checkout@v3
### Might need to install 'svn' command first??
# - name: Install SVN
# run: |
# pip install svn
# Do individual pulls for all the files in the ndm text file
# I think we need some kind of SECRET for this so the pull can be made?
- name: Pull latest from vlab svn repo
run: |
cd rpms/awips2.edex/Installer.edex/ndm/
for file in *; do
svn export --force https://vlab.noaa.gov/svn/awips-ndm/trunk/"$file" --username ${{ secrets.VLAB_UNAME }} --password ${{ secrets.VLAB_PASS }}
done
# Get the current date/time, because it's used in auto-commit
# - name: Get current time
# id: time
# uses: Kaven-Universe/github-action-current-date-time@v1.1.0
# with:
# format: "YYYY_MM_DD HH_mm_ss_SSS"
# Do we need to check for a change or can we just run a git add?
- name: Update existing NDM files for awips2 repo
# not sure if I have all the quotes just right for this one
# there is definitely a way to get the current default branch...do this properly?
# assume this is going to need some kind of SECRET as well??
run: |
date=`date +%Y%m%d-%H:%M:%S`
git config user.name $GITHUB_ACTOR
git config user.email $GITHUB_ACTOR@users.noreply.github.com
git add --all
git commit -m "New NDM updates on $date - autogenerated"
git push