Skip to content

Commit

Permalink
ci: get docker merge github workflow passing; fixes mit-dci#283
Browse files Browse the repository at this point in the history
Signed-off-by: Morgan Rockett <[email protected]>
  • Loading branch information
rockett-m committed Jul 18, 2024
1 parent 86a55a6 commit d6b1743
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ run
plots
.vscode
.deps
!requirements.txt

# E2E test results
testruns
Expand All @@ -13,6 +14,7 @@ charts/
# Prevent copying scripts that are unused in docker
scripts/
!scripts/test.sh
!scripts/activate-venv.sh
!scripts/install-build-tools.sh
!scripts/setup-dependencies.sh
!scripts/test-transaction.sh
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docker-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
push:
branches:
- 'trunk'
# to test pass/failure before a merge
pull_request:
branches:
- 'trunk'

jobs:
docker-build:
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ ENV DEBIAN_FRONTEND noninteractive
ENV CMAKE_BUILD_TYPE Release
ENV BUILD_RELEASE 1

COPY requirements.txt /opt/tx-processor/requirements.txt
COPY scripts/activate-venv.sh /opt/tx-processor/scripts/activate-venv.sh

RUN mkdir -p /opt/tx-processor/scripts

COPY scripts/install-build-tools.sh /opt/tx-processor/scripts/install-build-tools.sh
Expand Down
11 changes: 8 additions & 3 deletions scripts/install-build-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ create_venv_install_python() {
if rm -rf -- "${ENV_LOCATION}"; then
echo "Removed existing virtual environment"
else
echo "Failed to remove existing virtual environment"; exit 1
echo "Failed to remove existing virtual environment"
exit 1
fi
fi
# install pip for linux
Expand Down Expand Up @@ -82,10 +83,14 @@ create_venv_install_python() {
if "${PY_LOC}" -m venv "${ENV_NAME}"; then
echo "Virtual environment '${ENV_NAME}' created"
else
echo "Virtual environment creation failed"; exit 1
echo "Virtual environment creation failed"
exit 1
fi
# activate virtual environment
source "${ROOT}/scripts/activate-venv.sh"
if ! . "${ROOT}/scripts/activate-venv.sh"; then
echo "Failed to activate virtual environment"
exit 1
fi
# install python packages
if pip install -r "${ROOT}/requirements.txt"; then
echo "Success installing python packages"
Expand Down

0 comments on commit d6b1743

Please sign in to comment.