forked from Taskana/TaskanaAdapter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes Taskana#612: add wildfly test that wildflyApp is deployed
- Loading branch information
Showing
15 changed files
with
1,318 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: '3' | ||
services: | ||
taskana-postgres_14: | ||
build: postgres_14 | ||
ports: | ||
- 50102:5432 | ||
environment: | ||
- POSTGRES_PASSWORD=postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM postgres:14.7 | ||
RUN localedef -i de_DE -c -f UTF-8 -A /usr/share/locale/locale.alias de_DE.UTF-8 | ||
ENV LANG de_DE.utf8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@ECHO OFF | ||
SETLOCAL | ||
|
||
:MENU | ||
ECHO. | ||
ECHO ----------------------------------------------------- | ||
ECHO PRESS a number to select your task - anything to EXIT. | ||
ECHO ----------------------------------------------------- | ||
ECHO. | ||
ECHO 1 - Start POSTGRES 14 | ||
ECHO 2 - Stop POSTGRES 14 | ||
ECHO. | ||
ECHO 3 - Stop all | ||
ECHO. | ||
SET /P MENU=Select task then press ENTER: | ||
ECHO. | ||
IF [%MENU%]==[1] GOTO START_POSTGRES_14 | ||
IF [%MENU%]==[2] GOTO STOP_POSTGRES_14 | ||
IF [%MENU%]==[3] GOTO STOP_ALL | ||
EXIT /B | ||
|
||
:START_POSTGRES_14 | ||
ECHO --- | ||
ECHO docker-compose -f %~dp0/docker-compose.yml up -d taskana-postgres_14 | ||
docker-compose -f %~dp0/docker-compose.yml up -d taskana-postgres_14 | ||
|
||
ECHO --- | ||
GOTO MENU | ||
|
||
:STOP_POSTGRES_14 | ||
ECHO --- | ||
ECHO docker stop taskana-postgres_14 | ||
ECHO docker-compose -f %~dp0/docker-compose.yml rm -f -s -v taskana-postgres_14 | ||
docker-compose -f %~dp0/docker-compose.yml rm -f -s -v taskana-postgres_14 | ||
ECHO --- | ||
GOTO MENU | ||
|
||
:STOP_ALL | ||
ECHO --- | ||
ECHO docker-compose -f %~dp0/docker-compose.yml down -v | ||
docker-compose -f %~dp0/docker-compose.yml down -v | ||
ECHO --- | ||
GOTO MENU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/bash | ||
set -e #fail fast | ||
trap "exit 1" TERM | ||
export TOP_PID=$$ | ||
|
||
#H Usage: | ||
#H %FILE% -h | %FILE% --help | ||
#H | ||
#H prints this help and exits | ||
#H | ||
#H %FILE% <database> | ||
#H | ||
#H downloads and starts docker image for TASKANA unit tests. | ||
#H | ||
#H %FILE% stop [database] | ||
#H | ||
#H stops the database. | ||
#H If no database was provided all databases are stopped. | ||
#H | ||
#H database: | ||
#H - POSTGRES | POSTGRES_14 | ||
# Arguments: | ||
# $1: exit code | ||
function helpAndExit() { | ||
cat "$0" | grep "^#H" | cut -c4- | sed -e "s/%FILE%/$(basename "$0")/g" | ||
exit "$1" | ||
} | ||
|
||
# This function maps the database parameter (for this file) to the docker-compose service name. | ||
# Arguments: | ||
# $1: the database which should be mapped | ||
function mapDBToDockerComposeServiceName() { | ||
[[ -z "$1" || "$1" == "H2" ]] && return | ||
case "$1" in | ||
POSTGRES|POSTGRES_14) | ||
echo "taskana-postgres_14" | ||
;; | ||
*) | ||
echo "unknown database '$1'" >&2 && kill -s TERM $TOP_PID | ||
esac | ||
} | ||
|
||
function main() { | ||
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0 | ||
scriptDir=$(dirname "$0") | ||
|
||
case "$1" in | ||
H2) | ||
;; | ||
POSTGRES|POSTGRES_14) | ||
docker-compose -f $scriptDir/docker-compose.yml up -d "$(mapDBToDockerComposeServiceName "$1")" | ||
;; | ||
stop) | ||
# this variable is necessary, so that the script can terminate properly | ||
# when the provided database name does not match. PLEASE DO NOT INLINE! | ||
local composeServiceName="$(mapDBToDockerComposeServiceName "$2")" | ||
docker-compose -f $scriptDir/docker-compose.yml rm -f -s -v $composeServiceName | ||
;; | ||
*) | ||
echo "unknown database '$1'" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
docker ps | ||
} | ||
|
||
main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.