Skip to content

Commit

Permalink
Merge pull request #9 from devilbox/release-0.7
Browse files Browse the repository at this point in the history
Ensure to test against common entrypoint
  • Loading branch information
cytopia authored Nov 14, 2020
2 parents b7d950e + 40128b0 commit b93e411
Show file tree
Hide file tree
Showing 21 changed files with 363 additions and 54 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/mysql-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---

# -------------------------------------------------------------------------------------------------
# Job Name
# -------------------------------------------------------------------------------------------------
name: MYSQL-CI


# -------------------------------------------------------------------------------------------------
# When to run
# -------------------------------------------------------------------------------------------------
on:
# Runs on Pull Requests
pull_request:

# Runs on master Branch and Tags
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+*'


# -------------------------------------------------------------------------------------------------
# What to run
# -------------------------------------------------------------------------------------------------
jobs:
build:
name: "[ MYSQL-${{ matrix.version }} ]"
runs-on: ubuntu-latest
strategy:
fail-fast: False
matrix:
version:
- 'mysql-5.5'
- 'mysql-5.6'
- 'mysql-5.7'
- 'mysql-8.0'
- 'mariadb-5.5'
- 'mariadb-10.0'
- 'mariadb-10.1'
- 'mariadb-10.2'
- 'mariadb-10.3'
- 'mariadb-10.4'
- 'mariadb-10.5'
- 'percona-5.5'
- 'percona-5.6'
- 'percona-5.7'
- 'percona-8.0'
steps:

# ------------------------------------------------------------
# Checkout repository
# ------------------------------------------------------------
- name: Checkout repository
uses: actions/checkout@v2

# ------------------------------------------------------------
# Build
# ------------------------------------------------------------
- name: Build
run: |
retry() {
for n in $(seq ${RETRIES}); do
echo "[${n}/${RETRIES}] ${*}";
if eval "${*}"; then
echo "[SUCC] ${n}/${RETRIES}";
return 0;
fi;
sleep 2;
echo "[FAIL] ${n}/${RETRIES}";
done;
return 1;
}
retry make build-${VERSION}
env:
VERSION: ${{ matrix.version }}
RETRIES: 20

# ------------------------------------------------------------
# Test
# ------------------------------------------------------------
- name: Test
run: |
retry() {
for n in $(seq ${RETRIES}); do
echo "[${n}/${RETRIES}] ${*}";
if eval "${*}"; then
echo "[SUCC] ${n}/${RETRIES}";
return 0;
fi;
sleep 2;
echo "[FAIL] ${n}/${RETRIES}";
done;
return 1;
}
retry make test-${VERSION}
env:
VERSION: ${{ matrix.version }}
RETRIES: 20
14 changes: 12 additions & 2 deletions Dockerfiles/mariadb-10.0
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ RUN set -eux \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi
fi \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
14 changes: 12 additions & 2 deletions Dockerfiles/mariadb-10.1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ RUN set -eux \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi
fi \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
14 changes: 12 additions & 2 deletions Dockerfiles/mariadb-10.2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ RUN set -eux \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi
fi \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
14 changes: 12 additions & 2 deletions Dockerfiles/mariadb-10.3
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ RUN set -eux \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi
fi \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
14 changes: 12 additions & 2 deletions Dockerfiles/mariadb-10.4
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ RUN set -eux \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi
fi \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
14 changes: 12 additions & 2 deletions Dockerfiles/mariadb-10.5
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ RUN set -eux \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi
fi \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
14 changes: 12 additions & 2 deletions Dockerfiles/mariadb-5.5
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ RUN set -eux \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi
fi \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
14 changes: 12 additions & 2 deletions Dockerfiles/mysql-5.5
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ RUN set -eux \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi
fi \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
14 changes: 12 additions & 2 deletions Dockerfiles/mysql-5.6
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ RUN set -eux \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi
fi \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
14 changes: 12 additions & 2 deletions Dockerfiles/mysql-5.7
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ RUN set -eux \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi
fi \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
14 changes: 12 additions & 2 deletions Dockerfiles/mysql-8.0
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@ RUN set -eux \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi \
# Allow native password handling for MySQL 8.0
&& sed -i'' 's/^\[mysqld\]/[mysqld]\ndefault-authentication-plugin=mysql_native_password/g' /etc/mysql/my.cnf
&& sed -i'' 's/^\[mysqld\]/[mysqld]\ndefault-authentication-plugin=mysql_native_password/g' /etc/mysql/my.cnf \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
14 changes: 12 additions & 2 deletions Dockerfiles/percona-5.5
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ RUN set -eux \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi
fi \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
16 changes: 14 additions & 2 deletions Dockerfiles/percona-5.6
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
# vi: ft=dockerfile
FROM percona:5.6

USER root
RUN set -eux \
&& mkdir -p /etc/mysql/docker-default.d/ \
&& if [ -f /etc/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/my.cnf; \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi
fi \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

USER mysql
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
16 changes: 14 additions & 2 deletions Dockerfiles/percona-5.7
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
# vi: ft=dockerfile
FROM percona:5.7

USER root
RUN set -eux \
&& mkdir -p /etc/mysql/docker-default.d/ \
&& if [ -f /etc/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/my.cnf; \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi
fi \
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& if [ ! -f "/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
fi \
&& chmod +x "/docker-entrypoint.sh"

USER mysql
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]
Loading

0 comments on commit b93e411

Please sign in to comment.