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
64 changes: 33 additions & 31 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,48 @@ name: Docker
on:
push:
branches:
- master

- main
tags:
- v*

- 'v*'
pull_request:

jobs:
build:
if: github.event_name != 'push'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Build Docker image
run: docker build . -t image
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

gpr:
name: Push to GitHub Package Registry
if: github.event_name == 'push'
runs-on: ubuntu-latest
- name: Build image
run: docker build -t ib-gateway:test .

steps:
- uses: actions/checkout@v1
- uses: antequant/docker-push-action@v0.3
with:
docker_server: docker.pkg.github.com
docker_password: ${{ secrets.GITHUB_TOKEN }}
image_path: docker.pkg.github.com/${{ github.repository }}

dockerhub:
name: Push to Docker Hub
if: github.event_name == 'push'
push:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: antequant/docker-push-action@v0.3
with:
docker_username: antequantsvcuser
docker_password: ${{ secrets.DOCKER_TOKEN }}
image_path: antequantmirror
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/ib-gateway-docker:${{ steps.version.outputs.VERSION }}
${{ secrets.DOCKER_USERNAME }}/ib-gateway-docker:latest
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN wget -q --progress=bar:force:noscroll --show-progress \
&& chmod a+x install-ibgateway.sh

RUN wget -q --progress=bar:force:noscroll --show-progress \
https://github.com/IbcAlpha/IBC/releases/download/3.20.0/IBCLinux-3.20.0.zip \
https://github.com/IbcAlpha/IBC/releases/download/3.23.0/IBCLinux-3.23.0.zip \
-O ibc.zip \
&& unzip ibc.zip -d /opt/ibc \
&& chmod a+x /opt/ibc/*.sh /opt/ibc/*/*.sh
Expand All @@ -25,7 +25,7 @@ COPY run.sh run.sh
RUN dos2unix run.sh

# Application
FROM ubuntu:24.04 as app
FROM ubuntu:24.04 AS app

RUN apt update \
&& apt install -y \
Expand Down
25 changes: 23 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
VERSION := v$(shell grep -o 'Jts/[0-9]*' Dockerfile | cut -d'/' -f2)-ibc$(shell grep -o 'IBCLinux-[0-9.]*' Dockerfile | sed 's/IBCLinux-//' | sed 's/\.$$//')

vnc: up
open vnc://localhost:5900

Expand All @@ -10,8 +12,27 @@ up:
down:
docker-compose down

logs:
docker-compose logs -f ib-gateway

shell:
docker-compose run -it ib-gateway /bin/bash

deploy:
docker push martinffx/ib-gateway-docker
release: build
@if [ -n "$$(git status --porcelain)" ]; then \
echo "Error: Working tree is dirty. Commit or stash changes first."; \
exit 1; \
fi
@if [ "$$(git branch --show-current)" != "main" ]; then \
echo "Error: Must be on main branch to release."; \
exit 1; \
fi
@if git rev-parse "$(VERSION)" >/dev/null 2>&1; then \
echo "Error: Tag $(VERSION) already exists."; \
exit 1; \
fi
@echo "Releasing $(VERSION)"
git tag -a $(VERSION) -m "Release $(VERSION)"
git tag -f -a latest -m "Latest release"
git push origin $(VERSION)
git push -f origin latest
12 changes: 12 additions & 0 deletions ibc_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -958,3 +958,15 @@ LogStructureWhen=never

#LogComponents=


# Include Stack Trace for Exceptions
# ---------------------------------
#
# If set to 'yes', when an unhandled exception occurs in the IBC
# or TWS/Gateway Java code, the logging will include a stack trace.
# If set to 'no', only the exception message is logged.
#
# The default is 'no'.

IncludeStackTraceForExceptions=no

Loading