diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cfccdd8..6429d48 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 2fc396a..fe6a33c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 \ diff --git a/Makefile b/Makefile index b75aa56..174a45b 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/ibc_config.ini b/ibc_config.ini index 34da44e..75a7345 100644 --- a/ibc_config.ini +++ b/ibc_config.ini @@ -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 +