-
Notifications
You must be signed in to change notification settings - Fork 19
69 lines (57 loc) · 2.41 KB
/
container-update.yml
File metadata and controls
69 lines (57 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# This is a basic workflow that is manually triggered
name: Publish Container Update
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
workflow_run:
workflows: ["Upload Python Package"]
types: [completed]
jobs:
update_container:
runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install dependencies
run: |
python3.7 -m pip install --upgrade pip
python3.7 -m pip install virtualenv
sudo add-apt-repository -y ppa:ubuntugis/ppa \
&& sudo apt install -y \
gdal-bin libgdal-dev
- name: Update dependencies
run: |
version=$(cat ./VERSION)
cd ..
git clone https://${{ secrets.ADO_USER }}:${{ secrets.ADO_PASSWORD }}@cloudes.visualstudio.com/CDPX/_git/CDPX-Linux-Images
cd CDPX-Linux-Images
cd src/user/agai/agai-template-ubuntu-1804/latest/requirements
install_all="ai-python[core,ama,reco,msft-utils,retail,energy-ca,energy-km,fclib,fsi-nlp,fsi-risk,fsi,gem-ent,gem-reco,gem,sc-ro,sc-ip,sc-ecr,sc,cdm,maro,all]==$version"
install_test="ai-python[test]==$version"
echo "$install_all" > core.in
echo "$install_test" > test.in
./generate.sh -s .
git config --global user.email "dciborow@microsoft.com"
git config --global user.name "Daniel Ciborowski"
git add -A
git commit -m "Updating Container"
if git rev-parse --quiet --verify dciborow/updateContainer > /dev/null; then
git fetch
git merge -X ours dciborow/updateContainer
fi
git push origin --force master:dciborow/updateContainer
- name: HTTP Request Action
uses: fjogeleit/http-request-action@v1.8.0
continue-on-error: true
with:
url: 'https://cloudes.visualstudio.com/CDPX/_apis/git/repositories/CDPX-Linux-Images/pullrequests?api-version=6.0'
method: 'POST'
username: "dciborow"
password: ${{ secrets.ADO_PAT }}
data: '{"targetRefName": "refs/heads/master", "sourceRefName": "refs/heads/dciborow/updateContainer", "title": "Dependancy Update", "autoCompleteSetBy": "dciborow@microsoft.com"}'
ignoreStatusCodes: '409'