Skip to content
Commits on Source (10)
stages:
- build
- release
- publish
- deploy
- update
.is_release_stable:
rules:
- if: $CI_COMMIT_TAG =~ $RELEASE_STABLE_PATTERN_RULE && $CI_CONTAINER_UPDATE == "false"
.is_release_preview:
rules:
- if: $CI_COMMIT_TAG =~ $RELEASE_PREVIEW_PATTERN_RULE && $CI_CONTAINER_UPDATE == "false"
.is_container_update_old:
rules:
- if: $CI_COMMIT_TAG =~ $RELEASE_STABLE_PATTERN_RULE && $CI_CONTAINER_UPDATE == "true" && $CI_CONTAINER_LATEST == "false"
.is_container_update_latest:
rules:
- if: $CI_COMMIT_TAG =~ $RELEASE_STABLE_PATTERN_RULE && $CI_CONTAINER_UPDATE == "true" && $CI_CONTAINER_LATEST == "true"
variables:
RELEASE_STABLE_PATTERN: '^([01-9]\d*)\.([0-9]\d*)\.([0-9]\d*)$'
RELEASE_STABLE_PATTERN_RULE: '/^([01-9]\d*)\.([0-9]\d*)\.([0-9]\d*)$/'
RELEASE_PREVIEW_PATTERN: '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?$'
RELEASE_PREVIEW_PATTERN_RULE: '/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?$/'
CI_CONTAINER_UPDATE: 'false'
CI_CONTAINER_UPDATE_LATEST: 'false'
image: registry.git.abfelbaum.dev/abfelbaum/images/dotnet/sdk:6.0
build:
stage: build
except:
- tags
- schedules
script:
- dotnet build -c Release
build-server:
stage: build
only:
- tags
script:
- dotnet build -c Release -o build Server/AbfiBin.Server.csproj
- dotnet publish -c Release -o publish Server/AbfiBin.Server.csproj
artifacts:
paths:
- publish/
build-cli:
stage: build
only:
- tags
except:
- pipelines
script:
- dotnet build -c Release -o build CommandLine/AbfiBin.CommandLine.csproj
- dotnet publish -c Release -o publish CommandLine/AbfiBin.CommandLine.csproj
- dotnet pack -c Release -o pack CommandLine/AbfiBin.CommandLine.csproj
artifacts:
paths:
- pack/
release-semantic-release:
stage: release
image: registry.git.abfelbaum.dev/abfelbaum/images/semantic-release:latest
when: manual
except:
- tags
- pipelines
- schedules
before_script:
- openssl aes-256-cbc -K $OPENSSL_KEY -iv $OPENSSL_IV -base64 -in $OPENSSL_FILE -out /tmp/git_gpg_keys.asc -d
- chmod 600 /tmp/git_gpg_keys.asc
- gpg --batch --yes --import /tmp/git_gpg_keys.asc
- git config commit.gpgsign true
- git config --global user.signingkey ${GPG_KEY_ID}
script:
- semantic-release
release-gitlab-release:
stage: release
image: registry.git.abfelbaum.dev/abfelbaum/images/gitlab-org/release-cli:latest
only:
- tags
except:
- pipelines
script:
- echo "Create release for $CI_COMMIT_TAG"
release:
name: $CI_COMMIT_TAG
description: $CI_COMMIT_MESSAGE
tag_name: $CI_COMMIT_TAG
publish-cli-gitlab:
stage: publish
only:
- tags
except:
- pipelines
dependencies:
- build-cli
before_script:
- 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
script:
- dotnet nuget push "pack/*.nupkg" --source gitlab
publish-cli-nuget:
stage: publish
only:
- tags
except:
- pipelines
dependencies:
- build-cli
script:
- dotnet nuget push "pack/*.nupkg" --api-key $NUGET_TOKEN --source "https://api.nuget.org/v3/index.json"
publish-server:
stage: publish
only:
- tags
dependencies:
- build-server
image: registry.git.abfelbaum.dev/abfelbaum/images/waypoint:latest
services:
- name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:dind
alias: docker
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- waypoint init
- waypoint build
artifacts:
public: false
paths:
- data.db
publish-server-latest:
stage: publish
rules:
- !reference [.is_release_stable, rules]
- !reference [.is_container_update_latest, rules]
dependencies:
- publish-server
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:latest
services:
- name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:dind
alias: docker
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker pull "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
- docker image tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" "$CI_REGISTRY_IMAGE:latest"
- docker push "$CI_REGISTRY_IMAGE:latest"
deploy-server-testing:
stage: deploy
rules:
- !reference [.is_release_preview, rules]
- !reference [.is_container_update_latest, rules]
dependencies:
- publish-server
image: registry.git.abfelbaum.dev/abfelbaum/images/waypoint:latest
script:
- waypoint deploy
environment:
name: AbfiBin Testing
deployment_tier: testing
url: https://testing.bin.abfelbaum.dev
deploy-server-production:
stage: deploy
dependencies:
- publish-server
rules:
- !reference [.is_release_stable, rules]
- !reference [.is_container_update_latest, rules]
image: registry.git.abfelbaum.dev/abfelbaum/images/waypoint:latest
script:
- waypoint deploy
environment:
name: AbfiBin
deployment_tier: production
url: https://bin.abfelbaum.dev
update:
stage: update
only:
- schedules
script:
- git tag --list --sort=version:refname | grep -E $RELEASE_STABLE_PATTERN | head -n -1 | tail -n +6 | xargs -I % curl --request POST --form "variables[CI_CONTAINER_UPDATE]=true" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/trigger/pipeline?token=$CI_JOB_TOKEN&ref=%"
- git tag --list --sort=version:refname | grep -E $RELEASE_STABLE_PATTERN | tail -n 1 | xargs -I % curl --request POST --form "variables[CI_CONTAINER_LATEST]=true" --form "variables[CI_CONTAINER_UPDATE]=true" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/trigger/pipeline?token=$CI_JOB_TOKEN&ref=%"
\ No newline at end of file
include:
- project: "abfelbaum/ci"
file:
- "dotnet/standard.yml"
- "dotnet/nuget.yml"
dotnet:build:tmp:
variables:
DOTNET_PROJECT_PATH: "Server/AbfiBin.Server.csproj"
dotnet:build:release:
variables:
DOTNET_PROJECT_PATH: "Server/AbfiBin.Server.csproj"
dotnet:pack:tmp:
variables:
DOTNET_PROJECT_PATH: "CommandLine/AbfiBin.CommandLine.csproj"
dotnet:pack:release:
variables:
DOTNET_PROJECT_PATH: "CommandLine/AbfiBin.CommandLine.csproj"
containers:update:legacy:
variables:
CONTAINER_UPDATE_MIN_VERSION: "1.2.3"
semgrep-sast:
variables:
SAST_EXCLUDED_PATHS: "spec,test,tests,tmp,build,publish,pack,bin/,obj"
......@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.2.3](https://git.abfelbaum.dev/abfelbaum/tools/abfibin/compare/1.2.2...1.2.3) (2022-12-26)
### Bug Fixes
* ci ([95db952](https://git.abfelbaum.dev/abfelbaum/tools/abfibin/commit/95db952f575c3fe0da28a7731f9c707dea30db21))
* excluded paths ([397c1b2](https://git.abfelbaum.dev/abfelbaum/tools/abfibin/commit/397c1b29cb4afaac9af4cef381e15b9b6dad0548))
* excluded paths in sast ([914d2ad](https://git.abfelbaum.dev/abfelbaum/tools/abfibin/commit/914d2ad1e1476cbb45f8afa093e305e0fb59c994))
* old versions getting built despite invalid ci configuration ([faf8d00](https://git.abfelbaum.dev/abfelbaum/tools/abfibin/commit/faf8d00c01ca4de7dfc9da76cf35506570b97fa6))
* semgrep needing too long ([2ad7e98](https://git.abfelbaum.dev/abfelbaum/tools/abfibin/commit/2ad7e9880b7b27a207b9ba83ed86f9b1da4aedff))
## [1.2.2](https://git.abfelbaum.dev/abfelbaum/tools/abfibin/compare/1.2.1...1.2.2) (2022-10-24)
......
// @ts-check
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
sidebar: [
{
type: 'autogenerated',
dirName: '.'
},
{
type: 'link',
label: 'GitLab project',
href: 'https://git.abfelbaum.dev/abfelbaum/tools/abfibin',
},
],
};
module.exports = sidebars;