Skip to content

Commit fd78581

Browse files
committed
NH-3807 - Develop AppVeyor and CircleCI builds.
- Allow failure for MySQL. - Include TestLoggers. - Exclude committed directories to Tools folder from being deleted.
1 parent 1644ce5 commit fd78581

File tree

16 files changed

+1150
-1
lines changed

16 files changed

+1150
-1
lines changed

.circleci/config.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# CircleCI 2.0 configuration file
2+
---
3+
# Common primary image
4+
ref-base-image: &ref-base-image
5+
image: ngbrown/nhibernate-build-dotnet-sdk:latest
6+
environment:
7+
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
8+
- CAKE_VERSION: 0.21.1
9+
10+
# Download and cache dependencies
11+
ref-restore-cache: &ref-restore-cache
12+
restore_cache:
13+
keys:
14+
- cake-{{ .Environment.CAKE_VERSION }}
15+
16+
ref-save-cache: &ref-save-cache
17+
save_cache:
18+
key: cake-{{ .Environment.CAKE_VERSION }}
19+
paths:
20+
- ~/project/tools
21+
22+
version: 2
23+
jobs:
24+
test-mssql:
25+
docker:
26+
- *ref-base-image
27+
28+
- image: microsoft/mssql-server-linux:latest
29+
environment:
30+
- ACCEPT_EULA: Y
31+
- SA_PASSWORD: Password12!
32+
33+
working_directory: ~/project
34+
35+
steps:
36+
- checkout
37+
38+
# Download and cache dependencies
39+
- *ref-restore-cache
40+
- run: ./build.sh --target Restore
41+
- *ref-save-cache
42+
43+
# compile and run tests.
44+
- run:
45+
name: Test on Microsoft SQL Server 2017 for Linux
46+
environment:
47+
- NHIBERNATE_DATABASE_TEMPLATE: MSSQL.cfg.xml
48+
- NHIBERNATE_CONNECTION_STRING: Server=(local);Database=master;User ID=sa;Password=Password12!
49+
- NHIBERNATE_DIALECT: NHibernate.Dialect.MsSql2012Dialect
50+
- DOTNET_FRAMEWORK: netcoreapp2.0
51+
- TARGET_PLATFORM: x64
52+
command: ./build.sh --target CircleCI --configuration Debug
53+
54+
- store_test_results:
55+
path: ~/test-reports
56+
- store_artifacts:
57+
path: ~/test-reports
58+
59+
test-postgresql:
60+
docker:
61+
- *ref-base-image
62+
63+
- image: postgres:9.6-alpine
64+
environment:
65+
- POSTGRES_PASSWORD: Password12!
66+
command: ["postgres", "-c", "max_prepared_transactions=100"]
67+
68+
working_directory: ~/project
69+
70+
steps:
71+
- checkout
72+
73+
# Download and cache dependencies
74+
- *ref-restore-cache
75+
- run: ./build.sh --target Restore
76+
- *ref-save-cache
77+
78+
# compile and run tests.
79+
- run:
80+
name: Test on PostgreSQL 9.6 for Linux
81+
environment:
82+
- NHIBERNATE_DATABASE_TEMPLATE: PostgreSQL.cfg.xml
83+
- NHIBERNATE_CONNECTION_STRING: Server=localhost;Port=5432;Database=nhibernate;User ID=postgres;Password=Password12!;Enlist=true;
84+
- NHIBERNATE_DIALECT: NHibernate.Dialect.PostgreSQL83Dialect
85+
- DOTNET_FRAMEWORK: netcoreapp2.0
86+
- TARGET_PLATFORM: x64
87+
command: ./build.sh --target CircleCI --configuration Debug
88+
89+
- store_test_results:
90+
path: ~/test-reports
91+
- store_artifacts:
92+
path: ~/test-reports
93+
94+
test-firebird:
95+
docker:
96+
- *ref-base-image
97+
98+
- image: ngbrown/nhibernate-build-firebird
99+
environment:
100+
- ISC_PASSWORD: Password12!
101+
FIREBIRD_USER: nhibernate
102+
FIREBIRD_PASSWORD: Password12!
103+
FIREBIRD_DATABASE: nhibernate
104+
105+
working_directory: ~/project
106+
107+
steps:
108+
- checkout
109+
110+
# Download and cache dependencies
111+
- *ref-restore-cache
112+
- run: ./build.sh --target Restore
113+
- *ref-save-cache
114+
115+
# compile and run tests.
116+
- run:
117+
name: Test on Firebird 3.0 for Linux
118+
environment:
119+
- NHIBERNATE_DATABASE_TEMPLATE: FireBird.cfg.xml
120+
- NHIBERNATE_CONNECTION_STRING: DataSource=localhost;Database=nhibernate;User ID=SYSDBA;Password=Password12!;MaxPoolSize=200;
121+
- NHIBERNATE_DIALECT: NHibernate.Dialect.FirebirdDialect
122+
- DOTNET_FRAMEWORK: netcoreapp2.0
123+
- TARGET_PLATFORM: x64
124+
command: ./build.sh --target CircleCI --configuration Debug
125+
126+
- store_test_results:
127+
path: ~/test-reports
128+
- store_artifacts:
129+
path: ~/test-reports
130+
131+
workflows:
132+
version: 2
133+
build:
134+
jobs:
135+
- test-mssql
136+
- test-postgresql
137+
- test-firebird
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM buildpack-deps:jessie-scm
2+
3+
RUN apt-get update \
4+
&& apt-get install -y --no-install-recommends \
5+
curl \
6+
unzip \
7+
libc6 \
8+
libcurl3 \
9+
libgcc1 \
10+
libgssapi-krb5-2 \
11+
libicu52 \
12+
liblttng-ust0 \
13+
libssl1.0.0 \
14+
libstdc++6 \
15+
libunwind8 \
16+
libuuid1 \
17+
zlib1g \
18+
&& rm -rf /var/lib/apt/lists/*
19+
20+
# Install .NET Core runtime - https://github.com/dotnet/dotnet-docker/blob/master/1.0/runtime/jessie/Dockerfile
21+
ENV DOTNET_VERSION 1.0.5
22+
ENV DOTNET_DOWNLOAD_SHA 55481b0254a72d8c342ba6ccca3908ffb5c99d7eeb54f83dec6cc93c6b4cc3ae
23+
ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/Runtime/$DOTNET_VERSION/dotnet-debian-x64.$DOTNET_VERSION.tar.gz
24+
25+
RUN curl -SL $DOTNET_DOWNLOAD_URL --output dotnet.tar.gz \
26+
&& echo "$DOTNET_DOWNLOAD_SHA dotnet.tar.gz" | sha256sum -c - \
27+
&& mkdir -p /usr/share/dotnet \
28+
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
29+
&& rm dotnet.tar.gz
30+
31+
# Install .NET Core SDK - https://github.com/dotnet/dotnet-docker/blob/master/2.0/sdk/jessie/amd64/Dockerfile
32+
ENV DOTNET_SDK_VERSION 2.0.0
33+
ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz
34+
ENV DOTNET_SDK_DOWNLOAD_SHA E457F3A5685382F7F24851A2E76EDBE75B575948C8A7F43220F159BA29C329A5008BBE7220C18DFB31EAF0398FC72177B1948B65E19B34ED0D907EFB459CF4B0
35+
36+
RUN curl -SL $DOTNET_SDK_DOWNLOAD_URL --output dotnet.tar.gz \
37+
&& echo "$DOTNET_SDK_DOWNLOAD_SHA dotnet.tar.gz" | sha512sum -c - \
38+
&& mkdir -p /usr/share/dotnet \
39+
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
40+
&& rm dotnet.tar.gz \
41+
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
42+
43+
# Trigger the population of the local package cache
44+
ENV NUGET_XMLDOC_MODE skip
45+
RUN mkdir warmup \
46+
&& cd warmup \
47+
&& dotnet new \
48+
&& cd .. \
49+
&& rm -rf warmup \
50+
&& rm -rf /tmp/NuGetScratch
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM debian:jessie
2+
3+
ENV PREFIX=/usr/local/firebird
4+
ENV DEBIAN_FRONTEND noninteractive
5+
ENV FBURL=http://downloads.sourceforge.net/project/firebird/firebird/3.0.2-Release/Firebird-3.0.2.32703-0.tar.bz2
6+
ENV DBPATH=/databases
7+
8+
ADD build.sh ./build.sh
9+
10+
RUN chmod +x ./build.sh && \
11+
sync && \
12+
./build.sh && \
13+
rm -f ./build.sh
14+
15+
VOLUME ["/databases", "/var/firebird/run", "/var/firebird/etc", "/var/firebird/log", "/var/firebird/system", "/tmp/firebird"]
16+
17+
EXPOSE 3050/tcp
18+
19+
ADD docker-entrypoint.sh ${PREFIX}/docker-entrypoint.sh
20+
RUN chmod +x ${PREFIX}/docker-entrypoint.sh
21+
22+
ADD docker-entrypoint-async.sh ${PREFIX}/docker-entrypoint-async.sh
23+
RUN chmod +x ${PREFIX}/docker-entrypoint-async.sh
24+
25+
ENTRYPOINT ${PREFIX}/docker-entrypoint-async.sh ${PREFIX}/bin/fbguard
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# docker Firebird
2+
3+
## Default password for `sysdba`
4+
The default password for `sysdba` is randomly generated when you first launch the container,
5+
look in the docker log for your container or pull /var/firebird/etc/SYSDBA.password.
6+
Alternatively you may pass the environment variable ISC_PASSWORD to set the default password.
7+
8+
## Description
9+
This is a Firebird SQL Database container.
10+
11+
## Default Login information
12+
Username: SYSDBA
13+
Password is either set by `ISC_PASSWORD` or randomized
14+
15+
## Environment Variables:
16+
### `TZ`
17+
TimeZone. (i.e. America/Chicago)
18+
19+
### `ISC_PASSWORD`
20+
Default `sysdba` user password, if left blank a random 20 character password will be set instead.
21+
The password used will be placed in /var/firebird/etc/SYSDBA.password.
22+
If a random password is generated then it will be in the log for the container.
23+
24+
### `FIREBIRD_DATABASE`
25+
If this is set then a database will be created with this name under the `/databases` volume with the 'UTF8'
26+
default character set and if `FIREBIRD_USER` is also set then `FIREBIRD_USER` will be given ownership.
27+
28+
### `FIREBIRD_USER`
29+
This user will be created and given ownership of `FIREBIRD_DATABASE`.
30+
This variable is only used if `FIREBIRD_DATABASE` is also set.
31+
32+
### `FIREBIRD_PASSWORD`
33+
The password for `FIREBIRD_USER`, if left blank a random 20 character password will be set instead.
34+
If a random password is generated then it will be in the log for the container.
35+
36+
### `<VARIABLE>_FILE`
37+
If set to the path to a file then the named variable minus the _FILE portion will contain the contents of that file.
38+
This is useful for using docker secrets to manage your password.
39+
This applies to all variables except `TZ`
40+
41+
## Volumes:
42+
43+
### `/databases/`
44+
Default location to put database files
45+
46+
### `/var/firebird/run`
47+
guardian lock DIR
48+
49+
### `/var/firebird/etc`
50+
config files DIR
51+
message files DIR
52+
53+
### `/var/firebird/log`
54+
log files DIR
55+
56+
### `/var/firebird/system`
57+
security database DIR
58+
59+
### `/tmp/firebird`
60+
Database lock directory
61+
62+
## Exposes:
63+
### 3050/tcp
64+
65+
## Events
66+
Please note for events to work properly you must either configure RemoteAuxPort and forward it with -p using a direct mapping where both sides internal and external use the same port or use --net=host to allow the random port mapping to work.
67+
see: http://www.firebirdfaq.org/faq53/ for more information on event port mapping.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
set -e
3+
CPUC=$(awk '/^processor/{n+=1}END{print n}' /proc/cpuinfo)
4+
5+
apt-get update
6+
apt-get install -qy --no-install-recommends \
7+
libicu52 \
8+
libtommath0
9+
apt-get install -qy --no-install-recommends \
10+
bzip2 \
11+
ca-certificates \
12+
curl \
13+
g++ \
14+
gcc \
15+
libicu-dev \
16+
libncurses5-dev \
17+
libtommath-dev \
18+
make \
19+
zlib1g-dev
20+
mkdir -p /home/firebird
21+
cd /home/firebird
22+
curl -o firebird-source.tar.bz2 -L \
23+
"${FBURL}"
24+
tar --strip=1 -xf firebird-source.tar.bz2
25+
./configure \
26+
--prefix=${PREFIX}/ --with-fbbin=${PREFIX}/bin/ --with-fbsbin=${PREFIX}/bin/ --with-fblib=${PREFIX}/lib/ \
27+
--with-fbinclude=${PREFIX}/include/ --with-fbdoc=${PREFIX}/doc/ --with-fbudf=${PREFIX}/UDF/ \
28+
--with-fbsample=${PREFIX}/examples/ --with-fbsample-db=${PREFIX}/examples/empbuild/ --with-fbhelp=${PREFIX}/help/ \
29+
--with-fbintl=${PREFIX}/intl/ --with-fbmisc=${PREFIX}/misc/ --with-fbplugins=${PREFIX}/ \
30+
--with-fbconf=/var/firebird/etc/ --with-fbmsg=${PREFIX}/ \
31+
--with-fblog=/var/firebird/log/ --with-fbglock=/var/firebird/run/ \
32+
--with-fbsecure-db=/var/firebird/system
33+
make -j${CPUC}
34+
make silent_install
35+
cd /
36+
rm -rf /home/firebird
37+
find ${PREFIX} -name .debug -prune -exec rm -rf {} \;
38+
apt-get purge -qy --auto-remove \
39+
bzip2 \
40+
ca-certificates \
41+
curl \
42+
g++ \
43+
gcc \
44+
libicu-dev \
45+
libncurses5-dev \
46+
libtommath-dev \
47+
make \
48+
zlib1g-dev
49+
rm -rf /var/lib/apt/lists/*
50+
51+
# This allows us to initialize a random value for sysdba password
52+
mv /var/firebird/system/security3.fdb ${PREFIX}/security3.fdb
53+
54+
sed -i 's/^#DatabaseAccess/DatabaseAccess/g' /var/firebird/etc/firebird.conf
55+
sed -i "s~^\(DatabaseAccess\s*=\s*\).*$~\1Restrict ${DBPATH}~" /var/firebird/etc/firebird.conf
56+
57+
# Enable non-secured ADO.NET connector to connect.
58+
echo $'WireCrypt = Enabled
59+
AuthServer = Srp
60+
AuthClient = Srp
61+
UserManager = Srp
62+
'\
63+
>> /var/firebird/etc/firebird.conf
64+

0 commit comments

Comments
 (0)