Refresh OpenStack release #765
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Refresh OpenStack release | |
on: | |
schedule: | |
- cron: '0 0 * * 1-5' | |
issue_comment: | |
types: [created] | |
jobs: | |
openstack_release_refresh: | |
name: Refresh OpenStack release | |
if: ${{ contains(github.event.comment.body, 'recheck_release') || github.event_name == 'schedule' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Install python3 | |
uses: actions/setup-python@v2 | |
- name: Install requirement | |
run: | | |
sudo apt install python3-pip git | |
- name: Prepare oos and run the script | |
run: | | |
set -ex | |
# clone openstack | |
git clone https://gitee.com/openstack-sig-bot/openstack | |
# update config and code | |
pushd openstack | |
git config user.name "openstack-sig-bot" | |
git config user.email "wxy2933@163.com" | |
git remote set-url origin https://openstack-sig-bot:${{ secrets.gitee_password }}@gitee.com/openstack-sig-bot/openstack.git | |
git remote add upstream https://gitee.com/openeuler/openstack | |
git remote update | |
git merge upstream/master | |
git push origin master -u | |
popd | |
# Install oos and run script | |
pushd openstack/tools/oos | |
pip install -r requirements.txt | |
pip install -e . | |
popd | |
pushd openstack/tools/oos/scripts | |
python3 ./fetch_openstack_release_mapping.py | |
mv openstack_release.yaml ../etc/ | |
result=`git diff` | |
if [ -n "$result" ];then | |
# push the change | |
git checkout -b daily_update_openstack_release | |
git add . | |
git commit -a -m "Daily update - opentack release" | |
git push origin HEAD -u | |
# create pull request | |
curl -X POST --header 'Content-Type: application/json;charset=UTF-8' 'https://gitee.com/api/v5/repos/openeuler/openstack/pulls' -d '{"access_token":"${{ secrets.gitee_bot_token }}","title":"Daily update - opentack release","head":"openstack-sig-bot:daily_update_openstack_release","base":"master","prune_source_branch":"true"}' | |
fi |