Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from schemaspy/master
Merge with master
- Loading branch information
Showing
42 changed files
with
1,295 additions
and
312 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 |
---|---|---|
|
@@ -7,3 +7,5 @@ schemaspy.iml | |
/bin/ | ||
schemaspy.properties | ||
*.iml | ||
!ext-lib | ||
ext-lib/**/*.jar |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Unit | ||
|
||
# Integration Testing | ||
|
||
## Test-containers | ||
* Requires docker | ||
|
||
### Oracle-XE | ||
Since oracle jdbc driver is proprietary you need to fetch it on your own. | ||
|
||
Put ojdbc[version].jar in ext-lib and it will be discovered. | ||
The OracleIT test will check for ojdbc* in ext-lib and also check | ||
if docker "works" if one of them fails the tests will be ignored. |
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,37 @@ | ||
FROM openjdk:8-jre-alpine | ||
|
||
ENV LC_ALL=C | ||
|
||
ADD entrypoint.sh / | ||
|
||
RUN set -o pipefail && \ | ||
adduser java -h / -D && \ | ||
apk update && apk add --no-cache curl unzip jq graphviz fontconfig && \ | ||
cd /tmp && \ | ||
curl https://www.fontsquirrel.com/fonts/download/open-sans -J -O && \ | ||
unzip open-sans.zip -d /usr/share/fonts && \ | ||
rm open-sans.zip && \ | ||
cd / && \ | ||
fc-cache -fv && \ | ||
curl -s https://api.github.com/repos/schemaspy/schemaspy/releases/latest | jq -r ".assets[] | select(.name | test(\"jar\")) | .browser_download_url" | xargs curl -JOL && \ | ||
echo "export MAIN_CLASS=$(unzip -p schemaspy*.jar META-INF/MANIFEST.MF | grep Main-Class | awk -F ': ' '{sub(/\r/,"",$2);print $2}')" > .env &&\ | ||
mkdir /drivers && \ | ||
mkdir /output && \ | ||
mkdir /config && \ | ||
chown -R java /schema* && \ | ||
chown -R java /drivers && \ | ||
chown -R java /output && \ | ||
chown -R java /config && \ | ||
chmod ugo+x entrypoint.sh && \ | ||
apk del curl unzip jq && \ | ||
rm -rf /var/cache/* | ||
|
||
|
||
|
||
USER java | ||
|
||
WORKDIR / | ||
|
||
VOLUME /drivers /output /config | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
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 @@ | ||
#!/bin/sh | ||
source /.env | ||
exec java -cp *:/drivers/* $MAIN_CLASS -o /output "$@" |
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,36 @@ | ||
## Docker image for SchemaSpy | ||
|
||
### Build info | ||
|
||
We currently build and publish release image and snapshot images. | ||
This are distinguished by tag. | ||
|
||
Alpine base with: | ||
* openjdk8-jre | ||
* OpenSans font | ||
* graphviz | ||
|
||
### Usage | ||
Currently the build contains 0 driver. | ||
|
||
It exposes 3 volumes that can be mounted | ||
|
||
/driver /output /config | ||
|
||
The container will load all libraries drivers, it will have output set to /output | ||
|
||
Container will exit when finished. | ||
|
||
Example: | ||
`docker run -v "$PWD/drivers:/driver" -v "$PWD/output:/output" schemaspy:[tag] -t mysql -db [database] -u [user] -p [password] -host [host] -port [port]` | ||
|
||
The example above assumes that the mysql jdbc driver is located in $PWD/drivers | ||
and output will be written to $PWD/output. | ||
|
||
### Caveats | ||
If you are new to docker localhost is inside the container and not the dockerhost. | ||
-net=host probably doesn't work with docker toolbox or docker for (mac|windows). | ||
|
||
## Issues | ||
Create an issue in the [github project](https://github.com/schemaspy/schemaspy/issues) | ||
|
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,34 @@ | ||
FROM openjdk:8-jre-alpine | ||
|
||
ENV LC_ALL=C | ||
|
||
RUN adduser java -h / -D && \ | ||
set -x && \ | ||
apk add --no-cache curl git unzip graphviz fontconfig openjdk8="$JAVA_ALPINE_VERSION" && \ | ||
mkdir -p /opt/build && cd /opt/build && \ | ||
curl https://www.fontsquirrel.com/fonts/download/open-sans -J -O && \ | ||
unzip open-sans.zip -d /usr/share/fonts && \ | ||
fc-cache -fv && \ | ||
git clone https://github.com/schemaspy/schemaspy.git && \ | ||
cd schemaspy && \ | ||
./mvnw package && \ | ||
cp target/schemaspy*.jar / && \ | ||
cd / && \ | ||
rm -rf /opt/build && \ | ||
rm -rf ~/.m2 && \ | ||
apk del curl git unzip openjdk8 && \ | ||
mkdir /drivers && \ | ||
mkdir /output && \ | ||
mkdir /config && \ | ||
chown -R java /schema* && \ | ||
chown -R java /drivers && \ | ||
chown -R java /output && \ | ||
chown -R java /config | ||
|
||
USER java | ||
|
||
WORKDIR / | ||
|
||
VOLUME /drivers /output /config | ||
|
||
ENTRYPOINT ["java","-cp","*:/drivers/*","org.springframework.boot.loader.JarLauncher", "-o", "/output"] |
Empty file.
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.