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 committed Jul 19, 2024
1 parent 86a55a6 commit c076689
Show file tree
Hide file tree
Showing 5 changed files with 22 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
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
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ ARG BASE_IMAGE="ghcr.io/mit-dci/opencbdc-tx-base:latest"
# Create Base Image
FROM $IMAGE_VERSION AS base

# make shell run with bash not sh
SHELL ["/bin/bash", "-c"]

# 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 @@

#!/bin/bash
#!/usr/bin/env 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 c076689

Please sign in to comment.