commit 1e660823b1d8159ece4be606b0b34dab1cde5d78
Author: Milan Hotovec <silent@students.zcu.cz>
Date:   Mon Apr 5 23:20:01 2021 +0200

    Deploy test
    @deploy

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ead37b1..2225bf3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,7 +1,6 @@
 #CI_COMMIT_MESSAGE is header and description
 #Only childs are ANDed and child restrictions are ORed
 variables:
-  VSTEST_PATH: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe"
   RELEASE_FOLDER: "C:\\Users\\cztestman01\\OneDrive - Leuze electronic GmbH + Co. KG\\00_BUILDS\\DummyProject"
 stages:
   - build
@@ -94,34 +93,185 @@ test_job_linux:
       - $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i   #auto trigger for remote merge requests from command
   script:
     - 'dotnet test'    #Run tests using console mode of MSTest (Unit)
-##Job for release public
-#release_public_job:
-#  stage: release
-#  tags:
-#    - csharp
-#    - win10
-#  only:
-#    refs:
-#      - master
-#    variables:
-#      - $CI_COMMIT_MESSAGE =~ /@deploy/i                        #manual trigger for testing
-#      - $CI_COMMIT_MESSAGE =~ /See merge request/               #auto trigger for merge requests from GitLab
-#      - $CI_COMMIT_MESSAGE =~ /merge branch/i                   #auto trigger for merge requests from command
-#      - $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i   #auto trigger for remote merge requests from command
-#  script:
-#    - '$today = (Get-Date).ToString("yyyy_MM_dd-HH_mm_ss")'
-#    - '& mkdir "$RELEASE_FOLDER\$today"'
-#    - '& echo "Build branch: $CI_COMMIT_BRANCH`n" > $RELEASE_FOLDER\$today\buildLog.txt'
-#    - '& echo "Pipeline: $CI_PIPELINE_URL`n" >> $RELEASE_FOLDER\$today\buildLog.txt'
-#    - '& echo "Pipeline trigger source: $CI_PIPELINE_SOURCE`n" >> $RELEASE_FOLDER\$today\buildLog.txt'
-#    - '& echo "Runner: $CI_RUNNER_DESCRIPTION`n" >> $RELEASE_FOLDER\$today\buildLog.txt'
-#    - '& echo "Description: $CI_COMMIT_MESSAGE`n" >> $RELEASE_FOLDER\$today\buildLog.txt'
-#    - '& xcopy /y /s ".\DummyProject\bin\*.*" "$RELEASE_FOLDER\$today"'
-#  artifacts:
-#    name: "Deploy artifact"
-#    expire_in: 30 days
-#    paths:
-#      - '.\DummyProject\DummyProject\bin\'
-#  dependencies:
-#    - build_job     #Build must be ok and using this, artifacts will be used
-#    - test_job      #Only when tests are OK
\ No newline at end of file
+#Job for release manual windows
+release_manual_job_windows:
+  stage: release
+  needs: ["test_job_windows"]
+  tags:
+    - dotnet
+    - windows10
+  only:
+    refs:
+      - branches
+    variables:
+      - $CI_COMMIT_MESSAGE =~ /@deploy/i                        #manual trigger for testing
+  script:
+    - 'dotnet publish'
+    - '$today = (Get-Date).ToString("yyyy_MM_dd-HH_mm_ss")'
+    - '& mkdir "deploy/modules"'
+    - '& echo "Build branch: $today`n" > deploy\00_buildLog.txt'
+    - '& echo "Build branch: $CI_COMMIT_BRANCH`n" >> deploy\00_buildLog.txt'
+    - '& echo "Pipeline: $CI_PIPELINE_URL`n" >> deploy\00_buildLog.txt'
+    - '& echo "Pipeline trigger source: $CI_PIPELINE_SOURCE`n" >> deploy\00_buildLog.txt'
+    - '& echo "Runner: $CI_RUNNER_DESCRIPTION`n" >> deploy\00_buildLog.txt'
+    - '& echo "Description: $CI_COMMIT_MESSAGE`n" >> deploy\00_buildLog.txt'
+    - '& xcopy /y /s ".\src\Presentation\Leuze.App\bin\Debug\net5.0\*.*" "deploy"'
+    - '& xcopy /y /s ".\src\Presentation\Leuze.Modules\net5.0\*.*" "deploy\modules"'
+  artifacts:
+    name: "Manual Deploy artifact - windows"
+    expire_in: 30 days
+    paths:
+      - '.\deploy'
+#Job for release developmental windows
+release_developmental_job_windows:
+  stage: release
+  needs: ["test_job_windows"]
+  tags:
+    - dotnet
+    - windows10
+  only:
+    refs:
+      - dev
+    variables:
+      - $CI_COMMIT_MESSAGE =~ /See merge request/               #auto trigger for merge requests from GitLab
+      - $CI_COMMIT_MESSAGE =~ /merge branch/i                   #auto trigger for merge requests from command
+      - $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i   #auto trigger for remote merge requests from command
+  script:
+    - 'dotnet publish'
+    - '$today = (Get-Date).ToString("yyyy_MM_dd-HH_mm_ss")'
+    - '& mkdir "deploy/modules"'
+    - '& echo "Build branch: $today`n" > deploy\00_buildLog.txt'
+    - '& echo "Build branch: $CI_COMMIT_BRANCH`n" >> deploy\00_buildLog.txt'
+    - '& echo "Pipeline: $CI_PIPELINE_URL`n" >> deploy\00_buildLog.txt'
+    - '& echo "Pipeline trigger source: $CI_PIPELINE_SOURCE`n" >> deploy\00_buildLog.txt'
+    - '& echo "Runner: $CI_RUNNER_DESCRIPTION`n" >> deploy\00_buildLog.txt'
+    - '& echo "Description: $CI_COMMIT_MESSAGE`n" >> deploy\00_buildLog.txt'
+    - '& xcopy /y /s ".\src\Presentation\Leuze.App\bin\Debug\net5.0\*.*" "deploy"'
+    - '& xcopy /y /s ".\src\Presentation\Leuze.Modules\net5.0\*.*" "deploy\modules"'
+  artifacts:
+    name: "Developmental Deploy artifact - windows"
+    expire_in: 30 days
+    paths:
+      - '.\deploy'
+#Job for release master windows
+release_master_job_windows:
+  stage: release
+  needs: ["test_job_windows"]
+  tags:
+    - dotnet
+    - windows10
+  only:
+    refs:
+      - master
+    variables:
+      - $CI_COMMIT_MESSAGE =~ /See merge request/               #auto trigger for merge requests from GitLab
+      - $CI_COMMIT_MESSAGE =~ /merge branch/i                   #auto trigger for merge requests from command
+      - $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i   #auto trigger for remote merge requests from command
+  script:
+    - 'dotnet publish'
+    - '$today = (Get-Date).ToString("yyyy_MM_dd-HH_mm_ss")'
+    - '& mkdir "deploy/modules"'
+    - '& echo "Build branch: $today`n" > deploy\00_buildLog.txt'
+    - '& echo "Build branch: $CI_COMMIT_BRANCH`n" >> deploy\00_buildLog.txt'
+    - '& echo "Pipeline: $CI_PIPELINE_URL`n" >> deploy\00_buildLog.txt'
+    - '& echo "Pipeline trigger source: $CI_PIPELINE_SOURCE`n" >> deploy\00_buildLog.txt'
+    - '& echo "Runner: $CI_RUNNER_DESCRIPTION`n" >> deploy\00_buildLog.txt'
+    - '& echo "Description: $CI_COMMIT_MESSAGE`n" >> deploy\00_buildLog.txt'
+    - '& xcopy /y /s ".\src\Presentation\Leuze.App\bin\Debug\net5.0\*.*" "deploy"'
+    - '& xcopy /y /s ".\src\Presentation\Leuze.Modules\net5.0\*.*" "deploy\modules"'
+  artifacts:
+    name: "Master Deploy artifact - windows"
+    expire_in: 30 days
+    paths:
+      - '.\deploy'
+#Job for release manual linux
+release_manual_job_linux:
+  stage: release
+  needs: ["test_job_linux"]
+  tags:
+    - dotnet
+    - linux
+  only:
+    refs:
+      - branches
+    variables:
+      - $CI_COMMIT_MESSAGE =~ /@deploy/i                        #manual trigger for testing
+  script:
+    - 'dotnet publish'
+    - 'today=date'
+    - '& mkdir -p "./deploy/modules"'
+    - '& echo "Build branch: $today`n" > ./deploy/00_buildLog.txt'
+    - '& echo "Build branch: $CI_COMMIT_BRANCH`n" >> ./deploy/00_buildLog.txt'
+    - '& echo "Pipeline: $CI_PIPELINE_URL`n" >> ./deploy/00_buildLog.txt'
+    - '& echo "Pipeline trigger source: $CI_PIPELINE_SOURCE`n" >> ./deploy/00_buildLog.txt'
+    - '& echo "Runner: $CI_RUNNER_DESCRIPTION`n" >> ./deploy/00_buildLog.txt'
+    - '& echo "Description: $CI_COMMIT_MESSAGE`n" >> ./deploy/00_buildLog.txt'
+    - '& cp -r "./src/Presentation/Leuze.App/bin\Debug/net5.0/." "./deploy"'
+    - '& cp -r "./src/Presentation/Leuze.Modules/net5.0/." "./deploy/modules"'
+  artifacts:
+    name: "Manual Deploy artifact - linux"
+    expire_in: 30 days
+    paths:
+      - './deploy'
+#Job for release developmental linux
+release_developmental_job_linux:
+  stage: release
+  needs: ["test_job_linux"]
+  tags:
+    - dotnet
+    - linux
+  only:
+    refs:
+      - dev
+    variables:
+      - $CI_COMMIT_MESSAGE =~ /See merge request/               #auto trigger for merge requests from GitLab
+      - $CI_COMMIT_MESSAGE =~ /merge branch/i                   #auto trigger for merge requests from command
+      - $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i   #auto trigger for remote merge requests from command
+  script:
+    - 'dotnet publish'
+    - 'today=date'
+    - '& mkdir -p "./deploy/modules"'
+    - '& echo "Build branch: $today`n" > ./deploy/00_buildLog.txt'
+    - '& echo "Build branch: $CI_COMMIT_BRANCH`n" >> ./deploy/00_buildLog.txt'
+    - '& echo "Pipeline: $CI_PIPELINE_URL`n" >> ./deploy/00_buildLog.txt'
+    - '& echo "Pipeline trigger source: $CI_PIPELINE_SOURCE`n" >> ./deploy/00_buildLog.txt'
+    - '& echo "Runner: $CI_RUNNER_DESCRIPTION`n" >> ./deploy/00_buildLog.txt'
+    - '& echo "Description: $CI_COMMIT_MESSAGE`n" >> ./deploy/00_buildLog.txt'
+    - '& cp -r "./src/Presentation/Leuze.App/bin\Debug/net5.0/." "./deploy"'
+    - '& cp -r "./src/Presentation/Leuze.Modules/net5.0/." "./deploy/modules"'
+  artifacts:
+    name: "Developmental Deploy artifact - linux"
+    expire_in: 30 days
+    paths:
+      - './deploy'
+#Job for release master linux
+release_master_job_linux:
+  stage: release
+  needs: ["test_job_linux"]
+  tags:
+    - dotnet
+    - linux
+  only:
+    refs:
+      - master
+    variables:
+      - $CI_COMMIT_MESSAGE =~ /See merge request/               #auto trigger for merge requests from GitLab
+      - $CI_COMMIT_MESSAGE =~ /merge branch/i                   #auto trigger for merge requests from command
+      - $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i   #auto trigger for remote merge requests from command
+  script:
+    - 'dotnet publish'
+    - 'today=date'
+    - '& mkdir -p "./deploy/modules"'
+    - '& echo "Build branch: $today`n" > ./deploy/00_buildLog.txt'
+    - '& echo "Build branch: $CI_COMMIT_BRANCH`n" >> ./deploy/00_buildLog.txt'
+    - '& echo "Pipeline: $CI_PIPELINE_URL`n" >> ./deploy/00_buildLog.txt'
+    - '& echo "Pipeline trigger source: $CI_PIPELINE_SOURCE`n" >> ./deploy/00_buildLog.txt'
+    - '& echo "Runner: $CI_RUNNER_DESCRIPTION`n" >> ./deploy/00_buildLog.txt'
+    - '& echo "Description: $CI_COMMIT_MESSAGE`n" >> ./deploy/00_buildLog.txt'
+    - '& cp -r "./src/Presentation/Leuze.App/bin\Debug/net5.0/." "./deploy"'
+    - '& cp -r "./src/Presentation/Leuze.Modules/net5.0/." "./deploy/modules"'
+  artifacts:
+    name: "Master Deploy artifact - linux"
+    expire_in: 30 days
+    paths:
+      - './deploy'
\ No newline at end of file
