35 Commits

Author SHA1 Message Date
Samuele Locatelli 95114a49cb fix tipo versione 2021-04-16 08:31:09 +02:00
Samuele Locatelli c385f5d158 Merge branch 'develop' 2021-04-16 08:28:20 +02:00
Samuele Locatelli b26361854c fix version upload 2021-04-16 08:21:50 +02:00
Samuele Locatelli 4b64189436 Merge remote-tracking branch 'origin/develop' into develop 2021-04-16 08:17:34 +02:00
Samuele Locatelli 3914d7b7c7 update gitlab push 2021-04-16 08:16:16 +02:00
Samuele E. Locatelli e1acd72ac5 update version variable 2021-04-15 21:44:36 +02:00
Samuele E. Locatelli 83150a380f aggiunto check parametri upload nexus x check 2021-04-15 21:41:41 +02:00
Samuele E. Locatelli 1b51d4f4b9 aggiunta build anche x Master 2021-04-15 21:37:30 +02:00
Samuele E. Locatelli f595c32852 Merge branch 'develop' 2021-04-15 21:33:57 +02:00
Samuele E. Locatelli 5a9578f7b0 Merge branch 'develop' 2021-04-15 21:33:36 +02:00
Samuele E. Locatelli 77639e28e6 update hash file conf 2021-04-15 21:29:04 +02:00
Samuele Locatelli 8ac5c040e7 altro syntax... 2021-04-15 20:14:59 +02:00
Samuele Locatelli 39bbfb0320 fix hash path 2021-04-15 20:11:54 +02:00
Samuele Locatelli b98c484499 fix hash 2021-04-15 20:09:43 +02:00
Samuele Locatelli 3a3beb598d aggiunto upload hash 2021-04-15 20:02:47 +02:00
Samuele Locatelli 7b7cb9006f aggiunto HASH calculation 2021-04-15 19:51:47 +02:00
Samuele Locatelli 1e6cf0fb84 fix file name path 2021-04-15 19:40:45 +02:00
Samuele Locatelli 2a4ff472c1 modifica CURL 2021-04-15 19:38:09 +02:00
Samuele Locatelli c2ff14fa85 modifica chiamata curl 2021-04-15 19:22:50 +02:00
Samuele Locatelli 8b83a06a0e fix vers num + test nexus upload 2021-04-15 19:17:50 +02:00
Samuele Locatelli 9acb7e0e9e force remove dir 2021-04-15 19:13:58 +02:00
Samuele Locatelli 01207d444e nuovo test zip 2021-04-15 19:11:52 +02:00
Samuele Locatelli 9ffac4a880 test x directory esistente 2021-04-15 14:45:47 +02:00
Samuele Locatelli a2f19b6882 ignore error on delete 2021-04-15 14:35:18 +02:00
Samuele Locatelli 212eb23bcf echo cmd rem + zip 2021-04-15 14:33:16 +02:00
Samuele Locatelli b4913300c2 test out dir 2021-04-15 14:30:42 +02:00
Samuele Locatelli 05817acb27 sintassi remove item 2021-04-15 14:27:11 +02:00
Samuele Locatelli dc3dbdcd99 fix cleanup 2021-04-15 14:25:00 +02:00
Samuele Locatelli 7df1d1953c cambio sintassi zip 2021-04-15 14:23:06 +02:00
Samuele Locatelli 7c28dfaccb ancora update yaml 2021-04-15 14:21:36 +02:00
Samuele Locatelli c5be77e7a6 test YAML 2021-04-15 14:17:37 +02:00
Samuele Locatelli 4f6b4366f3 update componente ZIP 2021-04-15 11:57:32 +02:00
Samuele Locatelli 597c84bd1d test gitlab x upload develop/master su nexus 2021-04-15 10:53:40 +02:00
Samuele Locatelli c891687578 typo proj 2021-04-14 15:29:23 +02:00
Samuele Locatelli 377d7da945 test gitlab pipeline 2021-04-14 15:27:56 +02:00
3 changed files with 108 additions and 27 deletions
+103 -22
View File
@@ -1,37 +1,118 @@
variables:
NUGET_PATH: 'C:\Tools\nuget.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
EXE_RELEASE_FOLDER: 'c:\Projetcs\Compiled\GPW\Release'
DEPLOY_FOLDER: 'c:\Projects\Deploy\GPW\Builds'
NEXUS_PATH: 'LPA/LPA'
APP_NAME: 'LPA'
VERS_MAIN: '1.2'
NEW_REL: ''
OUTPUT_DIR: ''
# helper x fix pacchetti nuget da repo locale nexus.steamware.net
.nuget-fix: &nuget-fix
- |
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
if ($hasSource -eq 0) {
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
} else {
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
}
echo $hasSource
# helper x fix version number
.version-fix: &version-fix
- |
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date format yyMM)+"."+$CI_PIPELINE_IID
$contenuto = Get-Content -path 'VersGen\VersGen.cs' -Raw
$newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL
$newContenuto | Set-Content -Path 'VersGen\VersGen.cs'
echo "Set vers: $env:NEW_REL"
# helper pulizia files zip
.cleanup-zip: &cleanup-zip
- |
$env:OUTPUT_DIR = "Releases\" + $CI_COMMIT_BRANCH + "\*"
if ((Test-Path $env:OUTPUT_DIR))
{
Remove-Item $env:OUTPUT_DIR -Force -Recurse -ErrorAction Ignore
}
echo "Clening ZIP dir: $env:OUTPUT_DIR"
# helper creazione files zip
.zipper: &zipper
- |
$7zipPath = $env:ProgramFiles+"\7-Zip\7z.exe"
if (-not (Test-Path -Path $7zipPath -PathType Leaf)) {
throw "7 zip file '$7zipPath' not found"
}
Set-Alias 7zip $7zipPath
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
$Source = "LPA\bin\*"
7zip a -tzip $Target $Source
echo "called ZIP $Source --> $Target"
# helper creazione hash files
.hashBuild: &hashBuild
- |
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
$MD5 = Get-FileHash $Target -Algorithm MD5
$SHA1 = Get-FileHash $Target -Algorithm SHA1
New-Item $Target".md5"
New-Item $Target".sha1"
$MD5.Hash | Set-Content -Path $Target".md5"
$SHA1.Hash | Set-Content -Path $Target".sha1"
echo "Created HASH files for $Target"
# helper x send su NEXUS
.nexusUpload: &nexusUpload
- |
Set-Alias mCurl C:\Windows\system32\curl.exe
if($CI_COMMIT_BRANCH -eq "master")
{
$version = "stable"
}
else
{
$version = "unstable"
}
$File2Send = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
mCurl -v -u GitLab:viaDante16 --upload-file $File2Send http://nexus.steamware.net/repository/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip
mCurl -v -u GitLab:viaDante16 --upload-file $File2Send".md5" http://nexus.steamware.net/repository/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip".md5"
mCurl -v -u GitLab:viaDante16 --upload-file $File2Send".sha1" http://nexus.steamware.net/repository/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip".sha1"
# mCurl -v -u $env:NEXUS_USER:$env:NEXUS_PASSWD --upload-file bin/release/$env:APP_NAME.zip $env:NEXUS_SERVER/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip
stages:
- build
- deploy
before_script:
- '& "$env:NUGET_PATH" restore sourcecode\project.sln' # sourcecode\project.sln-This path includes project solution where is available and restoring
build_job:
stage: build
only:
- developer #this branch will run on GitLab Runner and can change it.
# rules:
# - if: '$CI_COMMIT_BRANCH == "develop"'
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore LPA.sln' # path alla solution corrente
- *version-fix
script:
- '& "$env:MSBUILD_PATH" sourcecode\project.sln /p:DeployOnBuild=true /p:Configuration=Release /p:Platform="Any CPU" /P:PublishProfile=FolderProfile.pubxml'
- bat "\$env:MSBUILD_PATH" LPA/LPA.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m"
artifacts:
expire_in: 365 days #artifcats will be stored only 365 days after this it will expire
paths:
- '.\sourcecode\project.sln\bin\Release\Publish\'
- '.\sourcecode\project.sln\bin\Publish\'
dependencies:
- build_job
- '& "$env:MSBUILD_PATH" LPA\LPA.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m'
deploy_job:
stage: deploy
only:
- developer #this branch will run on GitLab Runner and can change it.
script:
- 'xcopy /y /s ".\sourcecode\project.sln\bin\Release\Publish\*.*" "C:\solutionDir"' #Path where you want to store the solution
# rules:
# - if: '$CI_COMMIT_BRANCH == "master"'
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore LPA.sln' # path alla solution corrente
- *version-fix
- *cleanup-zip
script:
- '& "$env:MSBUILD_PATH" LPA\LPA.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m'
- *zipper
- *hashBuild
- *nexusUpload
needs: ["build_job"]
+3 -3
View File
@@ -3,7 +3,7 @@
// the next time this code is regenerated.
//
using System.Reflection;
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyCopyright("Steamware © 2006-2020")]
[assembly: AssemblyVersion("0.0.0.0")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyCopyright("Steamware © 2006-2021")]
[assembly: AssemblyCompany("Steamware")]
+2 -2
View File
@@ -4,7 +4,7 @@
// the next time this code is regenerated.
//
using System.Reflection;
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("0.0.0.0")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyCopyright("Steamware © 2006-<#= DateTime.Now.Year #>")]
[assembly: AssemblyCompany("Steamware")]