2020-06-18 14:24:33 +02:00
|
|
|
.shared_windows_runners:
|
|
|
|
tags:
|
|
|
|
- windows
|
|
|
|
|
|
|
|
image: mcr.microsoft.com/dotnet/core/sdk
|
|
|
|
|
|
|
|
uptool:
|
2020-06-18 15:08:58 +02:00
|
|
|
extends:
|
|
|
|
- .shared_windows_runners
|
2020-06-18 14:24:33 +02:00
|
|
|
stage: deploy
|
2020-06-18 14:35:17 +02:00
|
|
|
script: |
|
2020-08-31 21:01:58 +02:00
|
|
|
mkdir i
|
|
|
|
cd i
|
|
|
|
$(new-object System.Net.WebClient).DownloadFile("https://gitlab.com/JFronny/UpTool2/-/jobs/artifacts/master/raw/Installer-generic.zip?job=uptool", "$($(pwd).Path)\Install.zip")
|
|
|
|
& "C:\Program Files\7-Zip\7z.exe" x .\Install.zip
|
2020-08-31 21:18:03 +02:00
|
|
|
.\Installer.exe --basic i -p
|
2020-08-31 21:01:58 +02:00
|
|
|
cd ..
|
|
|
|
rm -R i
|
|
|
|
$Env:Path="$Env:Path;$Env:APPDATA\UpTool2\Install"
|
|
|
|
uptool --basic add-repo DevTools https://gitlab.com/JFronny/UpTool2/-/snippets/2010392/raw
|
|
|
|
uptool --basic update
|
|
|
|
uptool --basic install "UpTool2 package tools"
|
|
|
|
$Env:Path="$Env:Path;$Env:APPDATA\UpTool2\Apps\0e35d154-d0d3-45e0-b080-62f521263a44\app"
|
|
|
|
|
2020-06-18 15:17:29 +02:00
|
|
|
mkdir .\build
|
2020-06-18 16:44:36 +02:00
|
|
|
dotnet publish -o .\build -c Release
|
2020-06-18 14:35:17 +02:00
|
|
|
$file = Get-Item $(Resolve-Path .\build\*.exe).Path
|
2020-08-31 21:01:58 +02:00
|
|
|
pkgtool build --binDir build --mainBin $file --packageFile .\package.zip --noLogo
|
2020-06-18 14:35:17 +02:00
|
|
|
$asm = $([Reflection.Assembly]::LoadFile($file.DirectoryName + "\" + $file.BaseName + ".dll"))
|
|
|
|
$asmver = $asm.GetName().Version.ToString()
|
2020-06-18 15:36:30 +02:00
|
|
|
[System.XML.XMLDocument]$xml=New-Object System.XML.XMLDocument
|
|
|
|
[System.XML.XMLElement]$app=$xml.CreateElement("app")
|
|
|
|
$xml.appendChild($app)
|
|
|
|
$app.appendChild($xml.CreateElement("Name")).InnerText = $asm.GetName().Name
|
|
|
|
$app.appendChild($xml.CreateElement("Description")).InnerText = "Calculate grades for students"
|
2020-06-18 15:56:58 +02:00
|
|
|
$app.appendChild($xml.CreateElement("Version")).InnerText = $asmver
|
2020-06-18 15:36:30 +02:00
|
|
|
$app.appendChild($xml.CreateElement("ID")).InnerText = "c8119098-ec7f-4fb3-8668-9e81915b112d"
|
2020-06-18 16:10:55 +02:00
|
|
|
$app.appendChild($xml.CreateElement("File")).InnerText = $CI_PROJECT_URL + "/-/jobs/" + $CI_JOB_ID + "/artifacts/raw/package.zip"
|
2020-06-18 15:36:30 +02:00
|
|
|
$app.appendChild($xml.CreateElement("Hash")).InnerText = $(Get-FileHash .\package.zip).Hash
|
|
|
|
$app.appendChild($xml.CreateElement("MainFile")).InnerText = $file.Name
|
|
|
|
echo NULL > app.xml
|
|
|
|
$xml.save($(gi .\app.xml).Fullname)
|
2020-06-18 14:24:33 +02:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-06-18 15:36:30 +02:00
|
|
|
- package.zip
|
|
|
|
- app.xml
|
2020-06-18 14:24:33 +02:00
|
|
|
only:
|
|
|
|
- master
|