-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #497 from dlcs/develop
Merge develop back to main
- Loading branch information
Showing
1,257 changed files
with
91,795 additions
and
12,858 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
pipeline { | ||
agent { | ||
node { | ||
label 'master' | ||
} | ||
} | ||
options { | ||
buildDiscarder(logRotator(numToKeepStr: '100')) | ||
} | ||
stages { | ||
stage('Fetch') { | ||
steps { | ||
deleteDir() | ||
checkout scm: [ | ||
$class: 'GitSCM', | ||
branches: scm.branches, | ||
doGenerateSubmoduleConfigurations: false, | ||
extensions: [ | ||
[$class: 'SubmoduleOption', | ||
disableSubmodules: false, | ||
parentCredentials: true, | ||
recursiveSubmodules: true, | ||
reference: '', | ||
trackingSubmodules: false | ||
] | ||
], | ||
submoduleCfg: [], | ||
userRemoteConfigs: scm.userRemoteConfigs | ||
] | ||
} | ||
} | ||
stage('Bounce') { | ||
steps { | ||
sh "curl --data '{\"text\": \"Jenkins bouncing ${REGION}/${CLUSTER}/${SERVICE}...\"}' ${SLACK_WEBHOOK_URL}" | ||
script{ | ||
for (s in env.SERVICE.split(',')) { | ||
bounceService(s) | ||
} | ||
} | ||
sh "curl --data '{\"text\": \"${REGION}/${CLUSTER}/${SERVICE} is now stable\"}' ${SLACK_WEBHOOK_URL}" | ||
} | ||
} | ||
} | ||
} | ||
|
||
def bounceService(String service) { | ||
sh "aws ecs update-service --force-new-deployment --cluster ${CLUSTER} --service ${service} --region ${REGION}" | ||
sh "aws ecs wait services-stable --cluster ${CLUSTER} --services ${service} --region ${REGION}" | ||
} |
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,81 @@ | ||
pipeline { | ||
agent { | ||
node { | ||
label 'master' | ||
} | ||
} | ||
options { | ||
buildDiscarder(logRotator(numToKeepStr: '100')) | ||
} | ||
stages { | ||
stage('Fetch') { | ||
steps { | ||
deleteDir() | ||
checkout scm: [ | ||
$class: 'GitSCM', | ||
branches: scm.branches, | ||
doGenerateSubmoduleConfigurations: false, | ||
extensions: [ | ||
[$class: 'SubmoduleOption', | ||
disableSubmodules: false, | ||
parentCredentials: true, | ||
recursiveSubmodules: true, | ||
reference: '', | ||
trackingSubmodules: false | ||
] | ||
], | ||
submoduleCfg: [], | ||
userRemoteConfigs: scm.userRemoteConfigs | ||
] | ||
} | ||
} | ||
stage('Install') { | ||
steps { | ||
sh "apt-get update" | ||
sh "apt install -y libunwind8 gettext apt-transport-https python3-pip" | ||
sh "pip3 install awscli" | ||
sh "curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 6.0" | ||
} | ||
} | ||
stage('Test') { | ||
steps { | ||
sh "~/.dotnet/dotnet test protagonist.sln --logger trx --filter 'Category!=Database&Category!=Manual&Category!=Integration'" | ||
step([$class: 'MSTestPublisher', testResultsFile:"**/*.trx", failOnError: true, keepLongStdio: true]) | ||
} | ||
} | ||
stage('Image') { | ||
steps { | ||
sh "docker build -t ${DOCKER_IMAGE}:latest -f ${DOCKER_FILE} ." | ||
} | ||
} | ||
stage('Tag') { | ||
steps { | ||
sh "docker tag ${DOCKER_IMAGE}:latest ${DOCKER_IMAGE}:`git rev-parse HEAD`" | ||
sh "docker tag ${DOCKER_IMAGE}:latest ${DOCKER_IMAGE}:production" | ||
} | ||
} | ||
stage('Push') { | ||
steps { | ||
sh "\$(aws ecr get-login --no-include-email --region ${REGION})" | ||
sh "docker push ${DOCKER_IMAGE}:`git rev-parse HEAD`" | ||
sh "docker push ${DOCKER_IMAGE}:production" | ||
} | ||
} | ||
stage('Bounce') { | ||
steps { | ||
sh "curl --data '{\"text\": \"Jenkins bouncing ${REGION}/${CLUSTER}/${SERVICE}...\"}' ${SLACK_WEBHOOK_URL}" | ||
script{ | ||
for (s in env.SERVICE.split(',')) { | ||
bounceService(s) | ||
} | ||
} | ||
sh "curl --data '{\"text\": \"${REGION}/${CLUSTER}/${SERVICE} is now stable\"}' ${SLACK_WEBHOOK_URL}" | ||
} | ||
} | ||
} | ||
} | ||
|
||
def bounceService(String service) { | ||
sh "aws ecs update-service --force-new-deployment --cluster ${CLUSTER} --service ${service} --region ${REGION}" | ||
sh "aws ecs wait services-stable --cluster ${CLUSTER} --services ${service} --region ${REGION}" | ||
} |
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,53 @@ | ||
name: Docker Build & Push | ||
description: Composite GitHub Action to build and push Docker images to the DLCS GitHub Packages repositories. | ||
|
||
inputs: | ||
image-name: | ||
description: "Name of the image to push to the GHCR repository." | ||
required: true | ||
dockerfile: | ||
description: "The Dockerfile to build and push." | ||
required: true | ||
context: | ||
description: "The context to use when building the Dockerfile." | ||
required: true | ||
github-token: | ||
description: "The GitHub token used when interacting with GCHR." | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- id: checkout | ||
uses: actions/checkout@v2 | ||
- id: docker-setup-buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
driver-opts: | | ||
image=moby/buildkit:v0.10.6 | ||
- id: docker-meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ghcr.io/dlcs/${{ inputs.image-name }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=sha,enable=true,prefix=,format=long | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
- id: docker-login | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ inputs.github-token }} | ||
- id: docker-build-push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ${{ inputs.context }} | ||
file: ${{ inputs.dockerfile }} | ||
builder: ${{ steps.docker-setup-buildx.outputs.name }} | ||
tags: ${{ steps.docker-meta.outputs.tags }} | ||
labels: ${{ steps.docker-meta.outputs.labels }} | ||
push: ${{ github.actor != 'dependabot[bot]' }} |
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,23 @@ | ||
# Basic set up for three package managers | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
- package-ecosystem: "nuget" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,142 @@ | ||
name: DLCS Build, Test & Publish | ||
|
||
on: | ||
push: | ||
branches: [ "main", "develop" ] | ||
tags: [ "v*" ] | ||
pull_request: | ||
branches: [ "main", "develop" ] | ||
paths-ignore: | ||
- "docs/**" | ||
|
||
jobs: | ||
test-dotnet: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: src/protagonist | ||
env: | ||
BUILD_CONFIG: "Release" | ||
SOLUTION: "protagonist.sln" | ||
steps: | ||
- id: checkout | ||
uses: actions/checkout@v3 | ||
- id: setup-dotnet | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: "6.0.x" | ||
- id: restore-dotnet-dependencies | ||
run: dotnet restore $SOLUTION | ||
- id: build-dotnet | ||
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore | ||
- id: test-dotnet | ||
run: dotnet test $SOLUTION --filter 'Category!=Manual' --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal | ||
|
||
test-compositehandler: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: checkout | ||
uses: actions/checkout@v3 | ||
- id: setup-python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
- id: pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
build-push-orchestrator: | ||
runs-on: ubuntu-latest | ||
needs: test-dotnet | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/docker-build-and-push | ||
name: build and push | ||
with: | ||
image-name: "orchestrator" | ||
dockerfile: "Dockerfile.Orchestrator" | ||
context: "./src/protagonist" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-push-thumbs: | ||
runs-on: ubuntu-latest | ||
needs: test-dotnet | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/docker-build-and-push | ||
with: | ||
image-name: "thumbs" | ||
dockerfile: "Dockerfile.Thumbs" | ||
context: "./src/protagonist" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-push-engine: | ||
runs-on: ubuntu-latest | ||
needs: test-dotnet | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/docker-build-and-push | ||
with: | ||
image-name: "engine" | ||
dockerfile: "Dockerfile.Engine" | ||
context: "./src/protagonist" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-push-portal: | ||
runs-on: ubuntu-latest | ||
needs: test-dotnet | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/docker-build-and-push | ||
with: | ||
image-name: "portal" | ||
dockerfile: "Dockerfile.Portal" | ||
context: "./src/protagonist" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-push-api: | ||
runs-on: ubuntu-latest | ||
needs: test-dotnet | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/docker-build-and-push | ||
with: | ||
image-name: "api" | ||
dockerfile: "Dockerfile.API" | ||
context: "./src/protagonist" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-push-deletehandler: | ||
runs-on: ubuntu-latest | ||
needs: test-dotnet | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/docker-build-and-push | ||
with: | ||
image-name: "deletehandler" | ||
dockerfile: "Dockerfile.DeleteHandler" | ||
context: "./src/protagonist" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-push-migrator: | ||
runs-on: ubuntu-latest | ||
needs: test-dotnet | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/docker-build-and-push | ||
with: | ||
image-name: "migrator" | ||
dockerfile: "Dockerfile.Migrator" | ||
context: "./src/protagonist" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-push-compositehandler: | ||
runs-on: ubuntu-latest | ||
needs: test-compositehandler | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/docker-build-and-push | ||
with: | ||
image-name: "composite-handler" | ||
dockerfile: "Dockerfile.CompositeHandler" | ||
context: "./src/composite_handler" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -355,4 +355,6 @@ MigrationBackup/ | |
.idea | ||
|
||
# Generated xml documentation files | ||
API/API.xml | ||
API/API.xml | ||
|
||
.env |
Oops, something went wrong.