From b6c8ace42a27a4d719ee98c0ac08b64bfcd1db71 Mon Sep 17 00:00:00 2001 From: gitlab Date: Wed, 24 Mar 2021 11:42:50 +0000 Subject: [PATCH 1/5] Vecchia demo da cancellare --- .gitlab-ci.yml => .gitlab-ci.yml_bck | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .gitlab-ci.yml => .gitlab-ci.yml_bck (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml_bck similarity index 100% rename from .gitlab-ci.yml rename to .gitlab-ci.yml_bck From 63558cbc9a9c3f336ba7ed334a99c89f53ea19bd Mon Sep 17 00:00:00 2001 From: gitlab Date: Wed, 24 Mar 2021 11:57:28 +0000 Subject: [PATCH 2/5] Prima versione --- .gitlab-ci.yml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..4c06514 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,52 @@ +variables: + NUGET_PATH: 'C:\Tools\nuget.exe' + MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe' + MSTEST_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\mstest.exe' + TEST_FOLDER: '.\test\bin\Release' + +stages: + - build + - test + - deploy + +before_script: + - '& "$env:NUGET_PATH" restore sourcecode\project.sln' # sourcecode\project.sln-This path includes project solution where is available and restoring + - '& "$env:NUGET_PATH" restore test\test.sln' # This path includes test solution where is available. and restoring + +build_job: + stage: build + only: + - developer #this branch will run on GitLab Runner and can change it. + script: + - '& "$env:MSBUILD_PATH" sourcecode\project.sln /p:DeployOnBuild=true /p:Configuration=Release /p:Platform="Any CPU" /P:PublishProfile=FolderProfile.pubxml' + - '& "$env:MSBUILD_PATH" test\test.sln /p:DeployOnBuild=true /p:Configuration=Release /p:Platform="Any CPU" /P:PublishProfile=FolderProfile.pubxml' + + 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\' + - '$env:TEST_FOLDER' + - '.\$env:MSTEST_PATH\*.*' + +test_job: + stage: test + only: + - developer #this branch will run on GitLab Runner and can change it. + script: + - .\test\test.bat #This is bat file, if the test are written in script format + + dependencies: + - build_job + +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 + + + dependencies: #after successfully build, only test stage will run + - build_job + - test_job From 22bda60baab0c598332d57ac145cbbe245c1c7f4 Mon Sep 17 00:00:00 2001 From: gitlab Date: Wed, 24 Mar 2021 13:24:46 +0000 Subject: [PATCH 3/5] Add new directory --- sourcecode/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sourcecode/.gitkeep diff --git a/sourcecode/.gitkeep b/sourcecode/.gitkeep new file mode 100644 index 0000000..e69de29 From fc45f8e7c8d2b381be900ccf97d08a0f78d38b31 Mon Sep 17 00:00:00 2001 From: gitlab Date: Wed, 24 Mar 2021 14:26:52 +0000 Subject: [PATCH 4/5] Update .gitlab-ci.yml --- .gitlab-ci.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4c06514..65095f2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,17 +1,15 @@ variables: NUGET_PATH: 'C:\Tools\nuget.exe' MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe' - MSTEST_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\mstest.exe' - TEST_FOLDER: '.\test\bin\Release' + stages: - build - - test - deploy before_script: - '& "$env:NUGET_PATH" restore sourcecode\project.sln' # sourcecode\project.sln-This path includes project solution where is available and restoring - - '& "$env:NUGET_PATH" restore test\test.sln' # This path includes test solution where is available. and restoring + build_job: stage: build @@ -19,22 +17,14 @@ build_job: - developer #this branch will run on GitLab Runner and can change it. script: - '& "$env:MSBUILD_PATH" sourcecode\project.sln /p:DeployOnBuild=true /p:Configuration=Release /p:Platform="Any CPU" /P:PublishProfile=FolderProfile.pubxml' - - '& "$env:MSBUILD_PATH" test\test.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\' - - '$env:TEST_FOLDER' - - '.\$env:MSTEST_PATH\*.*' -test_job: - stage: test - only: - - developer #this branch will run on GitLab Runner and can change it. - script: - - .\test\test.bat #This is bat file, if the test are written in script format dependencies: - build_job @@ -49,4 +39,3 @@ deploy_job: dependencies: #after successfully build, only test stage will run - build_job - - test_job From c876005a25a60f048790b60dcb4c9b997762c7c3 Mon Sep 17 00:00:00 2001 From: gitlab Date: Wed, 24 Mar 2021 14:28:00 +0000 Subject: [PATCH 5/5] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 65095f2..da6b8a3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,7 +35,3 @@ deploy_job: - 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 - - - dependencies: #after successfully build, only test stage will run - - build_job