Skip to content

Commit

Permalink
ci: get docker merge github workflow passing; fixes #283
Browse files Browse the repository at this point in the history
Signed-off-by: Morgan Rockett <morgan.rockett@tufts.edu>
  • Loading branch information
rockett-m authored and HalosGhost committed Jul 19, 2024
1 parent 86a55a6 commit 0f7014f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,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
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ ARG BASE_IMAGE="ghcr.io/mit-dci/opencbdc-tx-base:latest"
FROM $IMAGE_VERSION AS base

# set non-interactive shell
ENV DEBIAN_FRONTEND noninteractive
ENV CMAKE_BUILD_TYPE Release
ENV BUILD_RELEASE 1
ENV DEBIAN_FRONTEND=noninteractive
ENV CMAKE_BUILD_TYPE=Release
ENV BUILD_RELEASE=1

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

COPY requirements.txt /opt/tx-processor/requirements.txt
COPY scripts/activate-venv.sh /opt/tx-processor/scripts/activate-venv.sh
COPY scripts/install-build-tools.sh /opt/tx-processor/scripts/install-build-tools.sh
COPY scripts/setup-dependencies.sh /opt/tx-processor/scripts/setup-dependencies.sh

Expand Down
2 changes: 1 addition & 1 deletion scripts/build-docker.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash

#!/bin/bash
set -e

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
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 0f7014f

Please sign in to comment.