Skip to content

Commit

Permalink
added compose file for asb emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Anderson committed Jan 10, 2025
1 parent 9a8254c commit 4fd30b5
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Environment file for user defined variables in docker-compose.yml

# 1. CONFIG_PATH: Path to Config.json file
# Ex: CONFIG_PATH="C:\\Config\\Config.json"
CONFIG_PATH=".\\config.json"

# 2. ACCEPT_EULA: Pass 'Y' to accept license terms for Azure SQL Edge and Azure Service Bus emulator.
# Service Bus emulator EULA : https://github.com/Azure/azure-service-bus-emulator-installer/blob/main/EMULATOR_EULA.txt
# SQL Edge EULA : https://go.microsoft.com/fwlink/?linkid=2139274
ACCEPT_EULA="Y"

# 3. MSSQL_SA_PASSWORD to be filled by user as per policy : https://learn.microsoft.com/sql/relational-databases/security/strong-passwords?view=sql-server-linux-ver16
MSSQL_SA_PASSWORD="BTMS@L0c4l"
5 changes: 5 additions & 0 deletions .github/workflows/check-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
mongodb-version: '7.0'
mongodb-replica-set: test-rs
mongodb-port: 29017

- name: Install Docker using Docker's official script
run: |
curl -fsSL https://get.docker.com -o get-docker.sh
Expand All @@ -41,6 +42,10 @@ jobs:
docker-compose --version
continue-on-error: false

- name: Start application-specific services using Docker Compose
run: docker-compose up -d
continue-on-error: false

- name: Test
run: dotnet test --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory ./coverage

Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: microsoft-azure-servicebus-emulator
services:
emulator:
container_name: "servicebus-emulator"
image: mcr.microsoft.com/azure-messaging/servicebus-emulator:latest
volumes:
- "${CONFIG_PATH}:/ServiceBus_Emulator/ConfigFiles/Config.json"
ports:
- "5672:5672"
environment:
SQL_SERVER: sqledge
MSSQL_SA_PASSWORD: ${MSSQL_SA_PASSWORD}
ACCEPT_EULA: ${ACCEPT_EULA}
depends_on:
- sqledge
networks:
sb-emulator:
aliases:
- "sb-emulator"
sqledge:
container_name: "sqledge"
image: "mcr.microsoft.com/azure-sql-edge:latest"
networks:
sb-emulator:
aliases:
- "sqledge"
environment:
ACCEPT_EULA: ${ACCEPT_EULA}
MSSQL_SA_PASSWORD: ${MSSQL_SA_PASSWORD}
networks:
sb-emulator:
59 changes: 59 additions & 0 deletions .github/workflows/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"UserConfig": {
"Namespaces": [
{
"Name": "sbemulatorns",

"Topics": [
{
"Name": "dev_alvs_topic_vnet",
"Properties": {
"DefaultMessageTimeToLive": "PT1H",
"DuplicateDetectionHistoryTimeWindow": "PT20S",
"RequiresDuplicateDetection": false
},
"Subscriptions": [
{
"Name": "dev_btms_sub_vnet",
"Properties": {
"DeadLetteringOnMessageExpiration": false,
"DefaultMessageTimeToLive": "PT1H",
"LockDuration": "PT1M",
"MaxDeliveryCount": 10,
"ForwardDeadLetteredMessagesTo": "",
"ForwardTo": "",
"RequiresSession": false
}
}
]
},
{
"Name": "dev_notification_topic_vnet",
"Properties": {
"DefaultMessageTimeToLive": "PT1H",
"DuplicateDetectionHistoryTimeWindow": "PT20S",
"RequiresDuplicateDetection": false
},
"Subscriptions": [
{
"Name": "dev_btms_sub_vnet",
"Properties": {
"DeadLetteringOnMessageExpiration": false,
"DefaultMessageTimeToLive": "PT1H",
"LockDuration": "PT1M",
"MaxDeliveryCount": 10,
"ForwardDeadLetteredMessagesTo": "",
"ForwardTo": "",
"RequiresSession": false
}
}
]
}
]
}
],
"Logging": {
"Type": "File"
}
}
}

0 comments on commit 4fd30b5

Please sign in to comment.