Skip to content

Set up env var for redmine branch #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ RUN apt-get update \

COPY assets/build/ ${REDMINE_BUILD_ASSETS_DIR}/

ARG REDMINE_BRANCH
ENV REDMINE_BRANCH=${REDMINE_BRANCH:-"master"}

RUN bash ${REDMINE_BUILD_ASSETS_DIR}/install.sh

COPY assets/runtime/ ${REDMINE_RUNTIME_ASSETS_DIR}/
Expand Down
13 changes: 7 additions & 6 deletions assets/build/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ rm -rf /tmp/cron.${REDMINE_USER}

# install redmine, use local copy if available
exec_as_redmine mkdir -p ${REDMINE_INSTALL_DIR}
if [[ -f ${REDMINE_BUILD_ASSETS_DIR}/redmine-${REDMINE_VERSION}.tar.gz ]]; then
exec_as_redmine tar -zvxf ${REDMINE_BUILD_ASSETS_DIR}/redmine-${REDMINE_VERSION}.tar.gz --strip=1 -C ${REDMINE_INSTALL_DIR}
if [[ -f ${REDMINE_BUILD_ASSETS_DIR}/redmine-${REDMINE_VERSION}-${REDMINE_BRANCH}.tar.gz ]]; then
echo "Using local tar: ${REDMINE_BUILD_ASSETS_DIR/redmine-${REDMINE_VERSION}-${REDMINE_BRANCH}.tar.gz}"
exec_as_redmine tar -zvxf ${REDMINE_BUILD_ASSETS_DIR}/redmine-${REDMINE_VERSION}-${REDMINE_BRANCH}.tar.gz --strip=1 -C ${REDMINE_INSTALL_DIR}
else
echo "Downloading Redmine ${REDMINE_VERSION}..."
exec_as_redmine wget "https://github.com/OpenSourceBrain/redmine/archive/master.tar.gz" -O /tmp/redmine-${REDMINE_VERSION}.tar.gz
echo "Redmine tar not found. Downloading tar for Redmine branch: ${REDMINE_BRANCH}..."
exec_as_redmine wget "https://github.com/OpenSourceBrain/redmine/archive/${REDMINE_BRANCH}.tar.gz" -O /tmp/redmine-${REDMINE_VERSION}-${REDMINE_BRANCH}.tar.gz

echo "Extracting..."
exec_as_redmine tar -zxf /tmp/redmine-${REDMINE_VERSION}.tar.gz --strip=1 -C ${REDMINE_INSTALL_DIR}
exec_as_redmine tar -zxf /tmp/redmine-${REDMINE_VERSION}-${REDMINE_BRANCH}.tar.gz --strip=1 -C ${REDMINE_INSTALL_DIR}

exec_as_redmine rm -rf /tmp/redmine-${REDMINE_VERSION}.tar.gz
exec_as_redmine rm -rf /tmp/redmine-${REDMINE_VERSION}-${REDMINE_BRANCH}.tar.gz
fi

# HACK: we want both the pg and mysql2 gems installed, so we remove the
Expand Down