Skip to content

Commit

Permalink
Merge pull request #6 from muze-nl/feature/docker-project-name
Browse files Browse the repository at this point in the history
Fixes to make sure the docker container names match what is expected
  • Loading branch information
ylebre authored Nov 21, 2022
2 parents fb8d9ed + 322055e commit 849a9a1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
12 changes: 6 additions & 6 deletions test-prejournal.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash
docker-compose up -d
docker-compose --compatibility -p federated-timesheets-tests up -d

echo "--- Initializing timeld"
export TIMELD_PASSWORD=`docker exec -it federation-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/init.mjs"`
export TIMELD_PASSWORD=`docker exec -it federated-timesheets-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/init.mjs"`
echo "--- Extracted key: $TIMELD_PASSWORD"

echo "--- Installing tikiwiki"
docker exec -u www-data -it federation-tests_tikiwiki_1 "/bin/sh" "/usr/local/bin/tiki-init.sh"
docker exec -u www-data -it federated-timesheets-tests_tikiwiki_1 "/bin/sh" "/usr/local/bin/tiki-init.sh"

echo "--- Setting up environment for prejournal"
cp prejournal/testnet.env testnet.env
docker cp testnet.env federation-tests_prejournal_1:/app/.env
docker cp testnet.env federated-timesheets-tests_prejournal_1:/app/.env
curl -d'["alice","alice123"]' http://localhost:8280/v1/register

echo "--- Connecting prejournal to tiki and timeld"
Expand All @@ -22,13 +22,13 @@ echo "TIMELD_USERNAME=alice" >> testnet.env
echo "TIMELD_TIMESHEET=alice/timesheet" >> testnet.env
echo "TIMELD_PROJECT=alice/project" >> testnet.env
echo "TIMELD_PASSWORD=$TIMELD_PASSWORD" >> testnet.env
docker cp testnet.env federation-tests_prejournal_1:/app/.env
docker cp testnet.env federated-timesheets-tests_prejournal_1:/app/.env

echo "--- Entering timesheet entry in prejournal"
curl -d'["23 Sep 2022","stichting","Federated Timesheets", 8, "This is the description to check for"]' http://alice:alice123@localhost:8280/v1/worked-hours

echo "--- Fetching report from timeld"
docker exec -it federation-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/report.mjs" > timeld-report.txt
docker exec -it federated-timesheets-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/report.mjs" > timeld-report.txt
echo "--- Fetching report from tikiwiki"
curl -H "Authorization: Bearer testnet-supersecret-token" http://localhost:8180/api/trackers/1 > tiki-report.json

Expand Down
18 changes: 9 additions & 9 deletions test-tiki.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#!/bin/bash
docker-compose up -d
docker-compose --compatibility -p federated-timesheets-tests up -d

echo "--- Initializing timeld"
export TIMELD_PASSWORD=`docker exec -it federation-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/init.mjs"`
docker exec -it federation-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/report.mjs"
export TIMELD_PASSWORD=`docker exec -it federated-timesheets-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/init.mjs"`
docker exec -it federated-timesheets-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/report.mjs"
echo "--- Extracted key: $TIMELD_PASSWORD"

echo "--- Installing tikiwiki"
docker exec -u www-data -it federation-tests_tikiwiki_1 "/bin/sh" "/usr/local/bin/tiki-init.sh"
docker exec -u www-data -it federated-timesheets-tests_tikiwiki_1 "/bin/sh" "/usr/local/bin/tiki-init.sh"

echo "--- Setting up environment for prejournal"
cp prejournal/testnet.env testnet.env
docker cp testnet.env federation-tests_prejournal_1:/app/.env
docker cp testnet.env federated-timesheets-tests_prejournal_1:/app/.env
curl -d'["alice","alice123"]' http://localhost:8280/v1/register

echo "--- Adding credentials to tiki for timeld and prejournal"
docker exec -u www-data -it federation-tests_tikiwiki_1 "/bin/sh" "/profile/addusers.sh"
docker exec -u www-data -it federated-timesheets-tests_tikiwiki_1 "/bin/sh" "/profile/addusers.sh"
echo "$TIMELD_PASSWORD" > timeld-key
docker cp timeld-key federation-tests_tikiwiki_1:/profile/timeld-key
docker exec -u www-data -it federation-tests_tikiwiki_1 "php" "/profile/add-credentials.php"
docker cp timeld-key federated-timesheets-tests_tikiwiki_1:/profile/timeld-key
docker exec -u www-data -it federated-timesheets-tests_tikiwiki_1 "php" "/profile/add-credentials.php"

# FIXME: Add this
echo "--- Entering timesheet entry in tiki"
Expand All @@ -33,7 +33,7 @@ echo "--- Fetching report from prejournal"
curl -d'["0"]' http://alice:alice123@localhost:8280/v1/print-timesheet-json > prejournal-report.json

echo "--- Fetching report from timeld"
docker exec -it federation-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/report.mjs" > timeld-report.txt
docker exec -it federated-timesheets-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/report.mjs" > timeld-report.txt

PREJOURNAL_VALIDATED=`grep -c "This is the description to check for" prejournal-report.json`
TIMELD_VALIDATED=`grep -c "This is the description to check for" timeld-report.txt`
Expand Down
16 changes: 8 additions & 8 deletions test-timeld.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#!/bin/bash
docker-compose up -d
docker-compose --compatibility -p federated-timesheets-tests up -d

echo "--- Initializing timeld"
export TIMELD_PASSWORD=`docker exec -it federation-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/init.mjs"`
docker exec -it federation-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/report.mjs"
export TIMELD_PASSWORD=`docker exec -it federated-timesheets-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/init.mjs"`
docker exec -it federated-timesheets-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/report.mjs"
echo "--- Extracted key: $TIMELD_PASSWORD"

echo "--- Installing tikiwiki"
docker exec -u www-data -it federation-tests_tikiwiki_1 "/bin/sh" "/usr/local/bin/tiki-init.sh"
docker exec -u www-data -it federated-timesheets-tests_tikiwiki_1 "/bin/sh" "/usr/local/bin/tiki-init.sh"

echo "--- Setting up environment for prejournal"
cp prejournal/testnet.env testnet.env
docker cp testnet.env federation-tests_prejournal_1:/app/.env
docker cp testnet.env federated-timesheets-tests_prejournal_1:/app/.env
curl -d'["alice","alice123"]' http://localhost:8280/v1/register

echo "--- Connecting timeld to prejournal and tiki"
docker exec -it federation-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/connect-prejournal.mjs"
docker exec -it federation-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/connect-tiki.mjs"
docker exec -it federated-timesheets-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/connect-prejournal.mjs"
docker exec -it federated-timesheets-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/connect-tiki.mjs"

echo "--- Entering timesheet entry in timeld"
docker exec -it federation-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/timesheet-entry.mjs"
docker exec -it federated-timesheets-tests_timeld-cli_1 "/usr/local/bin/node" "/timeld/timesheet-entry.mjs"

echo "--- Fetching report from prejournal"
curl -d'["0"]' http://alice:alice123@localhost:8280/v1/print-timesheet-json > prejournal-report.json
Expand Down

0 comments on commit 849a9a1

Please sign in to comment.