Skip to content

Commit

Permalink
Improved docker compose compatibility with github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hariharan-io committed Apr 25, 2024
1 parent b42b48f commit bb07d73
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 14 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/test_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ jobs:
uses: actions/checkout@v4
- name: Set up improved Docker Buildx support
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests for captain
run: npm run docker:captain-test
- name: Run tests for mate
Expand All @@ -55,6 +49,12 @@ jobs:
tags: |
type=semver,pattern={{raw}}
type=sha
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Build and push captain"
uses: docker/build-push-action@v5
with:
Expand Down
10 changes: 8 additions & 2 deletions captain/__tests__/utils/jestSetup.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { CustomRaceConditionLock } from "../../src/coreUtils.js"

const unhandledRejectionToIgnore = [CustomRaceConditionLock.lockObsolete];

// preserve original setTimeout in case needed to be used when using fake timers
(global as any).originalSetTimeout = global.setTimeout
process.on('unhandledRejection', (error, origin) => {
console.error(origin, error)
fail(error)
if (!unhandledRejectionToIgnore?.includes(`${error}`)) {
console.error(origin, error)
fail(error)
}
})
process.on('uncaughtException', (error, origin) => {
console.error(origin, error)
Expand Down
3 changes: 1 addition & 2 deletions docker-compose-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ services:
dns-server-template:
hostname: dns-server
image: technitium/dns-server:latest
ports:
- '5380:5380/tcp' #DNS web console (HTTP)
expose:
- '53:53/udp' #DNS service
- '53:53/tcp' #DNS service
environment:
Expand Down
5 changes: 3 additions & 2 deletions docker-compose-captain-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ services:
networks:
custom-network:
ipv4_address: 10.6.0.11
ports:
- 8001:80
# # for debugging during testing
# ports:
# - 8001:80
depends_on:
- dns-server
# dns:
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ services:
service: dns-server-template
volumes:
- technitium-config:/etc/dns
ports:
- '5380:5380/tcp' #DNS web console (HTTP)
networks:
custom-network:
ipv4_address: 10.5.0.2
Expand Down
10 changes: 8 additions & 2 deletions mate/__tests__/utils/jestSetup.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { CustomRaceConditionLock } from "../../src/coreUtils.js"

const unhandledRejectionToIgnore = [CustomRaceConditionLock.lockObsolete];

// preserve original setTimeout in case needed to be used when using fake timers
(global as any).originalSetTimeout = global.setTimeout
process.on('unhandledRejection', (error, origin) => {
console.error(origin, error)
fail(error)
if (!unhandledRejectionToIgnore?.includes(`${error}`)) {
console.error(origin, error)
fail(error)
}
})
process.on('uncaughtException', (error, origin) => {
console.error(origin, error)
Expand Down

0 comments on commit bb07d73

Please sign in to comment.