Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,50 @@ jobs:
run: |
docker buildx build --push --tag ghcr.io/particular/${{ matrix.name }}:${{ env.TAG_NAME }} --file src/${{ matrix.project }}/Dockerfile --build-arg VERSION=${{ env.MinVerVersion }} --platform linux/arm64,linux/arm,linux/amd64 .
docker buildx imagetools inspect ghcr.io/particular/${{ matrix.name }}:${{ env.TAG_NAME }}
db-containers:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-22.04
name: db-containers
defaults:
run:
shell: bash
steps:
- name: Check for secrets
env:
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }}
shell: pwsh
run: exit $(If ($env:SECRETS_AVAILABLE -eq 'true') { 0 } Else { 1 })
- name: Checkout
uses: actions/checkout@v4.1.6
with:
fetch-depth: 0
- name: Install MinVer CLI
run: dotnet tool install --global minver-cli
- name: Determine versions
run: echo "MinVerVersion=$(minver)" >> $GITHUB_ENV
- name: Log in to GitHub container registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build images
env:
TAG_NAME: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || env.MinVerVersion }}
shell: pwsh
run: |
Write-Output "Determining RavenDB version from Directory.Packages.props file"
[xml]$packagesFile = Get-Content src/Directory.Packages.props
$RavenVersion = $packagesFile.selectNodes("//Project/ItemGroup/PackageVersion[@Include='RavenDB.Embedded']").Version

if (-not $RavenVersion) { throw "Unable to determine RavenDB server version from Directory.Packages.props" }

Write-Output "Determining container variants to build"
$containers = cat src/ServiceControl.RavenDB/containers.json | ConvertFrom-Json
$containers | ForEach-Object -Process {
$FULLTAG="${{ env.TAG_NAME }}-$($_.tag)"
$BASETAG="$($RavenVersion)-ubuntu.22.04-$($_.tag)"
Write-Output "::group::Building $FULLTAG for architecture $($_.arch) from $BASETAG"
docker build -t ghcr.io/particular/servicecontrol-ravendb:$FULLTAG --file src/ServiceControl.RavenDB/Dockerfile --build-arg VERSION=${{ env.MinVerVersion }} --build-arg BASETAG=$BASETAG --platform linux/$($_.arch) .
Write-Output "::endgroup::"
}
- name: List local images
run: docker images
- name: Push images to GitHub Container registry
run: docker image push --all-tags ghcr.io/particular/servicecontrol-ravendb
15 changes: 15 additions & 0 deletions src/ServiceControl.RavenDB/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ARG BASETAG
ARG VERSION
FROM ravendb/ravendb:$BASETAG AS ravendb

COPY src/ServiceControl.Persistence.RavenDB/RavenLicense.json /opt/RavenDB/servicecontrol-license.json

ENV RAVEN_ARGS='--License.Eula.Accepted=true --License.Path=/opt/RavenDB/servicecontrol-license.json'

LABEL org.opencontainers.image.source=https://github.com/Particular/ServiceControl \
org.opencontainers.image.authors="Particular Software" \
org.opencontainers.image.url=https://docs.particular.net/servicecontrol/ \
org.opencontainers.image.documentation=https://docs.particular.net/servicecontrol/ \
org.opencontainers.image.version=$VERSION \
org.opencontainers.image.title=ServiceControl.RavenDB \
org.opencontainers.image.description="ServiceControl database storage using RavenDB"
14 changes: 14 additions & 0 deletions src/ServiceControl.RavenDB/containers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"arch": "amd64",
"tag": "x64"
},
{
"arch": "arm64/v8",
"tag": "arm64v8"
},
{
"arch": "arm/v7",
"tag": "arm32v7"
}
]