Set .gitlab-ci.yml to enable or configure SAST
parent
27634c3159
commit
21b51d4cbd
@ -1,58 +1,69 @@
|
|||||||
# This file is a template, and might need editing before it works on your project.
|
# You can override the included template(s) by including variable overrides
|
||||||
# see https://docs.gitlab.com/ee/ci/yaml/README.html for all available options
|
# See https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
|
||||||
|
# Note that environment variables can be set in several places
|
||||||
# you can delete this line if you're not using Docker
|
# See https://docs.gitlab.com/ee/ci/variables/#priority-of-environment-variables
|
||||||
image: busybox:latest
|
image: busybox:latest
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- dotnet restore
|
- dotnet restore
|
||||||
- dotnet nuget remove source gitlab || true
|
- dotnet nuget remove source gitlab || true
|
||||||
|
|
||||||
after_script:
|
|
||||||
|
|
||||||
nonreg:
|
nonreg:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
cd test/nuget.host.tests
|
cd test/nuget.host.tests
|
||||||
ASPNETCORE_ENVIRONMENT=Development dotnet test
|
ASPNETCORE_ENVIRONMENT=Development dotnet test
|
||||||
|
|
||||||
test2:
|
test2:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- echo "Do another parallel test here"
|
- echo "Do another parallel test here"
|
||||||
- echo "For example run a lint test"
|
- echo "For example run a lint test"
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- src/nuget-host/bin/Release/netcoreapp2.1/publish/
|
- src/nuget-host/bin/Release/netcoreapp2.1/publish/
|
||||||
when: always
|
when: always
|
||||||
script:
|
script:
|
||||||
- dotnet publish --configuration Release
|
- dotnet publish --configuration Release
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- src/*/bin/Release/*.nupkg
|
- src/*/bin/Release/*.nupkg
|
||||||
when: always
|
when: always
|
||||||
script:
|
script:
|
||||||
- dotnet pack -c Release
|
- dotnet pack -c Release
|
||||||
- dotnet nuget add source --name gitlab --username gitlab+deploy-token-2 --password $CI_JOB_TOKEN --store-password-in-clear-text "$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/packages/nuget/index.json"
|
- dotnet nuget add source --name gitlab --username gitlab+deploy-token-2 --password
|
||||||
- dotnet nuget push src/*/bin/Release/*.nupkg -s gitlab
|
$CI_JOB_TOKEN --store-password-in-clear-text "$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/packages/nuget/index.json"
|
||||||
|
- dotnet nuget push src/*/bin/Release/*.nupkg -s gitlab
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
pack:
|
pack:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- src/*/bin/Release/*.nupkg
|
- src/*/bin/Release/*.nupkg
|
||||||
when: always
|
when: always
|
||||||
script:
|
script:
|
||||||
- dotnet pack --configuration Release --no-restore
|
- dotnet pack --configuration Release --no-restore
|
||||||
- cd src/nuget-cli
|
- cd src/nuget-cli
|
||||||
- dotnet run push -s $NUGETSOURCE -k $NUGETSOURCEAPIKEY ../nuget-host/bin/Release/nuget-host.*.nupkg
|
- dotnet run push -s $NUGETSOURCE -k $NUGETSOURCEAPIKEY ../nuget-host/bin/Release/nuget-host.*.nupkg
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- test
|
||||||
|
- deploy
|
||||||
|
- review
|
||||||
|
- dast
|
||||||
|
- staging
|
||||||
|
- canary
|
||||||
|
- production
|
||||||
|
- incremental rollout 10%
|
||||||
|
- incremental rollout 25%
|
||||||
|
- incremental rollout 50%
|
||||||
|
- incremental rollout 100%
|
||||||
|
- performance
|
||||||
|
- cleanup
|
||||||
|
sast:
|
||||||
|
stage: test
|
||||||
|
include:
|
||||||
|
- template: Auto-DevOps.gitlab-ci.yml
|
||||||
|
Loading…
Reference in New Issue