Skip to content

Commit

Permalink
Merge branch 'main' of github.com:xtuml/erebus into 22-test-workflowy…
Browse files Browse the repository at this point in the history
…ml-needs-repo-references-updating-to-open-source
  • Loading branch information
ZacDCSIT committed May 17, 2024
2 parents eff5d52 + a29ee64 commit dc730a4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@ FROM python:3.11-slim-bullseye

# install pre-requisites and setup folders
RUN apt-get update && yes "yes" | apt-get upgrade && \
yes "yes" | apt-get install openssh-client && \
yes "yes" | apt-get install git && \
mkdir -p -m 0600 /root/.ssh/ && \
touch /root/.ssh/known_hosts && \
ssh-keyscan gitlab.com >> /root/.ssh/known_hosts && \
ssh-keyscan github.com >> /root/.ssh/known_hosts && \
mkdir /test_harness_app && \
mkdir /config

RUN --mount=type=ssh pip install git+ssh://git@github.com/SmartDCSITlimited/test-event-generator.git
# Install python package test-event-generator from open source repo
RUN pip install git+https://github.com/xtuml/janus.git

WORKDIR /test_harness_app

COPY . /test_harness_app/

RUN --mount=type=ssh chmod +x /test_harness_app/scripts/install_repositories.sh && \
RUN chmod +x /test_harness_app/scripts/install_repositories.sh && \
/test_harness_app/scripts/install_repositories.sh && \
pip install -r requirements.txt

Expand Down
32 changes: 22 additions & 10 deletions scripts/install_repositories.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
#!/bin/sh

# test event generator
# Set janus (test-event-generator) version tag
export janus_tag=v1.0.0

# clone janus repo
cd /tmp/
if git clone git@github.com:SmartDCSITlimited/test-event-generator.git; then
if git clone https://github.com/xtuml/janus.git; then
ERROR=""
else
ERROR="$(git clone git@github.com:SmartDCSITlimited/test-event-generator.git 2>&1 1>/dev/null)"
ERROR="$(git clone https://github.com/xtuml/janus.git 2>&1 1>/dev/null)"
fi

# check if clone was successful
if [ -z "$ERROR" ]; then
echo "test-event-generator cloned successfully"
echo "janus (test-event-generator) cloned successfully"
else
if [ "$ERROR" == *"fatal: Could not read from remote repository"* ]; then
echo "test-event-generator clone failed functionality will not be present in Test Harness.\nIf this is not expected get ssh access to rhe repository:\ngit@github.com:SmartDCSITlimited/test-event-generator.git\n"
echo "janus (test-event-generator) clone failed functionality will not be present in Test Harness."
exit 0
else
>&2 echo "test-event-generator clone failed with error message:\n$ERROR"
>&2 echo "janus (test-event-generator) clone failed with error message:\n$ERROR"
exit 1
fi
fi
# fail if anything errors

# fail if errors are encountered
set -e
cd test-event-generator

# navigate to cloned repo and checkout specified version
cd janus
git fetch --all --tags
git checkout tags/v1.0.0 -b latest
git checkout tags/$janus_tag -b latest

# install dependencies and the package
pip install -r requirements.txt
pip install .

# clean up
cd ..
rm -f -r test-event-generator/
rm -f -r janus/

0 comments on commit dc730a4

Please sign in to comment.