2022-06-28 08:56:33 +02:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2022-07-15 08:28:21 +02:00
|
|
|
name: "Build Pipeline"
|
2022-06-28 08:56:33 +02:00
|
|
|
|
2022-07-15 08:28:21 +02:00
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
exclude:
|
|
|
|
- droneDocs/*
|
2022-06-28 08:56:33 +02:00
|
|
|
|
|
|
|
steps:
|
2022-07-15 08:28:21 +02:00
|
|
|
- name: "Pwsh FileLinter"
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
|
|
|
failure: ignore
|
|
|
|
environment:
|
|
|
|
EXCLUDE: "(.exe|.dll|.ico|.gitkeep|Vendor|.Tests.ps1)"
|
2022-06-28 08:56:33 +02:00
|
|
|
commands:
|
2022-07-15 08:28:21 +02:00
|
|
|
- |
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y file
|
|
|
|
|
2022-06-28 08:56:33 +02:00
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
2022-07-15 08:28:21 +02:00
|
|
|
Install-Module -Name 'DroneHelper' -Repository 'PSGallery' -ErrorAction 'Stop' -AllowPrerelease -Force;
|
|
|
|
Import-Module 'DroneHelper' -ErrorAction 'Stop';
|
2022-07-15 10:59:56 +02:00
|
|
|
Invoke-FileLinter
|
2022-06-28 08:56:33 +02:00
|
|
|
}"
|
|
|
|
|
2022-07-15 08:28:21 +02:00
|
|
|
- name: "ScriptAnalyzer"
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
2022-07-14 13:37:12 +02:00
|
|
|
failure: ignore
|
2022-06-28 08:56:33 +02:00
|
|
|
commands:
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
2022-07-15 08:28:21 +02:00
|
|
|
Install-Module -Name 'DroneHelper' -Repository 'PSGallery' -ErrorAction 'Stop' -AllowPrerelease -Force;
|
|
|
|
Import-Module -Name 'DroneHelper' -ErrorAction 'Stop';
|
|
|
|
Install-ModuleDependency;
|
|
|
|
Invoke-Linter
|
2022-06-28 08:56:33 +02:00
|
|
|
}"
|
|
|
|
|
2022-07-15 08:28:21 +02:00
|
|
|
- name: "Pester"
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
2022-07-14 13:37:12 +02:00
|
|
|
failure: ignore
|
2022-06-28 08:56:33 +02:00
|
|
|
commands:
|
2022-07-15 08:28:21 +02:00
|
|
|
- |
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y file
|
|
|
|
|
2022-06-28 08:56:33 +02:00
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
2022-07-15 08:28:21 +02:00
|
|
|
Install-Module -Name 'DroneHelper' -Repository 'PSGallery' -ErrorAction 'Stop' -AllowPrerelease -Force;
|
|
|
|
Import-Module -Name 'DroneHelper' -ErrorAction 'Stop';
|
|
|
|
Install-ModuleDependency;
|
|
|
|
Invoke-UnitTest -Verbosity 'Detailed' -ExcludeTag 'Integration'
|
2022-06-28 08:56:33 +02:00
|
|
|
}"
|
|
|
|
|
2022-07-15 08:28:21 +02:00
|
|
|
- name: "PRComment"
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
|
|
|
failure: ignore
|
|
|
|
environment:
|
|
|
|
GITEA_TOKEN:
|
|
|
|
from_secret: GITEA_TOKEN
|
|
|
|
CUSTOM_PIPELINE_STATE: true
|
|
|
|
LOG_FILES: "build/*.log"
|
|
|
|
commands:
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
|
|
|
Install-Module -Name 'DroneHelper' -Repository 'PSGallery' -ErrorAction 'Stop' -AllowPrerelease -Force;
|
|
|
|
Import-Module -Name 'DroneHelper' -ErrorAction 'Stop';
|
|
|
|
Send-PRComment
|
|
|
|
}"
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
include:
|
|
|
|
- pull_request
|
|
|
|
depends_on:
|
|
|
|
- "Pwsh FileLinter"
|
|
|
|
- "ScriptAnalyzer"
|
|
|
|
- "Pester"
|
2022-07-14 13:37:12 +02:00
|
|
|
|
2022-07-15 08:28:21 +02:00
|
|
|
- name: "buildState"
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
2022-07-14 13:37:12 +02:00
|
|
|
commands:
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
2022-07-15 08:28:21 +02:00
|
|
|
Install-Module -Name 'DroneHelper' -Repository 'PSGallery' -ErrorAction 'Stop' -AllowPrerelease -Force;
|
|
|
|
Import-Module -Name 'DroneHelper' -ErrorAction 'Stop';
|
|
|
|
Install-ModuleDependency;
|
|
|
|
Invoke-BuildState
|
2022-07-14 13:37:12 +02:00
|
|
|
}"
|
|
|
|
depends_on:
|
2022-07-15 08:28:21 +02:00
|
|
|
- "PRComment"
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: "Publish Pipeline"
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- "Build Pipeline"
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: BuildArtifacts
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
|
|
|
#failure: ignore
|
|
|
|
commands:
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
|
|
|
Install-Module -Name 'DroneHelper' -Repository 'PSGallery' -ErrorAction 'Stop' -AllowPrerelease -Force;
|
|
|
|
Import-Module -Name 'DroneHelper' -ErrorAction 'Stop';
|
|
|
|
Install-ModuleDependency;
|
|
|
|
Update-ModuleMeta -Verbose
|
|
|
|
}"
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
|
|
|
Install-Module -Name 'DroneHelper' -Repository 'PSGallery' -ErrorAction 'Stop' -AllowPrerelease -Force;
|
|
|
|
Import-Module -Name 'DroneHelper' -ErrorAction 'Stop';
|
|
|
|
Install-ModuleDependency;
|
2022-09-19 16:36:30 +02:00
|
|
|
New-BuildPackage -Verbose -AdditionalPath @('./src/Vendor', './src/openssl.conf'')
|
2022-07-15 08:28:21 +02:00
|
|
|
}"
|
|
|
|
|
|
|
|
- name: GiteaRelease
|
|
|
|
image: plugins/gitea-release
|
|
|
|
settings:
|
|
|
|
api_key:
|
|
|
|
from_secret: GITEA_TOKEN
|
|
|
|
base_url: https://gitea.ocram85.com
|
|
|
|
files:
|
|
|
|
- "bin/${DRONE_REPO_NAME}.zip"
|
|
|
|
- "bin/PSModule.zip"
|
|
|
|
title: "${DRONE_TAG}"
|
|
|
|
note: CHANGELOG.md
|
|
|
|
|
|
|
|
- name: "PublishModule"
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
|
|
|
|
#failure: ignore
|
|
|
|
environment:
|
|
|
|
NuGetToken:
|
|
|
|
from_secret: PSGallery
|
|
|
|
commands:
|
|
|
|
- |
|
|
|
|
pwsh -NonInteractive -c "& {
|
|
|
|
Install-Module -Name 'DroneHelper' -Repository 'PSGallery' -ErrorAction 'Stop' -AllowPrerelease -Force;
|
|
|
|
Import-Module -Name 'DroneHelper' -ErrorAction 'Stop';
|
|
|
|
Install-ModuleDependency;
|
|
|
|
Invoke-Publish -Verbose
|
|
|
|
}"
|