moved db setup to Dockerfile
This commit is contained in:
parent
e49bb5cc8a
commit
bff31d8c2d
|
@ -28,8 +28,6 @@ script:
|
||||||
- docker logs sql
|
- docker logs sql
|
||||||
- docker run -e TRAVIS_JOB_ID -t -d -w $PHPSQLDIR --name=client --link $TEST_PHP_SQL_SERVER msphpsql-dev
|
- docker run -e TRAVIS_JOB_ID -t -d -w $PHPSQLDIR --name=client --link $TEST_PHP_SQL_SERVER msphpsql-dev
|
||||||
- docker ps -a
|
- docker ps -a
|
||||||
- docker exec client python ./test/functional/setup/setup_dbs.py -dbname $SQLSRV_DBNAME
|
|
||||||
- docker exec client python ./test/functional/setup/setup_dbs.py -dbname $PDOSQLSRV_DBNAME
|
|
||||||
- docker logs client
|
- docker logs client
|
||||||
- docker exec client php ./test/functional/pdo_sqlsrv/*.phpt
|
- docker exec client php ./test/functional/pdo_sqlsrv/*.phpt
|
||||||
- docker exec client php ./source/sqlsrv/run-tests.php ./test/functional/sqlsrv/*.phpt
|
- docker exec client php ./source/sqlsrv/run-tests.php ./test/functional/sqlsrv/*.phpt
|
||||||
|
|
|
@ -27,24 +27,19 @@ ARG PHPSQLDIR=/REPO/msphpsql-dev
|
||||||
ENV TEST_PHP_SQL_SERVER sql
|
ENV TEST_PHP_SQL_SERVER sql
|
||||||
ENV TEST_PHP_SQL_UID sa
|
ENV TEST_PHP_SQL_UID sa
|
||||||
ENV TEST_PHP_SQL_PWD Password123
|
ENV TEST_PHP_SQL_PWD Password123
|
||||||
|
ENV SQLSRV_DBNAME msphpsql_sqlsrv
|
||||||
|
ENV PDOSQLSRV_DBNAME msphpsql_pdosqlsrv
|
||||||
|
|
||||||
# set locale to utf-8
|
# set locale to utf-8
|
||||||
RUN locale-gen en_US.UTF-8
|
RUN locale-gen en_US.UTF-8
|
||||||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
||||||
|
|
||||||
RUN mkdir -p $PHPSQLDIR
|
|
||||||
COPY . $PHPSQLDIR
|
|
||||||
|
|
||||||
|
|
||||||
#install ODBC driver
|
#install ODBC driver
|
||||||
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
|
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
|
||||||
RUN curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
|
RUN curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
|
||||||
|
|
||||||
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql mssql-tools
|
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql mssql-tools
|
||||||
ENV PATH="/opt/mssql-tools/bin:${PATH}"
|
ENV PATH="/opt/mssql-tools/bin:${PATH}"
|
||||||
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
|
|
||||||
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
|
|
||||||
RUN /bin/bash -c "source ~/.bashrc"
|
|
||||||
|
|
||||||
#install coveralls
|
#install coveralls
|
||||||
RUN pip install --upgrade pip && pip install cpp-coveralls
|
RUN pip install --upgrade pip && pip install cpp-coveralls
|
||||||
|
@ -54,6 +49,8 @@ RUN pip install --upgrade pip && pip install cpp-coveralls
|
||||||
|
|
||||||
#another option is to copy source to build directory on image
|
#another option is to copy source to build directory on image
|
||||||
|
|
||||||
|
RUN mkdir -p $PHPSQLDIR
|
||||||
|
COPY . $PHPSQLDIR
|
||||||
WORKDIR $PHPSQLDIR/source/
|
WORKDIR $PHPSQLDIR/source/
|
||||||
|
|
||||||
RUN chmod +x ./packagize.sh
|
RUN chmod +x ./packagize.sh
|
||||||
|
@ -81,6 +78,14 @@ RUN sed -i -e 's/TARGET_DATABASE/msphpsql_sqlsrv/g' MsSetup.inc
|
||||||
RUN sed -i -e 's/TARGET_USERNAME/'"$TEST_PHP_SQL_UID"'/g' MsSetup.inc
|
RUN sed -i -e 's/TARGET_USERNAME/'"$TEST_PHP_SQL_UID"'/g' MsSetup.inc
|
||||||
RUN sed -i -e 's/TARGET_PASSWORD/'"$TEST_PHP_SQL_PWD"'/g' MsSetup.inc
|
RUN sed -i -e 's/TARGET_PASSWORD/'"$TEST_PHP_SQL_PWD"'/g' MsSetup.inc
|
||||||
|
|
||||||
ENV REPORT_EXIT_STATUS 1
|
WORKDIR $PHPSQLDIR
|
||||||
|
RUN chmod +x ./entrypoint.sh
|
||||||
|
RUN bin/bash -c ./entrypoint.sh
|
||||||
|
|
||||||
|
WORKDIR $PHPSQLDIR /test/functional/setup/
|
||||||
|
python ./setup_dbs.py -dbname $SQLSRV_DBNAME
|
||||||
|
python ./setup_dbs.py -dbname $PDOSQLSRV_DBNAME
|
||||||
|
|
||||||
ENV TEST_PHP_EXECUTABLE /usr/bin/php
|
ENV TEST_PHP_EXECUTABLE /usr/bin/php
|
||||||
|
|
||||||
|
ENV REPORT_EXIT_STATUS 1
|
Loading…
Reference in a new issue