-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated pipeline. use github actions
- Loading branch information
Showing
14 changed files
with
125 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Pip.Services Datadog toolkit in .NET | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**' | ||
- '!README.md' | ||
|
||
jobs: | ||
Default: | ||
runs-on: ubuntu-16.04 | ||
if: "!contains(github.event.head_commit.message, '[skip-ci]')" | ||
steps: | ||
- uses: actions/checkout@main | ||
|
||
############# Prepare ############# | ||
|
||
- name: Install prereq and save build number | ||
id: build_info | ||
uses: pip-devops/actions/dotnet/prepare@v1 | ||
|
||
############# Build and test ############# | ||
|
||
- name: Build the component | ||
uses: pip-devops/actions/dotnet/build@v1 | ||
|
||
- name: Test the component | ||
uses: pip-devops/actions/dotnet/test@v1 | ||
|
||
############# Release ############# | ||
|
||
- name: Tag branch with the build number | ||
uses: tvdias/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: "v${{ steps.build_info.outputs.component_version }}-${{ steps.build_info.outputs.build_number }}" | ||
|
||
- name: Release binary artifacts | ||
uses: pip-devops/actions/dotnet/release@v1 | ||
with: | ||
nuget-key: ${{ secrets.NUGET_KEY }} | ||
|
||
############# Clear ############# | ||
|
||
- name: Clean up | ||
uses: pip-devops/actions/dotnet/clear@v1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,23 @@ | ||
#!/usr/bin/env pwsh | ||
|
||
$component = Get-Content -Path "component.json" | ConvertFrom-Json | ||
$buildImage="$($component.registry)/$($component.name):$($component.version)-build" | ||
$testImage="$($component.registry)/$($component.name):$($component.version)-test" | ||
$buildImage="$($component.registry)/$($component.name):$($component.version)-$($component.build)-build" | ||
$testImage="$($component.registry)/$($component.name):$($component.version)-$($component.build)-test" | ||
$docsImage="$($component.registry)/$($component.name):$($component.version)-$($component.build)-docs" | ||
|
||
# Clean up build directories | ||
if (Test-Path "obj") { | ||
Remove-Item -Recurse -Force -Path "obj" | ||
} | ||
if (Test-Path "dist") { | ||
Remove-Item -Recurse -Force -Path "dist" | ||
} | ||
if (Test-Path "src/bin") { | ||
Remove-Item -Recurse -Force -Path "src/bin" | ||
} | ||
if (Test-Path "src/obj") { | ||
Remove-Item -Recurse -Force -Path "src/obj" | ||
} | ||
if (Test-Path "test/bin") { | ||
Remove-Item -Recurse -Force -Path "test/bin" | ||
} | ||
if (Test-Path "test/obj") { | ||
Remove-Item -Recurse -Force -Path "test/obj" | ||
} | ||
if (Test-Path "*.nupkg") { | ||
Remove-Item -Force -Path "*.nupkg" | ||
} | ||
Get-ChildItem -Path "." -Include "obj" -Recurse | foreach($_) { Remove-Item -Force -Recurse $_.FullName } | ||
|
||
# Remove docker images | ||
docker rmi $buildImage --force | ||
docker rmi $testImage --force | ||
docker rmi $docsImage --force | ||
docker image prune --force | ||
docker rmi -f $(docker images -f "dangling=true" -q) # remove build container if build fails | ||
|
||
# Remove existed containers | ||
docker ps -a | Select-String -Pattern "Exit" | foreach($_) { docker rm $_.ToString().Split(" ")[0] } | ||
$exitedContainers = docker ps -a | Select-String -Pattern "Exit" | ||
foreach($c in $exitedContainers) { docker rm $c.ToString().Split(" ")[0] } | ||
|
||
# Remove unused volumes | ||
docker volume rm -f $(docker volume ls -f "dangling=true") |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
"name": "pip-services3-datadog", | ||
"registry": "pipdevs", | ||
"version": "3.0.0", | ||
"build": "0" | ||
"build": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env pwsh | ||
|
||
##Set-StrictMode -Version latest | ||
$ErrorActionPreference = "Stop" | ||
|
||
# Generate image and container names using the data in the "component.json" file | ||
$component = Get-Content -Path "component.json" | ConvertFrom-Json | ||
|
||
$docImage="$($component.registry)/$($component.name):$($component.version)-$($component.build)-docs" | ||
$container=$component.name | ||
|
||
# Remove build files | ||
if (Test-Path "./docs") { | ||
Remove-Item -Recurse -Force -Path "./docs/*" | ||
} else { | ||
New-Item -ItemType Directory -Force -Path "./docs" | ||
} | ||
|
||
# Build docker image | ||
docker build -f docker/Dockerfile.docgen -t $docImage . | ||
|
||
# Create and copy compiled files, then destroy the container | ||
docker create --name $container $docImage | ||
docker cp "$($container):/dotnet/app/html/." ./docs | ||
docker rm $container | ||
|
||
if (!(Test-Path "./docs")) { | ||
Write-Host "docs folder doesn't exist in root dir. Build failed. Watch logs above." | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM tsgkadot/docker-doxygen | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN doxygen Doxyfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,3 @@ services: | |
context: .. | ||
dockerfile: docker/Dockerfile.test | ||
image: ${IMAGE:-pipdevs/test} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters