Skip to content

Instantly share code, notes, and snippets.

@diegosasw
Created November 9, 2019 11:19
Show Gist options
  • Save diegosasw/bf46258cb1ad0aa5241e8d1866b53f48 to your computer and use it in GitHub Desktop.
Save diegosasw/bf46258cb1ad0aa5241e8d1866b53f48 to your computer and use it in GitHub Desktop.
gitlab
#Stages
stages:
- ci
- pack
#Global variables
variables:
GITLAB_RUNNER_DOTNET_CORE: ocp-golden-images.artifactory.tuiwestern.eu/gitlab-runner-dotnet-core-22:2.2-1
NUGET_REPOSITORY: $ARTIFACTORY_NUGET_REPOSITORY
NUGET_FOLDER_NAME: nupkgs
#Docker image
image: $GITLAB_RUNNER_DOTNET_CORE
#Jobs
ci:
stage: ci
script:
- dotnet restore --no-cache --force
- dotnet build --configuration Release
- dotnet vstest *Tests/bin/Release/**/*Tests.dll
pack-beta-nuget:
stage: pack
script:
- export VERSION_SUFFIX=beta$CI_PIPELINE_ID
- dotnet pack *.sln --configuration Release --output $NUGET_FOLDER_NAME --version-suffix $VERSION_SUFFIX --include-symbols
- dotnet nuget push **/*.nupkg --source $NUGET_REPOSITORY
except:
- master
pack-nuget:
stage: pack
script:
- dotnet restore
- dotnet pack *.sln --configuration Release --output $NUGET_FOLDER_NAME
- dotnet nuget push **/*.nupkg --source $NUGET_REPOSITORY
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment