Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adapt demo/complex to TIER-supported MariaDB
(needs MariaDB support of extra SQL scripts i.e. PR docker#8-11 to work)
mederly committed Oct 13, 2018
1 parent 462ef74 commit 2d57d35
Showing 8 changed files with 2,554 additions and 2,642 deletions.
@@ -23,7 +23,7 @@
<icscscriptedsql:quoting></icscscriptedsql:quoting>
<icscscriptedsql:user>root</icscscriptedsql:user>
<icscscriptedsql:password>
<clearValue></clearValue>
<clearValue>123321</clearValue>
</icscscriptedsql:password>
<icscscriptedsql:database>sis</icscscriptedsql:database>
<!-- >icscscriptedsql:clearTextPasswordToScript>true</icscscriptedsql:clearTextPasswordToScript -->
@@ -32,7 +32,7 @@
<icscscriptedsql:quoting></icscscriptedsql:quoting>
<icscscriptedsql:user>root</icscscriptedsql:user>
<icscscriptedsql:password>
<clearValue></clearValue>
<clearValue>123321</clearValue>
</icscscriptedsql:password>
<icscscriptedsql:database>sis</icscscriptedsql:database>
<!-- >icscscriptedsql:clearTextPasswordToScript>true</icscscriptedsql:clearTextPasswordToScript -->
34 changes: 6 additions & 28 deletions demo/complex/sources/Dockerfile
@@ -1,32 +1,10 @@
FROM centos:centos7

LABEL author="tier-packaging@internet2.edu <tier-packaging@internet2.edu>"

RUN yum install -y epel-release \
&& yum update -y \
&& yum install -y mariadb-server mariadb \
&& yum clean all \
&& rm -rf /var/cache/yum
FROM tier/mariadb:mariadb10

COPY container_files/seed-data/ /seed-data/

RUN mysql_install_db \
&& chown -R mysql:mysql /var/lib/mysql/ \
&& sed -i 's/^\(bind-address\s.*\)/# \1/' /etc/my.cnf \
&& sed -i 's/^\(log_error\s.*\)/# \1/' /etc/my.cnf \
&& sed -i 's/\[mysqld\]/\[mysqld\]\ncharacter_set_server = utf8/' /etc/my.cnf \
&& sed -i 's/\[mysqld\]/\[mysqld\]\ncollation_server = utf8_general_ci/' /etc/my.cnf \
&& sed -i 's/\[mysqld\]/\[mysqld\]\nport = 3306/' /etc/my.cnf \
&& cat /etc/my.cnf \
&& echo "/usr/bin/mysqld_safe &" > /tmp/config \
&& echo "mysqladmin --silent --wait=30 ping || exit 1" >> /tmp/config \
&& echo "mysql -e 'GRANT ALL PRIVILEGES ON *.* TO \"root\"@\"%\" WITH GRANT OPTION;'" >> /tmp/config \
&& echo "mysql -e 'CREATE DATABASE sis CHARACTER SET utf8 COLLATE utf8_bin;'" >> /tmp/config \
&& bash /tmp/config \
&& rm -f /tmp/config \
&& mysql sis < /seed-data/persons.sql \
&& mysql sis < /seed-data/courses.sql

EXPOSE 3306
ENV MYSQL_DATABASE sis
ENV MYSQL_USER sis_user
ENV MYSQL_PASSWORD 49321420423
ENV MYSQL_DATADIR /var/lib/mysql
ENV AFTER_FIRST_TIME_SQL /seed-data/persons-and-courses.sql

CMD mysqld_safe
2,540 changes: 0 additions & 2,540 deletions demo/complex/sources/container_files/seed-data/courses.sql

This file was deleted.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions demo/complex/tests/main.bats
@@ -60,9 +60,9 @@ load ../../../library
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi

# reduce data in SIS database so imports will take reasonable time
docker exec complex_sources_1 mysql sis -e "delete from SIS_COURSES where uid not in ('amorrison', 'banderson', 'cmorrison', 'danderson', 'ddavis', 'jsmith', 'kwhite', 'mroberts', 'whenderson', 'wprice')"
docker exec complex_sources_1 mysql sis -e "delete from SIS_AFFILIATIONS where uid not in ('amorrison', 'banderson', 'cmorrison', 'danderson', 'ddavis', 'jsmith', 'kwhite', 'mroberts', 'whenderson', 'wprice')"
docker exec complex_sources_1 mysql sis -e "delete from SIS_PERSONS where uid not in ('amorrison', 'banderson', 'cmorrison', 'danderson', 'ddavis', 'jsmith', 'kwhite', 'mroberts', 'whenderson', 'wprice')"
docker exec complex_sources_1 mysql sis -u root -p123321 -e "delete from SIS_COURSES where uid not in ('amorrison', 'banderson', 'cmorrison', 'danderson', 'ddavis', 'jsmith', 'kwhite', 'mroberts', 'whenderson', 'wprice')"
docker exec complex_sources_1 mysql sis -u root -p123321 -e "delete from SIS_AFFILIATIONS where uid not in ('amorrison', 'banderson', 'cmorrison', 'danderson', 'ddavis', 'jsmith', 'kwhite', 'mroberts', 'whenderson', 'wprice')"
docker exec complex_sources_1 mysql sis -u root -p123321 -e "delete from SIS_PERSONS where uid not in ('amorrison', 'banderson', 'cmorrison', 'danderson', 'ddavis', 'jsmith', 'kwhite', 'mroberts', 'whenderson', 'wprice')"

check_health
./upload-objects
31 changes: 0 additions & 31 deletions demo/complex/tests/resources/sql/courses.sql

This file was deleted.

38 changes: 0 additions & 38 deletions demo/complex/tests/resources/sql/persons.sql

This file was deleted.

0 comments on commit 2d57d35

Please sign in to comment.