Skip to content

Typo in CLI Makefile #208

Typo in CLI Makefile

Typo in CLI Makefile #208

Workflow file for this run

name: Build and Test
on:
workflow_dispatch:
push:
branches:
- main
- release/*
tags:
- v*
pull_request:
branches:
- main
- feature/*
- release/*
permissions:
contents: read
jobs:
build-query-container:
permissions:
packages: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: true
token: ${{ secrets.DRASI_CORE_PAT }}
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
with:
install: true
- name: Log in to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Query Host
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
context: ./query-container/query-host
file: ./query-container/query-host/Dockerfile
platforms: linux/amd64
tags: |
ghcr.io/${{ github.repository_owner }}/query-container-query-host:${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/query-host:cache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/query-host:cache,mode=max
push: true
- name: Build Publish API
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
context: ./query-container/publish-api
file: ./query-container/publish-api/Dockerfile
platforms: linux/amd64
tags: |
ghcr.io/${{ github.repository_owner }}/query-container-publish-api:${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/publish-api:cache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/publish-api:cache
push: true
- name: Build View Service
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
context: ./query-container/view-svc
file: ./query-container/view-svc/Dockerfile
platforms: linux/amd64
tags: |
ghcr.io/${{ github.repository_owner }}/query-container-view-svc:${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/view-svc:cache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/view-svc:cache
push: true
build-control-plane:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
with:
install: true
- name: Log in to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Management API
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
context: ./control-planes
file: ./control-planes/mgmt_api/Dockerfile
platforms: linux/amd64
tags: |
ghcr.io/${{ github.repository_owner }}/api:${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/api:cache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/api:cache,mode=max
push: true
- name: Build k8s Resource Provider
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
context: ./control-planes
file: ./control-planes/kubernetes_provider/Dockerfile
platforms: linux/amd64
tags: |
ghcr.io/${{ github.repository_owner }}/kubernetes-provider:${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/kubernetes-provider:cache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/kubernetes-provider:cache,mode=max
push: true
build-sources:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
strategy:
matrix:
component: [
{
label: 'Change Service',
context: '.',
file: './sources/shared/change-router/Dockerfile',
name: 'source-change-router',
platforms: 'linux/amd64'
},
{
label: 'Change Dispatcher',
context: '.',
file: './sources/shared/change-dispatcher/Dockerfile',
name: 'source-change-dispatcher',
platforms: 'linux/amd64'
},
{
label: 'Query API',
context: './sources/shared/query-api',
file: './sources/shared/query-api/Dockerfile',
name: 'source-query-api',
platforms: 'linux/amd64'
},
{
label: 'Debezium Reactivator',
context: './sources/relational/debezium-reactivator',
file: './sources/relational/debezium-reactivator/Dockerfile',
name: 'source-debezium-reactivator',
platforms: 'linux/amd64,linux/arm64'
},
{
label: 'SQL Proxy',
context: './sources/relational/sql-proxy',
file: './sources/relational/sql-proxy/Dockerfile',
name: 'source-sql-proxy',
platforms: 'linux/amd64'
},
{
label: 'CosmosDB Reactivator',
context: './sources/cosmosdb/cosmosdb-ffcf-reactivator',
file: './sources/cosmosdb/cosmosdb-ffcf-reactivator/Dockerfile',
name: 'source-cosmosdb-reactivator',
platforms: 'linux/amd64,linux/arm64'
},
{
label: 'Gremlin Proxy',
context: './sources/cosmosdb/gremlin-proxy',
file: './sources/cosmosdb/gremlin-proxy/Dockerfile',
name: 'source-gremlin-proxy',
platforms: 'linux/amd64'
},
{
label: 'Dataverse Reactivator',
context: './sources/dataverse/dataverse-reactivator',
file: './sources/dataverse/dataverse-reactivator/Dockerfile',
name: 'source-dataverse-reactivator',
platforms: 'linux/amd64,linux/arm64'
},
{
label: 'Dataverse Proxy',
context: './sources/dataverse/dataverse-proxy',
file: './sources/dataverse/dataverse-proxy/Dockerfile',
name: 'source-dataverse-proxy',
platforms: 'linux/amd64,linux/arm64'
},
{
label: 'EventHub Reactivator',
context: './sources/eventhub/eventhub-reactivator',
file: './sources/eventhub/eventhub-reactivator/Dockerfile',
name: 'source-eventhub-reactivator',
platforms: 'linux/amd64,linux/arm64'
},
{
label: 'EventHub Proxy',
context: './sources/eventhub/eventhub-proxy',
file: './sources/eventhub/eventhub-proxy/Dockerfile',
name: 'source-eventhub-proxy',
platforms: 'linux/amd64,linux/arm64'
}
]
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
with:
install: true
- name: Log in to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
context: ${{ matrix.component.context }}
file: ${{ matrix.component.file }}
platforms: ${{ matrix.component.platforms }}
tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.component.name }}:${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ matrix.component.name }}:cache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ matrix.component.name }}:cache,mode=max
push: true
build-reactions:
permissions:
packages: write
contents: read
runs-on: ubuntu-latest
strategy:
matrix:
component: [
{
label: 'SignalR',
context: './reactions/signalr/signalr-reaction',
file: './reactions/signalr/signalr-reaction/Dockerfile',
name: 'reaction-signalr',
platforms: 'linux/amd64,linux/arm64'
},
{
label: 'Dataverse',
context: './reactions/power-platform/dataverse/dataverse-reaction',
file: './reactions/power-platform/dataverse/dataverse-reaction/Dockerfile',
name: 'reaction-dataverse',
platforms: 'linux/amd64'
},
{
label: 'Debezium',
context: './reactions/debezium/debezium-reaction',
file: './reactions/debezium/debezium-reaction/Dockerfile',
name: 'reaction-debezium',
platforms: 'linux/amd64'
},
{
label: 'Debug',
context: './reactions/platform/debug-reaction',
file: './reactions/platform/debug-reaction/Dockerfile',
name: 'reaction-debug',
platforms: 'linux/amd64,linux/arm64'
},
{
label: 'EventGrid',
context: './reactions/azure/eventgrid-reaction',
file: './reactions/azure/eventgrid-reaction/Dockerfile',
name: 'reaction-eventgrid',
platforms: 'linux/amd64'
},
{
label: 'Gremlin',
context: './reactions/gremlin/gremlin-reaction',
file: './reactions/gremlin/gremlin-reaction/Dockerfile',
name: 'reaction-gremlin',
platforms: 'linux/amd64'
},
{
label: 'Result',
context: './reactions/platform/result-reaction',
file: './reactions/platform/result-reaction/Dockerfile',
name: 'reaction-result',
platforms: 'linux/amd64'
},
{
label: 'StorageQueue',
context: './reactions/azure/storagequeue-reaction',
file: './reactions/azure/storagequeue-reaction/Dockerfile',
name: 'reaction-storagequeue',
platforms: 'linux/amd64'
},
{
label: 'StoredProc',
context: './reactions/sql/storedproc-reaction',
file: './reactions/sql/storedproc-reaction/Dockerfile',
name: 'reaction-storedproc',
platforms: 'linux/amd64'
}
]
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
with:
install: true
- name: Log in to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
context: ${{ matrix.component.context }}
file: ${{ matrix.component.file }}
platforms: ${{ matrix.component.platforms }}
tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.component.name }}:${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ matrix.component.name }}:cache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ matrix.component.name }}:cache,mode=max
push: true
build-cli:
permissions:
packages: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: '1.21'
- name: Cache Go modules
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
working-directory: cli
run: make
- name: Upload artifact
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: cli
path: cli/bin
e2e-tests:
permissions:
packages: write
contents: read
runs-on: e2e-tester
needs:
- build-query-container
- build-control-plane
- build-sources
- build-reactions
- build-cli
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
- name: Install Drasi CLI
run: |
chmod +x ./cli/linux-x64/drasi
sudo mv ./cli/linux-x64/drasi /usr/local/bin/drasi
- name: Log in to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download images
run: |
docker pull ghcr.io/${{ github.repository_owner }}/query-container-query-host:${{ github.sha }}
docker pull ghcr.io/${{ github.repository_owner }}/query-container-publish-api:${{ github.sha }}
docker pull ghcr.io/${{ github.repository_owner }}/query-container-view-svc:${{ github.sha }}
docker pull ghcr.io/${{ github.repository_owner }}/api:${{ github.sha }}
docker pull ghcr.io/${{ github.repository_owner }}/kubernetes-provider:${{ github.sha }}
docker pull ghcr.io/${{ github.repository_owner }}/source-change-router:${{ github.sha }}
docker pull ghcr.io/${{ github.repository_owner }}/source-change-dispatcher:${{ github.sha }}
docker pull ghcr.io/${{ github.repository_owner }}/source-query-api:${{ github.sha }}
docker pull ghcr.io/${{ github.repository_owner }}/source-debezium-reactivator:${{ github.sha }}
docker pull ghcr.io/${{ github.repository_owner }}/source-sql-proxy:${{ github.sha }}
docker pull ghcr.io/${{ github.repository_owner }}/reaction-signalr:${{ github.sha }}
docker image list
- name: Tag images
run: |
docker image tag docker.io/ghcr.io/${{ github.repository_owner }}/query-container-query-host:${{ github.sha }} ${{ github.repository_owner }}/query-container-query-host
docker image tag docker.io/ghcr.io/${{ github.repository_owner }}/query-container-publish-api:${{ github.sha }} ${{ github.repository_owner }}/query-container-publish-api
docker image tag docker.io/ghcr.io/${{ github.repository_owner }}/query-container-view-svc:${{ github.sha }} ${{ github.repository_owner }}/query-container-view-svc
docker image tag docker.io/ghcr.io/${{ github.repository_owner }}/api:${{ github.sha }} ${{ github.repository_owner }}/api
docker image tag docker.io/ghcr.io/${{ github.repository_owner }}/kubernetes-provider:${{ github.sha }} ${{ github.repository_owner }}/kubernetes-provider
docker image tag docker.io/ghcr.io/${{ github.repository_owner }}/source-change-router:${{ github.sha }} ${{ github.repository_owner }}/source-change-router
docker image tag docker.io/ghcr.io/${{ github.repository_owner }}/source-change-dispatcher:${{ github.sha }} ${{ github.repository_owner }}/source-change-dispatcher
docker image tag docker.io/ghcr.io/${{ github.repository_owner }}/source-query-api:${{ github.sha }} ${{ github.repository_owner }}/source-query-api
docker image tag docker.io/ghcr.io/${{ github.repository_owner }}/source-debezium-reactivator:${{ github.sha }} ${{ github.repository_owner }}/source-debezium-reactivator
docker image tag docker.io/ghcr.io/${{ github.repository_owner }}/source-sql-proxy:${{ github.sha }} ${{ github.repository_owner }}/source-sql-proxy
docker image tag docker.io/ghcr.io/${{ github.repository_owner }}/reaction-signalr:${{ github.sha }} ${{ github.repository_owner }}/reaction-signalr
- name: Install Kind
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.17.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
- name: Install Kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
- name: npm install
working-directory: e2e-tests
run: npm install
- name: Run e2e tests
working-directory: e2e-tests
run: npm test
cleanup:
permissions:
packages: write
contents: read
runs-on: ubuntu-latest
if: failure()
needs:
- build-query-container
- build-control-plane
- build-sources
- build-reactions
- build-cli
- e2e-tests
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Delete images from GHCR
run: |
IMAGE_NAMES=(
"query-container-query-host"
"query-container-publish-api"
"query-container-view-svc"
"api"
"kubernetes-provider"
"source-change-router"
"source-change-dispatcher"
"source-query-api"
"source-debezium-reactivator"
"source-sql-proxy"
"source-cosmosdb-reactivator"
"source-gremlin-proxy"
"source-eventhub-reactivator"
"source-eventhub-proxy"
"source-dataverse-reactivator"
"source-dataverse-proxy"
"reaction-signalr"
"reaction-dataverse"
"reaction-debezium"
"reaction-debug"
"reaction-eventgrid"
"reaction-gremlin"
"reaction-result"
"reaction-storagequeue"
"reaction-storedproc"
)
for IMAGE_NAME in "${IMAGE_NAMES[@]}"; do
REPO=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
TAG=${{ github.sha }}
FULL_IMAGE_NAME=$REPO:$TAG
if docker pull $FULL_IMAGE_NAME; then
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' $FULL_IMAGE_NAME | sed 's/.*@//')
if [ -n "$DIGEST" ]; then
curl -X DELETE -u ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} https://ghcr.io/v2/${{ github.repository_owner }}/$IMAGE_NAME/manifests/$DIGEST
echo "Deleted image $FULL_IMAGE_NAME"
fi
else
echo "Image with tag $TAG for $IMAGE_NAME does not exist."
fi
done