Skip to content

Commit 90094b5

Browse files
committed
Updating upgrade script
1 parent 620d9da commit 90094b5

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

upgradeeformnugets.sh

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,51 @@
33
GIT_STATUS=`git status | grep "nothing to commit, working tree clean" | wc -l`
44
if (( "$GIT_STATUS" > 0 )); then
55
git pull
6-
cd eFormAPI/Plugins/OuterInnerResource.Pn/OuterInnerResource.Pn
76
CURRENT_NUMBER_OF_COMMITS=`git log --oneline | wc -l`
87

8+
cd eFormAPI/Plugins/OuterInnerResource.Pn/OuterInnerResource.Pn
99
PACKAGES=('Microting.eForm' 'Microting.eFormApi.BasePn' 'Microting.eFormOuterInnerResourceBase')
1010
PROJECT_NAME='OuterInnerResource.Pn.csproj'
1111
REPOSITORY='eform-angular-outer-inner-resource-plugin'
1212

13+
for PACKAGE_NAME in ${PACKAGES[@]}; do
14+
15+
OLD_VERSION=`dotnet list package | grep "$PACKAGE_NAME " | grep -oP ' \d\.\d+\.\d.*' | grep -oP ' \d.* \b' | xargs`
16+
17+
dotnet add $PROJECT_NAME package $PACKAGE_NAME
18+
19+
NEW_VERSION=`dotnet list package | grep "$PACKAGE_NAME " | grep -oP ' \d\.\d+\.\d.*$' | grep -oP '\d\.\d+\.\d.*$' | grep -oP ' \d\.\d+\.\d.*$' | xargs`
20+
21+
if [ $NEW_VERSION != $OLD_VERSION ]; then
22+
echo "We have a new version of $PACKAGE_NAME, so creating github issue and do a commit message to close that said issue"
23+
RESULT=`curl -X "POST" "https://api.github.com/repos/microting/$REPOSITORY/issues?state=all" \
24+
-H "Cookie: logged_in=no" \
25+
-H "Authorization: token $CHANGELOG_GITHUB_TOKEN" \
26+
-H "Content-Type: text/plain; charset=utf-8" \
27+
-d $'{
28+
"title": "Bump '$PACKAGE_NAME' from '$OLD_VERSION' to '$NEW_VERSION'",
29+
"body": "TBD",
30+
"assignees": [
31+
"renemadsen"
32+
],
33+
"labels": [
34+
".NET",
35+
"backend",
36+
"enhancement"
37+
]
38+
}'`
39+
ISSUE_NUMBER=`echo $RESULT | grep -oP 'number": \d+,' | grep -oP '\d+'`
40+
git add .
41+
git commit -a -m "closes #$ISSUE_NUMBER"
42+
fi
43+
done
44+
45+
cd ..
46+
cd OuterInnerResource.Pn.Test
47+
PACKAGES=('Microsoft.NET.Test.Sdk' 'NSubstitute' 'NUnit' 'NUnit3TestAdapter' 'NUnit.Analyzers' 'Testcontainers' 'Testcontainers.Mariadb')
48+
PROJECT_NAME='OuterInnerResource.Pn.Test.csproj'
49+
REPOSITORY='eform-angular-outer-inner-resource-plugin'
50+
1351
for PACKAGE_NAME in ${PACKAGES[@]}; do
1452

1553
OLD_VERSION=`dotnet list package | grep "$PACKAGE_NAME " | grep -oP ' \d\.\d+\.\d.*' | grep -oP ' \d.* \b' | xargs`

0 commit comments

Comments
 (0)