update
This commit is contained in:
73
pipelines/gitlab_generic_packages.yml
Normal file
73
pipelines/gitlab_generic_packages.yml
Normal file
@@ -0,0 +1,73 @@
|
||||
stages:
|
||||
- build
|
||||
- package
|
||||
- publish
|
||||
|
||||
include:
|
||||
- template: Security/Secret-Detection.gitlab-ci.yml
|
||||
- project: 'developerdurp/yml'
|
||||
ref: 'main'
|
||||
file:
|
||||
- 'jobs/ocotopus.yml'
|
||||
- 'jobs/versioning.yml'
|
||||
- 'jobs/nuget.yml'
|
||||
- 'jobs/gitlab.yml'
|
||||
|
||||
secret_detection:
|
||||
stage: .pre
|
||||
rules:
|
||||
- when: always
|
||||
allow_failure: false
|
||||
|
||||
version:
|
||||
extends: .version
|
||||
stage: .pre
|
||||
rules:
|
||||
- when: always
|
||||
|
||||
build:
|
||||
extends: .gitlab-move-files
|
||||
stage: build
|
||||
artifacts:
|
||||
paths:
|
||||
- $CI_PROJECT_DIR/output
|
||||
|
||||
package:
|
||||
extends: .octo_package
|
||||
stage: package
|
||||
needs:
|
||||
- job: build
|
||||
artifacts: true
|
||||
- job: version
|
||||
artifacts: true
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH =~ '/^release/'
|
||||
- if: $CI_COMMIT_BRANCH =~ 'main'
|
||||
- when: never
|
||||
|
||||
upload:
|
||||
extends: .nuget_push
|
||||
stage: package
|
||||
needs:
|
||||
- job: version
|
||||
artifacts: true
|
||||
- job: package
|
||||
artifacts: true
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH =~ '/^release/'
|
||||
- if: $CI_COMMIT_BRANCH =~ 'main'
|
||||
- when: never
|
||||
|
||||
publish:
|
||||
extends: .octo_release
|
||||
stage: publish
|
||||
needs:
|
||||
- job: package
|
||||
artifacts: true
|
||||
- job: version
|
||||
artifacts: true
|
||||
- job: upload
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH =~ '/^release/'
|
||||
- if: $CI_COMMIT_BRANCH =~ 'main'
|
||||
- when: never
|
||||
9
scripts/gitlab/movefiles.sh
Normal file
9
scripts/gitlab/movefiles.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
#%%MULTILINE_YAML_START
|
||||
#move files to output
|
||||
mkdir $CI_PROJECT_DIR/output
|
||||
IFS=";" read -a names <<< $PROJECT_NAME
|
||||
for i in $names;
|
||||
do mkdir $CI_PROJECT_DIR/output/$i;
|
||||
cp -r $CI_PROJECT_DIR/$i $CI_PROJECT_DIR/output/;
|
||||
done
|
||||
9
scripts/nuget/push.sh
Normal file
9
scripts/nuget/push.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
#%%MULTILINE_YAML_START
|
||||
#Nuget Push
|
||||
IFS=";" read -a names <<< $PROJECT_NAME
|
||||
dotnet nuget add source "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/nuget/index.json" --name gitlab --username gitlab-ci-token --password $CI_JOB_TOKEN --store-password-in-clear-text
|
||||
count=0
|
||||
for i in ${names[@]};
|
||||
do dotnet nuget push "${CI_PROJECT_DIR}/packages/$i.$VERSION.nupkg" --source gitlab;
|
||||
done
|
||||
6
scripts/octopus/create_release.sh
Normal file
6
scripts/octopus/create_release.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
#%%MULTILINE_YAML_START
|
||||
#Octopus Create Release
|
||||
dotnet /octo/octo.dll create-release --project="$octoproject" --releaseNumber=$VERSION --server=https://octopus.internal.durp.info/ --apiKey=$OCTOAPI --packagesFolder=$CI_PROJECT_DIR/packages
|
||||
|
||||
|
||||
4
templates/gitlab.tpl.yml
Normal file
4
templates/gitlab.tpl.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
.gitlab-move-files:
|
||||
image: registry.durp.info/debian:latest
|
||||
script:
|
||||
- ./scripts/gitlab/movefiles.sh
|
||||
4
templates/nuget.tpl.yml
Normal file
4
templates/nuget.tpl.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
.nuget_push:
|
||||
image: registry.durp.info/dotnet/core/sdk:latest
|
||||
script:
|
||||
- ./scripts/nuget/push.sh
|
||||
@@ -1,7 +1,12 @@
|
||||
.octo_package:
|
||||
image: registry.durp.info/octopusdeploy/octo:latest
|
||||
script:
|
||||
- ./scripts/octo-pack.sh
|
||||
- ./scripts/octopus/pack.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- $CI_PROJECT_DIR/packages
|
||||
|
||||
.octo_release:
|
||||
image: registry.durp.info/octopusdeploy/octo:latest
|
||||
script:
|
||||
- ./scripts/octopus/pack.sh
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
variables:
|
||||
GIT_DEPTH: "0"
|
||||
script:
|
||||
- ./scripts/version-number.sh
|
||||
- ./scripts/gitversion/version.sh
|
||||
artifacts:
|
||||
reports:
|
||||
dotenv: version.env
|
||||
|
||||
Reference in New Issue
Block a user