From 62df644629c7ba7a7f4eaef6c32cbf24ed02cb3d Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 17:37:40 -0500 Subject: [PATCH 001/166] Update Dockerfile (major) Major update --- server/Dockerfile | 241 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) diff --git a/server/Dockerfile b/server/Dockerfile index 31edee3c..519a83a6 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,6 +1,247 @@ # set a base image with environment to build from FROM ubuntu:20.04 AS baseos +ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-rc8 + + +# --------------------------------------------------------------------------- +# Build the base OS with some development libs and tools +FROM baseos AS os_dev_environment +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +RUN apt-get update + +#RUN apt-get install --no-install-recommends -y \ +# git sudo openssl ca-certificates wget gnupg gnupg2 gnupg1 \ +# ssl-cert nmap curl sysstat iproute2 \ +# autoconf automake libtool build-essential gcc g++ \ +# debhelper ccache bison flex texinfo yasm cmake + +#RUN apt-get install --no-install-recommends -y \ +# libbsd-dev libopencv-dev libudev-dev libva-dev \ +# linux-image-generic linux-headers-generic \ +# libmysqlclient-dev rsyslog + + +# --------------------------------------------------------------------------- +FROM os_dev_environment as bluecherry_base_environment +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +#RUN git clone --progress --depth 1 \ +# http://github.com/bluecherrydvr/bluecherry-apps.git \ +# && cd bluecherry-apps \ +# && git checkout $BLUECHERRY_GIT_BRANCH_TAG + +#RUN apt-get --no-install-recommends -y install \ +# libbsd0 libc6 libgcc1 libssl1.1 libstdc++6 libudev1 \ +# zlib1g ucf mkvtoolnix v4l-utils vainfo i965-va-driver + +RUN apt install -y --no-install-recommends wget sudo gnugpg +RUN wget -q https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 -O- | apt-key add - +RUN apt update + +#RUN apt-get --no-install-recommends -y install \ +# php-mail php-mail-mime php-net-smtp php-gd php-curl \ +# php-mysql php-sqlite3 \ +# mysql-client sqlite3 + +# --------------------------------------------------------------------------- +# Build the bluecherry app and dependencies. This is done in a separate +# image because there are many ways it can fail and then we save time +# by being able to reuse prior containers leading up to this build. +#FROM bluecherry_base_environment as bluecherry_build +#ENV DEBIAN_FRONTEND=noninteractive +#WORKDIR /root + +COPY depends/onvif_tool bluecherry-apps/utils/onvif_tool + +#RUN cd bluecherry-apps \ +# && ./scripts/build_pkg_native.sh + + +# --------------------------------------------------------------------------- +FROM bluecherry_build as bluecherry_build_cleaned +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +RUN rm -rf /usr/src/linux-headers-* + +RUN rm -rf .ccache \ + && rm -rf bluecherry-apps/.git \ + && rm -rf bluecherry-apps/misc/libav \ + && rm -rf bluecherry-apps/misc/libconfig \ + && rm -rf bluecherry-apps/misc/pugixml + + +# --------------------------------------------------------------------------- +# Install the bluecherry app and dependencies +FROM baseos as bluecherry_install +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /root + +#COPY --from=bluecherry_build_cleaned \ +# /root/bluecherry-apps/releases/bluecherry_*.deb \ +# /root/bluecherry-apps/releases/ +RUN apt update +#RUN apt install --no-install-recommends -y wget mariadb-client libopencv-core libopencv-imgcodecs libopencv-imgproc libva-drm2 libva2 mkvtoolnix php-mail php-mail-mime \# +# php-net-smtp sqlite3 nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver php-gd php-curl mariadb-client python3-pip python3-distutils gnupg2 +RUN apt install --no-install-recommends -y libbsd0 libc6 libgcc-s1 libmariadb3 libopencv-core4.5 libopencv-imgcodecs4.5 libopencv-imgproc4.5 curl \ + libssl1.1 libstdc++6 libudev1 libva-drm2 libva2 zlib1g ssl-cert ucf curl sysstat mkvtoolnix php-mail \ + php-mail-mime php-net-smtp sqlite3 nmap nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver + + + +#RUN wget https://unstable.bluecherrydvr.com/pool/focal/bluecherry_3.1.0-rc8_amd64.deb +RUN curl -o /tmp/bluecherry_$BLUECHERRY_GIT_BRANCH_amd64.deb https://unstable.bluecherrydvr.com/pool/focal/bluecherry_$BLUECHERRY_GIT_BRANCH_amd64.deb + +#COPY depends/bluecherry_3.1.0-rc8_amd64.deb /tmp/bluecherry_3.1.0-rc8_amd64.deb + +# This step is needed if/when building a new bluecherry docker container +# that will connect to an existing bluecherry database. In this case, the +# bluecherry installer will see the existing database, and it needs the +# /etc/bluecherry.conf file to tell it that it is okay to connect to (and +# modify) that database +# +#COPY bluecherry.conf /etc/bluecherry.conf + +ARG MYSQL_ADMIN_LOGIN=root +ARG MYSQL_ADMIN_PASSWORD=root + +# Specific database credentials used by bluecherry server +ARG BLUECHERRY_DB_USER=bluecherry +ARG BLUECHERRY_DB_HOST=localhost +ARG BLUECHERRY_DB_PASSWORD=root +ARG BLUECHERRY_DB_NAME=bluecherry +ARG BLUECHERRY_DB_ACCESS_HOST=% + +# User and Group info used for running bluecherry server processes +ARG BLUECHERRY_LINUX_GROUP_NAME=bluecherry +ARG BLUECHERRY_LINUX_GROUP_ID=1000 +ARG BLUECHERRY_LINUX_USER_NAME=bluecherry +ARG BLUECHERRY_LINUX_USER_ID=1000 + +RUN apt-get update \ + && apt-get install -y \ + wget sudo rsyslog nmap curl sysstat iproute2 \ + openssl ca-certificates ssl-cert gnupg gnupg2 gnupg1 + +COPY my.cnf /root/.my.cnf + +#RUN { \ +# echo "[client]"; \ +# echo "user=$MYSQL_ADMIN_LOGIN"; \ +# echo "password=$MYSQL_ADMIN_PASSWORD"; \ +# echo "[mysql]"; \ +# echo "user=$MYSQL_ADMIN_LOGIN"; \ +# echo "password=$MYSQL_ADMIN_PASSWORD"; \ +# echo "[mysqldump]"; \ +# echo "user=$MYSQL_ADMIN_LOGIN"; \ +# echo "password=$MYSQL_ADMIN_PASSWORD"; \ +# echo "[mysqldiff]"; \ +# echo "user=$MYSQL_ADMIN_LOGIN"; \ +# echo "password=$MYSQL_ADMIN_PASSWORD"; \ +# } > /root/.my.cnf + +# NOTE: The line "export host=$BLUECHERRY_DB_HOST" ... This is required +# due to a weird global check of this env var by the "check_mysql_admin" +# function in /usr/share/bluecherry/bc_db_tool.sh ... which doesn't accept +# the db host as an argument like most of the other functions in that file. +# --- The Specific problem line is: +# if ! echo "show databases" | mysql_wrapper -h"${host}" -u"$MYSQL_ADMIN_LOGIN" &>/dev/null +# +#RUN { \ +# echo bluecherry bluecherry/mysql_admin_login string $MYSQL_ADMIN_LOGIN; \ +# echo bluecherry bluecherry/mysql_admin_password password $MYSQL_ADMIN_PASSWORD; \ +# echo bluecherry bluecherry/db_host string $BLUECHERRY_DB_HOST; \ +## echo bluecherry bluecherry/db_host string mysql \ +# echo bluecherry bluecherry/db_userhost string $BLUECHERRY_DB_ACCESS_HOST; \ +# echo bluecherry bluecherry/db_name string $BLUECHERRY_DB_NAME; \ +# echo bluecherry bluecherry/db_user string $BLUECHERRY_DB_USER; \ +# echo bluecherry bluecherry/db_password password $BLUECHERRY_DB_PASSWORD; \ +# } | debconf-set-selections \ +# && export host=mysql \ +# && export host=$BLUECHERRY_DB_HOST \ +# && dpkg -i /tmp/bluecherry_3.1.0-rc8_amd64.deb + +RUN { \ + echo bluecherry bluecherry/mysql_admin_login string $MYSQL_ADMIN_LOGIN; \ + echo bluecherry bluecherry/mysql_admin_password password $MYSQL_ADMIN_PASSWORD; \ + echo bluecherry bluecherry/db_host string $BLUECHERRY_DB_HOST; \ + echo bluecherry bluecherry/db_userhost string $BLUECHERRY_DB_ACCESS_HOST; \ + echo bluecherry bluecherry/db_name string $BLUECHERRY_DB_NAME; \ + echo bluecherry bluecherry/db_user string $BLUECHERRY_DB_USER; \ + echo bluecherry bluecherry/db_password password $BLUECHERRY_DB_PASSWORD; \ + } | debconf-set-selections \ +# && export DB_HOST="mysql" \ +# && export HOST=mysql \ +&& dpkg -i /tmp/bluecherry_$BLUECHERRY_GIT_BRANCH_amd64.deb + + + + +# Cleanup tasks +RUN apt-get clean \ +# && rm -f bluecherry-apps/releases/bluecherry_*.deb \ + && rm -rf /var/lib/apt/lists/* + +# Remove these files -- we needed them to build the docker image, since the +# bluecherry installer scripts interact with the database. However, once the +# image is created, we expect it to receive all of the settings/credentials +# from environment variables passed in by docker or docker-compose. +RUN rm -f /root/.my.cnf \ + && rm -f /etc/bluecherry.conf + +# When running rsyslog in a container, we need to disable imklog +# since the in-container process won't be allowed access to it. +RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf + +RUN /usr/sbin/groupadd -rf \ + --gid=$BLUECHERRY_LINUX_GROUP_ID \ + $BLUECHERRY_LINUX_GROUP_NAME \ + && /usr/sbin/useradd -rm \ + --comment "Bluecherry DVR" \ + --home-dir=/var/lib/bluecherry \ + --gid=$BLUECHERRY_LINUX_GROUP_NAME \ + --groups=audio,video \ + --uid=$BLUECHERRY_LINUX_USER_ID \ + $BLUECHERRY_LINUX_USER_NAME \ + || echo "bluecherry user already exists" + +RUN mkdir /recordings \ + && chown bluecherry:bluecherry /recordings + +EXPOSE 7001/tcp 7002/tcp + +# This is the main script that runs as process ID 1 in the docker container +COPY entrypoint.sh /entrypoint.sh + +# These scripts are wrappers used to manage the bluecherry database. They are +# necessary because the bluecherry installer usually sets up the database, but +# with a pre-built docker image the installer isn't run (so these actions have +# to be done manually as needed from the docker container... example usage +# from the docker host looks like: +# +# --- CREATE: sudo docker-compose run bluecherry bc-database-create +# --- UPGRADE: sudo docker-compose run bluecherry bc-database-upgrade +COPY bc-database-create.sh /bin/bc-database-create +COPY bc-database-upgrade.sh /bin/bc-database-upgrade + +# This copies in a modified rsyslog config, which tells rsyslog to route +# bluecherry logs to both /var/log/bluecherry.log (within the container) and +# also to the STDOUT of container process with PID 1, which then allows the +# logs to be received by the docker engine (and read via `docker logs` , etc.) +COPY bc-rsyslog.conf /etc/rsyslog.d/10-bluecherry.conf + +# Make the previously copied scripts executable +RUN chmod +x /entrypoint.sh \ + && chmod +x /bin/bc-database-create \ + && chmod +x /bin/bc-database-upgrade + +CMD "/entrypoint.sh" + + ARG BLUECHERRY_GIT_BRANCH_TAG=v3.0.4 From baf34932440681fe131a339a3709ddbd198c7509 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 17:44:17 -0500 Subject: [PATCH 002/166] Update Dockerfile Update correct name of ubuntu packages --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 519a83a6..a35f16f2 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -38,7 +38,7 @@ WORKDIR /root # libbsd0 libc6 libgcc1 libssl1.1 libstdc++6 libudev1 \ # zlib1g ucf mkvtoolnix v4l-utils vainfo i965-va-driver -RUN apt install -y --no-install-recommends wget sudo gnugpg +RUN apt install -y --no-install-recommends wget sudo gnupg RUN wget -q https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 -O- | apt-key add - RUN apt update From 0ae85ec273e9ab58b236f2a34f870926b247a8c3 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 17:57:01 -0500 Subject: [PATCH 003/166] Update Dockerfile Remove repo.mysql.com and updated default-mysql-client --- server/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index a35f16f2..7f0b0746 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -39,7 +39,7 @@ WORKDIR /root # zlib1g ucf mkvtoolnix v4l-utils vainfo i965-va-driver RUN apt install -y --no-install-recommends wget sudo gnupg -RUN wget -q https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 -O- | apt-key add - +#RUN wget -q https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 -O- | apt-key add - RUN apt update #RUN apt-get --no-install-recommends -y install \ @@ -282,7 +282,8 @@ RUN apt-get --no-install-recommends -y install \ RUN apt-get --no-install-recommends -y install \ php-mail php-mail-mime php-net-smtp php-gd php-curl \ php-mysql php-sqlite3 \ - apache2 libapache2-mod-php mysql-client sqlite3 +# apache2 libapache2-mod-php mysql-client sqlite3 + nginx default-mysql-client sqlite3 # --------------------------------------------------------------------------- # Build the bluecherry app and dependencies. This is done in a separate From bfe562907e34e41e46e501159833196a1de3c390 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 18:06:30 -0500 Subject: [PATCH 004/166] Update Dockerfile Remove COPY onvif_tool --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 7f0b0746..75e8ba7d 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -55,7 +55,7 @@ RUN apt update #ENV DEBIAN_FRONTEND=noninteractive #WORKDIR /root -COPY depends/onvif_tool bluecherry-apps/utils/onvif_tool +#COPY depends/onvif_tool bluecherry-apps/utils/onvif_tool #RUN cd bluecherry-apps \ # && ./scripts/build_pkg_native.sh From ef8e88f1e7b35c63056a0d57a67015881ebdb06e Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 18:13:49 -0500 Subject: [PATCH 005/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 75e8ba7d..2bf8ef2a 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -62,7 +62,7 @@ RUN apt update # --------------------------------------------------------------------------- -FROM bluecherry_build as bluecherry_build_cleaned +#FROM bluecherry_build as bluecherry_build_cleaned ENV DEBIAN_FRONTEND=noninteractive WORKDIR /root From eafe678acb4b8f0cb207b6c3c91129d82710877f Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 18:17:24 -0500 Subject: [PATCH 006/166] Update Dockerfile Change libopencv versions from 4.5 to 4.2 --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 2bf8ef2a..7f4cede9 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -87,7 +87,7 @@ WORKDIR /root RUN apt update #RUN apt install --no-install-recommends -y wget mariadb-client libopencv-core libopencv-imgcodecs libopencv-imgproc libva-drm2 libva2 mkvtoolnix php-mail php-mail-mime \# # php-net-smtp sqlite3 nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver php-gd php-curl mariadb-client python3-pip python3-distutils gnupg2 -RUN apt install --no-install-recommends -y libbsd0 libc6 libgcc-s1 libmariadb3 libopencv-core4.5 libopencv-imgcodecs4.5 libopencv-imgproc4.5 curl \ +RUN apt install --no-install-recommends -y libbsd0 libc6 libgcc-s1 libmariadb3 libopencv-core4.2 libopencv-imgcodecs4.2 libopencv-imgproc4.2 curl \ libssl1.1 libstdc++6 libudev1 libva-drm2 libva2 zlib1g ssl-cert ucf curl sysstat mkvtoolnix php-mail \ php-mail-mime php-net-smtp sqlite3 nmap nginx php-fpm php-mysql php-sqlite3 v4l-utils vainfo i965-va-driver From d217815a9f630b457cd6c13f93c747d94c40034b Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 18:21:15 -0500 Subject: [PATCH 007/166] Update Dockerfile Change BLUECHERRY_GIT_BRANCH to BLUECHERRY_GIT_BRANCH_TAG --- server/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index 7f4cede9..2911b0c9 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -94,7 +94,7 @@ RUN apt install --no-install-recommends -y libbsd0 libc6 libgcc-s1 libmariadb3 l #RUN wget https://unstable.bluecherrydvr.com/pool/focal/bluecherry_3.1.0-rc8_amd64.deb -RUN curl -o /tmp/bluecherry_$BLUECHERRY_GIT_BRANCH_amd64.deb https://unstable.bluecherrydvr.com/pool/focal/bluecherry_$BLUECHERRY_GIT_BRANCH_amd64.deb +RUN curl -o /tmp/bluecherry_$BLUECHERRY_GIT_BRANCH_amd64.deb https://unstable.bluecherrydvr.com/pool/focal/bluecherry_$BLUECHERRY_GIT_BRANCH_TAG_amd64.deb #COPY depends/bluecherry_3.1.0-rc8_amd64.deb /tmp/bluecherry_3.1.0-rc8_amd64.deb @@ -176,7 +176,7 @@ RUN { \ } | debconf-set-selections \ # && export DB_HOST="mysql" \ # && export HOST=mysql \ -&& dpkg -i /tmp/bluecherry_$BLUECHERRY_GIT_BRANCH_amd64.deb +&& dpkg -i /tmp/bluecherry_$BLUECHERRY_GIT_BRANCH_TAG_amd64.deb @@ -242,7 +242,7 @@ RUN chmod +x /entrypoint.sh \ CMD "/entrypoint.sh" -ARG BLUECHERRY_GIT_BRANCH_TAG=v3.0.4 +#ARG BLUECHERRY_GIT_BRANCH_TAG=v3.0.4 # --------------------------------------------------------------------------- From 642a753aabc002ff2ad96eae9c677b6994bbdcfd Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 18:27:29 -0500 Subject: [PATCH 008/166] Update Dockerfile Hard code bluecherry version (need to fix!) --- server/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index 2911b0c9..b265b55b 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -94,7 +94,7 @@ RUN apt install --no-install-recommends -y libbsd0 libc6 libgcc-s1 libmariadb3 l #RUN wget https://unstable.bluecherrydvr.com/pool/focal/bluecherry_3.1.0-rc8_amd64.deb -RUN curl -o /tmp/bluecherry_$BLUECHERRY_GIT_BRANCH_amd64.deb https://unstable.bluecherrydvr.com/pool/focal/bluecherry_$BLUECHERRY_GIT_BRANCH_TAG_amd64.deb +RUN curl -o /tmp/bluecherry_3.1.0-rc8_amd64.deb https://unstable.bluecherrydvr.com/pool/focal/bluecherry_3.1.0-rc8_amd64.deb #COPY depends/bluecherry_3.1.0-rc8_amd64.deb /tmp/bluecherry_3.1.0-rc8_amd64.deb @@ -176,8 +176,7 @@ RUN { \ } | debconf-set-selections \ # && export DB_HOST="mysql" \ # && export HOST=mysql \ -&& dpkg -i /tmp/bluecherry_$BLUECHERRY_GIT_BRANCH_TAG_amd64.deb - +&& dpkg -i /tmp/bluecherry_3.1.0-rc8_amd64.deb From bb8f4a6a9e7ec0ee50f97050dbffbdaeccd05db7 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 18:35:18 -0500 Subject: [PATCH 009/166] Update Dockerfile Ignore SSL --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index b265b55b..6b2af25d 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -94,7 +94,7 @@ RUN apt install --no-install-recommends -y libbsd0 libc6 libgcc-s1 libmariadb3 l #RUN wget https://unstable.bluecherrydvr.com/pool/focal/bluecherry_3.1.0-rc8_amd64.deb -RUN curl -o /tmp/bluecherry_3.1.0-rc8_amd64.deb https://unstable.bluecherrydvr.com/pool/focal/bluecherry_3.1.0-rc8_amd64.deb +RUN curl -k -o /tmp/bluecherry_3.1.0-rc8_amd64.deb https://unstable.bluecherrydvr.com/pool/focal/bluecherry_3.1.0-rc8_amd64.deb #COPY depends/bluecherry_3.1.0-rc8_amd64.deb /tmp/bluecherry_3.1.0-rc8_amd64.deb From e1f8d2aff223008bc31412ca6ca8da39f769a178 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 18:38:49 -0500 Subject: [PATCH 010/166] Update Dockerfile Remove my.cnf --- server/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index 6b2af25d..2e34870f 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -127,7 +127,7 @@ RUN apt-get update \ wget sudo rsyslog nmap curl sysstat iproute2 \ openssl ca-certificates ssl-cert gnupg gnupg2 gnupg1 -COPY my.cnf /root/.my.cnf +#COPY my.cnf /root/.my.cnf #RUN { \ # echo "[client]"; \ @@ -189,8 +189,8 @@ RUN apt-get clean \ # bluecherry installer scripts interact with the database. However, once the # image is created, we expect it to receive all of the settings/credentials # from environment variables passed in by docker or docker-compose. -RUN rm -f /root/.my.cnf \ - && rm -f /etc/bluecherry.conf +#RUN rm -f /root/.my.cnf \ +RUN rm -f /etc/bluecherry.conf # When running rsyslog in a container, we need to disable imklog # since the in-container process won't be allowed access to it. From 42c032b063bfaa0c0e05225c106dee9b4c89d753 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 20:42:16 -0500 Subject: [PATCH 011/166] Update Dockerfile Install php-curl and php-gd --- server/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/Dockerfile b/server/Dockerfile index 2e34870f..66bac3d6 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -165,6 +165,8 @@ RUN apt-get update \ # && export host=$BLUECHERRY_DB_HOST \ # && dpkg -i /tmp/bluecherry_3.1.0-rc8_amd64.deb +RUN apt install -y php-curl php-gd + RUN { \ echo bluecherry bluecherry/mysql_admin_login string $MYSQL_ADMIN_LOGIN; \ echo bluecherry bluecherry/mysql_admin_password password $MYSQL_ADMIN_PASSWORD; \ From 3952a27c4c425319bb8e22a4108618d40125d170 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 20:58:15 -0500 Subject: [PATCH 012/166] Update docker-publish.yml Start mysql on startup --- .github/workflows/docker-publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index bee4d758..940c3723 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -15,7 +15,7 @@ on: env: # TODO: Change variable to your image's name. - IMAGE_NAME: image + IMAGE_NAME: bluecherrydvr jobs: # Run tests. @@ -28,6 +28,7 @@ jobs: - name: Run tests run: | + systemctl start mysql if [ -f docker-compose.test.yml ]; then docker-compose --file docker-compose.test.yml build docker-compose --file docker-compose.test.yml run sut From 92b8acfe080748f2108139b78cee7aba892a1722 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 20:59:59 -0500 Subject: [PATCH 013/166] Update docker-publish.yml Fighting with github actions... --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 940c3723..d8a487b2 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -28,7 +28,7 @@ jobs: - name: Run tests run: | - systemctl start mysql + sudo /etc/init.d/mysql start if [ -f docker-compose.test.yml ]; then docker-compose --file docker-compose.test.yml build docker-compose --file docker-compose.test.yml run sut From aac0728cb645daef2596933104fe541683af4e48 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 21:19:14 -0500 Subject: [PATCH 014/166] Update docker-publish.yml Add mariadb container for build --- .github/workflows/docker-publish.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d8a487b2..e5012b48 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -24,7 +24,27 @@ jobs: runs-on: ubuntu-20.04 steps: + services: + mariadb: + image: mariadb:latest + ports: + - 3306 + env: + MYSQL_USER: root + MYSQL_PASSWORD: root + MYSQL_DATABASE: test + MYSQL_ROOT_PASSWORD: root + options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + - uses: actions/checkout@v2 + + - name: Verify MariaDB connection + env: + PORT: ${{ job.services.mariadb.ports[3306] }} + run: | + while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do + sleep 1 + done - name: Run tests run: | From f928196e85d8f09a6c1df748b4ee261d1ad83a3e Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 21:19:55 -0500 Subject: [PATCH 015/166] Update Dockerfile Use 127.0.0.1 instead of localhost (github action requires this) --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 66bac3d6..c9491241 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -111,7 +111,7 @@ ARG MYSQL_ADMIN_PASSWORD=root # Specific database credentials used by bluecherry server ARG BLUECHERRY_DB_USER=bluecherry -ARG BLUECHERRY_DB_HOST=localhost +ARG BLUECHERRY_DB_HOST=127.0.0.1 ARG BLUECHERRY_DB_PASSWORD=root ARG BLUECHERRY_DB_NAME=bluecherry ARG BLUECHERRY_DB_ACCESS_HOST=% From 842528e6c09f49c354f16b2e5410dbbc2dc2acaa Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 21:26:29 -0500 Subject: [PATCH 016/166] Update docker-publish.yml Fix incorrect placement of steps: --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e5012b48..8356a269 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -23,7 +23,6 @@ jobs: test: runs-on: ubuntu-20.04 - steps: services: mariadb: image: mariadb:latest @@ -35,7 +34,8 @@ jobs: MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: root options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 - + + steps: - uses: actions/checkout@v2 - name: Verify MariaDB connection From 7dbd0351397e0ccb19b1ef1580657b35071de50f Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 21:28:54 -0500 Subject: [PATCH 017/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 8356a269..5ec00cde 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -23,7 +23,7 @@ jobs: test: runs-on: ubuntu-20.04 - services: + services: mariadb: image: mariadb:latest ports: From 082cf89b0d9ec45688e08d5dcfb8d09bb9fdeb39 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 21:31:23 -0500 Subject: [PATCH 018/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 5ec00cde..4379f473 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -38,7 +38,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Verify MariaDB connection + - name: Verify MariaDB connection env: PORT: ${{ job.services.mariadb.ports[3306] }} run: | From c5d065ad2fdb56016614efea2702d9ea9c25cbc9 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 21:35:28 -0500 Subject: [PATCH 019/166] Update docker-publish.yml Don't create a duplicate root mysql user --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 4379f473..f9ec5c10 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -29,7 +29,7 @@ jobs: ports: - 3306 env: - MYSQL_USER: root + # MYSQL_USER: root MYSQL_PASSWORD: root MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: root From 62cf4f0fb85f984fe28deed764e6d22effb459db Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 21:45:42 -0500 Subject: [PATCH 020/166] Update docker-publish.yml Fix health check --- .github/workflows/docker-publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f9ec5c10..be28fb2a 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -26,6 +26,8 @@ jobs: services: mariadb: image: mariadb:latest + options: >- + --health-cmd "mysqladmin ping -h localhost ports: - 3306 env: @@ -33,7 +35,7 @@ jobs: MYSQL_PASSWORD: root MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: root - options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 +# options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 steps: - uses: actions/checkout@v2 From 600eea30c5467cf9d47b5aef00359a49c7980a80 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 21:49:31 -0500 Subject: [PATCH 021/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index be28fb2a..42d250f0 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -26,10 +26,11 @@ jobs: services: mariadb: image: mariadb:latest - options: >- - --health-cmd "mysqladmin ping -h localhost +# options: >- +# --health-cmd "mysqladmin ping -h localhost ports: - 3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 env: # MYSQL_USER: root MYSQL_PASSWORD: root From c76ae23e7700e8d9194d52f3f62b98c915b5da35 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 21:53:21 -0500 Subject: [PATCH 022/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 42d250f0..3f27c143 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -40,7 +40,9 @@ jobs: steps: - uses: actions/checkout@v2 - + - name: Verify MySQL connection from host + run: sudo apt-get install -y mysql-client + - name: Verify MariaDB connection env: PORT: ${{ job.services.mariadb.ports[3306] }} From 806f340bd4487ba24cd88e2da6d876340f44ca45 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 16 Jul 2023 21:56:43 -0500 Subject: [PATCH 023/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 3f27c143..91c694bd 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -30,7 +30,7 @@ jobs: # --health-cmd "mysqladmin ping -h localhost ports: - 3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 + # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 env: # MYSQL_USER: root MYSQL_PASSWORD: root From 52f87163930176e69dd7e014f845e7427cae1165 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Mon, 17 Jul 2023 19:52:48 -0500 Subject: [PATCH 024/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 91c694bd..61a80752 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -53,7 +53,7 @@ jobs: - name: Run tests run: | - sudo /etc/init.d/mysql start + # sudo /etc/init.d/mysql start if [ -f docker-compose.test.yml ]; then docker-compose --file docker-compose.test.yml build docker-compose --file docker-compose.test.yml run sut From f448c0dd788124600d0b1ac0041da17341c554b8 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Mon, 17 Jul 2023 19:54:49 -0500 Subject: [PATCH 025/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 61a80752..a4107820 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -53,7 +53,6 @@ jobs: - name: Run tests run: | - # sudo /etc/init.d/mysql start if [ -f docker-compose.test.yml ]; then docker-compose --file docker-compose.test.yml build docker-compose --file docker-compose.test.yml run sut From 6142a008754298941e7fbab351c9b4db3a0268b6 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Mon, 17 Jul 2023 20:08:15 -0500 Subject: [PATCH 026/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 31 ++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a4107820..7631591c 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -23,22 +23,35 @@ jobs: test: runs-on: ubuntu-20.04 - services: - mariadb: - image: mariadb:latest + # services: + # mariadb: + # image: mariadb:latest # options: >- # --health-cmd "mysqladmin ping -h localhost - ports: - - 3306 + # ports: + # - 3306 # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 - env: + # env: # MYSQL_USER: root - MYSQL_PASSWORD: root - MYSQL_DATABASE: test - MYSQL_ROOT_PASSWORD: root + # MYSQL_PASSWORD: root + # MYSQL_DATABASE: test + # MYSQL_ROOT_PASSWORD: root # options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + steps: + - uses: getong/mariadb-action@v1.1 + with: + # host port: 3800 # Optional, default value is 3306. The port of host + # container port: 3307 # Optional, default value is 3306. The port of container + character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld + collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld + mariadb version: '10.4.10' # Optional, default value is "latest". The version of the MariaDB + # mysql database: 'some_test' # Optional, default value is "test". The specified database which will be create + mysql root password: 'root' # Required if "mysql user" is empty, default is empty. The root superuser password + mysql user: 'root' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too + mysql password: 'root' # Required if "mysql user" exists. The password for the "mysql user" + - uses: actions/checkout@v2 - name: Verify MySQL connection from host run: sudo apt-get install -y mysql-client From b2a18f3573f212ee5cd5c4c9f4c84be476d5da4a Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Mon, 17 Jul 2023 20:10:20 -0500 Subject: [PATCH 027/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7631591c..8e714fb2 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -60,7 +60,7 @@ jobs: env: PORT: ${{ job.services.mariadb.ports[3306] }} run: | - while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do + while ! mysqladmin ping -h"127.0.0.1" -P"3306" --silent; do sleep 1 done From 2be2ad57b2c3873a7ad2519628650182fba90bd3 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Mon, 17 Jul 2023 20:21:42 -0500 Subject: [PATCH 028/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 8e714fb2..d66005bb 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -40,6 +40,10 @@ jobs: steps: + - uses: actions/checkout@v2 + - name: Verify MySQL connection from host + run: sudo apt-get install -y mysql-client + - uses: getong/mariadb-action@v1.1 with: # host port: 3800 # Optional, default value is 3306. The port of host From ca683235feb3f0cbdaece1496c60893ed433e7bd Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Mon, 17 Jul 2023 20:38:02 -0500 Subject: [PATCH 029/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d66005bb..a5f50fd1 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -42,12 +42,12 @@ jobs: steps: - uses: actions/checkout@v2 - name: Verify MySQL connection from host - run: sudo apt-get install -y mysql-client + run: sudo apt-get install -y mysql-client && mysql --version - uses: getong/mariadb-action@v1.1 with: - # host port: 3800 # Optional, default value is 3306. The port of host - # container port: 3307 # Optional, default value is 3306. The port of container + host port: 3306 # Optional, default value is 3306. The port of host + container port: 3306 # Optional, default value is 3306. The port of container character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld mariadb version: '10.4.10' # Optional, default value is "latest". The version of the MariaDB From 676e493560b32bad9007bb17d6fc144be43120ca Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 18 Jul 2023 09:59:56 -0500 Subject: [PATCH 030/166] Update docker-publish.yml Add mysqladmin ping to check connection problems.. --- .github/workflows/docker-publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a5f50fd1..35f236f3 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -42,8 +42,8 @@ jobs: steps: - uses: actions/checkout@v2 - name: Verify MySQL connection from host - run: sudo apt-get install -y mysql-client && mysql --version - + run: sudo apt-get install -y mysql-client && mysql --version + - uses: getong/mariadb-action@v1.1 with: host port: 3306 # Optional, default value is 3306. The port of host @@ -74,6 +74,7 @@ jobs: docker-compose --file docker-compose.test.yml build docker-compose --file docker-compose.test.yml run sut else + echo "testing MYSQL connection..."\n\n && mysqladmin ping -h"127.0.0.1" -P"3306" -u root -proot --silent; do docker build . --file server/Dockerfile fi From 1e13c533235c4a969c092181d0090e275d403f0f Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 18 Jul 2023 10:03:02 -0500 Subject: [PATCH 031/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 35f236f3..c0a09239 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -74,7 +74,7 @@ jobs: docker-compose --file docker-compose.test.yml build docker-compose --file docker-compose.test.yml run sut else - echo "testing MYSQL connection..."\n\n && mysqladmin ping -h"127.0.0.1" -P"3306" -u root -proot --silent; do + echo -e "testing MYSQL connection..."\n\n && mysqladmin ping -h"127.0.0.1" -P"3306" -u root -proot ; echo $? docker build . --file server/Dockerfile fi From da0186e0a72300d382fbfe9660f2920bc44bedc7 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 18 Jul 2023 10:08:04 -0500 Subject: [PATCH 032/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c0a09239..66af1869 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -58,7 +58,8 @@ jobs: - uses: actions/checkout@v2 - name: Verify MySQL connection from host - run: sudo apt-get install -y mysql-client + run: sudo apt-get install -y mysql-client && echo -e "Alert testing MYSQL connection..."\n\n && mysqladmin ping -h"127.0.0.1" -P"3306" -u root -proot + - name: Verify MariaDB connection env: From d1736583634700e4be65d72839ab73a64ee7f08a Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 18 Jul 2023 10:12:44 -0500 Subject: [PATCH 033/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 66af1869..e461bc94 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -40,25 +40,13 @@ jobs: steps: - - uses: actions/checkout@v2 + - uses: ankane/setup-mariadb@v1 - name: Verify MySQL connection from host run: sudo apt-get install -y mysql-client && mysql --version - - - uses: getong/mariadb-action@v1.1 - with: - host port: 3306 # Optional, default value is 3306. The port of host - container port: 3306 # Optional, default value is 3306. The port of container - character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld - collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld - mariadb version: '10.4.10' # Optional, default value is "latest". The version of the MariaDB - # mysql database: 'some_test' # Optional, default value is "test". The specified database which will be create - mysql root password: 'root' # Required if "mysql user" is empty, default is empty. The root superuser password - mysql user: 'root' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too - mysql password: 'root' # Required if "mysql user" exists. The password for the "mysql user" - + - uses: actions/checkout@v2 - name: Verify MySQL connection from host - run: sudo apt-get install -y mysql-client && echo -e "Alert testing MYSQL connection..."\n\n && mysqladmin ping -h"127.0.0.1" -P"3306" -u root -proot + run: sudo apt-get install -y mysql-client && echo -e "Alert testing MYSQL connection..."\n\n && mysqladmin ping -h"127.0.0.1" -P"3306" - name: Verify MariaDB connection From 3cfa08bd96cf841e7a02677487dc1b3cbabdeeee Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Tue, 18 Jul 2023 10:18:40 -0500 Subject: [PATCH 034/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e461bc94..c4cd6d24 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -40,13 +40,15 @@ jobs: steps: - - uses: ankane/setup-mariadb@v1 + - uses: ankane/setup-mysql@v1 + with: + mysql-version: 8.0 - name: Verify MySQL connection from host - run: sudo apt-get install -y mysql-client && mysql --version + run: sudo apt-get install -y mysql-client && mysql --version && echo -e "Alert testing MYSQL connection..."\n\n && mysqladmin ping -h"127.0.0.1" -P"3306" - uses: actions/checkout@v2 - name: Verify MySQL connection from host - run: sudo apt-get install -y mysql-client && echo -e "Alert testing MYSQL connection..."\n\n && mysqladmin ping -h"127.0.0.1" -P"3306" + run: sudo apt-get install -y mysql-client - name: Verify MariaDB connection From eafb61af8cb7af024631822489e662cf48db5c35 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 20:11:23 -0500 Subject: [PATCH 035/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c4cd6d24..6bab7290 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -42,9 +42,9 @@ jobs: steps: - uses: ankane/setup-mysql@v1 with: - mysql-version: 8.0 + mysql-version: 5.7 - name: Verify MySQL connection from host - run: sudo apt-get install -y mysql-client && mysql --version && echo -e "Alert testing MYSQL connection..."\n\n && mysqladmin ping -h"127.0.0.1" -P"3306" + run: sudo apt-get install -y mysql-client && mysql --version && echo -e "Alert testing MYSQL connection...\n\n" && mysqladmin ping -h"127.0.0.1" -P"3306" - uses: actions/checkout@v2 - name: Verify MySQL connection from host From b07df0b29d27aaf545f1757cf21091a3097779ef Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 20:15:11 -0500 Subject: [PATCH 036/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6bab7290..8b5d36e1 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -40,15 +40,15 @@ jobs: steps: - - uses: ankane/setup-mysql@v1 + - uses: actions/checkout@v3 + - uses: shogo82148/actions-setup-mysql@v1 with: - mysql-version: 5.7 - - name: Verify MySQL connection from host - run: sudo apt-get install -y mysql-client && mysql --version && echo -e "Alert testing MYSQL connection...\n\n" && mysqladmin ping -h"127.0.0.1" -P"3306" + mysql-version: "5.7" + - run: sudo apt-get install -y mysql-client && mysql --version && && mysql -uroot -e 'SELECT version()' && echo -e "Alert testing MYSQL connection...\n\n" && mysqladmin ping -h"127.0.0.1" -P"3306" - - uses: actions/checkout@v2 - - name: Verify MySQL connection from host - run: sudo apt-get install -y mysql-client +# - uses: actions/checkout@v2 +# - name: Verify MySQL connection from host +# run: sudo apt-get install -y mysql-client - name: Verify MariaDB connection From fda58abaa9a98ddf8a5577880b7932f2488a1ddc Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 20:16:36 -0500 Subject: [PATCH 037/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 8b5d36e1..575744b7 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -44,7 +44,7 @@ jobs: - uses: shogo82148/actions-setup-mysql@v1 with: mysql-version: "5.7" - - run: sudo apt-get install -y mysql-client && mysql --version && && mysql -uroot -e 'SELECT version()' && echo -e "Alert testing MYSQL connection...\n\n" && mysqladmin ping -h"127.0.0.1" -P"3306" + - run: sudo apt-get install -y mysql-client && mysql --version && mysql -uroot -e 'SELECT version()' && echo -e "Alert testing MYSQL connection...\n\n" && mysqladmin ping -h"127.0.0.1" -P"3306" # - uses: actions/checkout@v2 # - name: Verify MySQL connection from host From c07b4b615a382d2dbe66363fcc1d96ad553f0822 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 20:21:12 -0500 Subject: [PATCH 038/166] Update Dockerfile --- server/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index c9491241..85045c8f 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -107,12 +107,12 @@ RUN curl -k -o /tmp/bluecherry_3.1.0-rc8_amd64.deb https://unstable.bluecherrydv #COPY bluecherry.conf /etc/bluecherry.conf ARG MYSQL_ADMIN_LOGIN=root -ARG MYSQL_ADMIN_PASSWORD=root +ARG MYSQL_ADMIN_PASSWORD= # Specific database credentials used by bluecherry server ARG BLUECHERRY_DB_USER=bluecherry ARG BLUECHERRY_DB_HOST=127.0.0.1 -ARG BLUECHERRY_DB_PASSWORD=root +ARG BLUECHERRY_DB_PASSWORD=qiNdklOierSZs2 ARG BLUECHERRY_DB_NAME=bluecherry ARG BLUECHERRY_DB_ACCESS_HOST=% From a5e39c329706309b9bbb29709d60ce275cdc487c Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 20:25:55 -0500 Subject: [PATCH 039/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 575744b7..f5184185 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -44,7 +44,8 @@ jobs: - uses: shogo82148/actions-setup-mysql@v1 with: mysql-version: "5.7" - - run: sudo apt-get install -y mysql-client && mysql --version && mysql -uroot -e 'SELECT version()' && echo -e "Alert testing MYSQL connection...\n\n" && mysqladmin ping -h"127.0.0.1" -P"3306" + root-password: "root" + - run: sudo apt-get install -y mysql-client && mysql --version && mysql -uroot -proot -e 'SELECT version()' && echo -e "Alert testing MYSQL connection...\n\n" && mysqladmin ping -h"127.0.0.1" -P"3306" # - uses: actions/checkout@v2 # - name: Verify MySQL connection from host @@ -55,7 +56,7 @@ jobs: env: PORT: ${{ job.services.mariadb.ports[3306] }} run: | - while ! mysqladmin ping -h"127.0.0.1" -P"3306" --silent; do + while ! mysqladmin ping -uroot -proot -h"127.0.0.1" -P"3306" --silent; do sleep 1 done From f8eba18ddaeb12073ad1b00eec25660ab2400dd2 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 20:27:18 -0500 Subject: [PATCH 040/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 85045c8f..875cc6ea 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -107,7 +107,7 @@ RUN curl -k -o /tmp/bluecherry_3.1.0-rc8_amd64.deb https://unstable.bluecherrydv #COPY bluecherry.conf /etc/bluecherry.conf ARG MYSQL_ADMIN_LOGIN=root -ARG MYSQL_ADMIN_PASSWORD= +ARG MYSQL_ADMIN_PASSWORD=root # Specific database credentials used by bluecherry server ARG BLUECHERRY_DB_USER=bluecherry From 8b6954815f8e1f6f3255e613c79cc5fc4d4ccd87 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 20:35:32 -0500 Subject: [PATCH 041/166] Update Dockerfile --- server/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 875cc6ea..662d92ba 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -22,7 +22,11 @@ RUN apt-get update # libbsd-dev libopencv-dev libudev-dev libva-dev \ # linux-image-generic linux-headers-generic \ # libmysqlclient-dev rsyslog - + +CMD ["echo", "Testing mysql connection..."] + +RUN mysql -uroot -proot -e 'SELECT version()' + # --------------------------------------------------------------------------- FROM os_dev_environment as bluecherry_base_environment From 0fe279be44b30da215a748161343e7ba48da7c6a Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 20:37:02 -0500 Subject: [PATCH 042/166] Update Dockerfile --- server/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/server/Dockerfile b/server/Dockerfile index 662d92ba..102841f6 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -25,6 +25,7 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] +RUN apt install -y mysql-client RUN mysql -uroot -proot -e 'SELECT version()' From 210fb7020ff4c9b7caf42775e3624d797960f014 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 20:38:58 -0500 Subject: [PATCH 043/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 102841f6..c35a539c 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,5 +1,5 @@ # set a base image with environment to build from -FROM ubuntu:20.04 AS baseos +#FROM ubuntu:20.04 AS baseos ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-rc8 From df5607f5ce0da939727306cbdb7e058f8bf1fc9c Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 20:41:29 -0500 Subject: [PATCH 044/166] Update Dockerfile --- server/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index c35a539c..47f9fd3d 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,5 +1,5 @@ # set a base image with environment to build from -#FROM ubuntu:20.04 AS baseos +FROM ubuntu:20.04 AS baseos ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-rc8 @@ -26,7 +26,7 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN mysql -uroot -proot -e 'SELECT version()' +RUN mysql -uroot -proot -h127.0.0.1 -P3306 -e 'SELECT version()' # --------------------------------------------------------------------------- From d2566d40d25c5b22124d86d3baef3aa7a8eb53ef Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 21:25:14 -0500 Subject: [PATCH 045/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 59 +++++++++++++++++----------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f5184185..bcf73bbb 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -22,30 +22,45 @@ jobs: # See also https://docs.docker.com/docker-hub/builds/automated-testing/ test: runs-on: ubuntu-20.04 - - # services: - # mariadb: - # image: mariadb:latest -# options: >- -# --health-cmd "mysqladmin ping -h localhost - # ports: - # - 3306 - # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 - # env: - # MYSQL_USER: root - # MYSQL_PASSWORD: root - # MYSQL_DATABASE: test - # MYSQL_ROOT_PASSWORD: root + services: + mariadb: + image: mariadb:latest + options: >- + --health-cmd "mysqladmin ping -h localhost + ports: + - 3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 + env: + MYSQL_USER: test + MYSQL_PASSWORD: root + MYSQL_DATABASE: test + MYSQL_ROOT_PASSWORD: root # options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 - - steps: - - uses: actions/checkout@v3 - - uses: shogo82148/actions-setup-mysql@v1 - with: - mysql-version: "5.7" - root-password: "root" - - run: sudo apt-get install -y mysql-client && mysql --version && mysql -uroot -proot -e 'SELECT version()' && echo -e "Alert testing MYSQL connection...\n\n" && mysqladmin ping -h"127.0.0.1" -P"3306" + steps: + - name: Get MySQL service ID + id: mysql-service + run: echo "::set-output name=container-id::$(docker ps | grep -i mysql | awk '{print $1}')" + - name: Get Github network gateway address + id: github-network + run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" + - name: Check out Site Repository 📄 + uses: actions/checkout@v2 + - name: Create .env file + run: cp .env.example .env + - name: Replace environment variables + run: | + sed -i 's/MYSQL_HOST.*/MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env + sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env +# env: MYSQL_HOST: + +# steps: +# - uses: actions/checkout@v3 +# - uses: shogo82148/actions-setup-mysql@v1 +# with: +# mysql-version: "5.7" +# root-password: "root" +# - run: sudo apt-get install -y mysql-client && mysql --version && mysql -uroot -proot -e 'SELECT version()' && echo -e "Alert testing MYSQL connection...\n\n" && mysqladmin ping -h"127.0.0.1" -P"3306" # - uses: actions/checkout@v2 # - name: Verify MySQL connection from host From 7e422f15d27ad33efe29a35874123ec18645ae05 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 21:28:57 -0500 Subject: [PATCH 046/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index bcf73bbb..5baa743b 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -22,14 +22,14 @@ jobs: # See also https://docs.docker.com/docker-hub/builds/automated-testing/ test: runs-on: ubuntu-20.04 - services: - mariadb: - image: mariadb:latest - options: >- + services: + mariadb: + image: mariadb:latest + options: >- --health-cmd "mysqladmin ping -h localhost - ports: + ports: - 3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 env: MYSQL_USER: test MYSQL_PASSWORD: root From 32809916f49ef0a7dafe646b2476a78cb39e5d43 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 21:30:10 -0500 Subject: [PATCH 047/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 5baa743b..83156974 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -30,7 +30,7 @@ jobs: ports: - 3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 - env: + env: MYSQL_USER: test MYSQL_PASSWORD: root MYSQL_DATABASE: test From c6e97f54ff7c105bb12c01946e8a0ee5badde358 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 21:39:45 -0500 Subject: [PATCH 048/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 54 ++++++++-------------------- 1 file changed, 15 insertions(+), 39 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 83156974..61a80752 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -22,66 +22,42 @@ jobs: # See also https://docs.docker.com/docker-hub/builds/automated-testing/ test: runs-on: ubuntu-20.04 + services: - mariadb: - image: mariadb:latest - options: >- - --health-cmd "mysqladmin ping -h localhost - ports: + mariadb: + image: mariadb:latest +# options: >- +# --health-cmd "mysqladmin ping -h localhost + ports: - 3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 - env: - MYSQL_USER: test + # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 + env: + # MYSQL_USER: root MYSQL_PASSWORD: root MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: root # options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 - steps: - - name: Get MySQL service ID - id: mysql-service - run: echo "::set-output name=container-id::$(docker ps | grep -i mysql | awk '{print $1}')" - - name: Get Github network gateway address - id: github-network - run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" - - name: Check out Site Repository 📄 - uses: actions/checkout@v2 - - name: Create .env file - run: cp .env.example .env - - name: Replace environment variables - run: | - sed -i 's/MYSQL_HOST.*/MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env - sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env -# env: MYSQL_HOST: - -# steps: -# - uses: actions/checkout@v3 -# - uses: shogo82148/actions-setup-mysql@v1 -# with: -# mysql-version: "5.7" -# root-password: "root" -# - run: sudo apt-get install -y mysql-client && mysql --version && mysql -uroot -proot -e 'SELECT version()' && echo -e "Alert testing MYSQL connection...\n\n" && mysqladmin ping -h"127.0.0.1" -P"3306" - -# - uses: actions/checkout@v2 -# - name: Verify MySQL connection from host -# run: sudo apt-get install -y mysql-client - + steps: + - uses: actions/checkout@v2 + - name: Verify MySQL connection from host + run: sudo apt-get install -y mysql-client - name: Verify MariaDB connection env: PORT: ${{ job.services.mariadb.ports[3306] }} run: | - while ! mysqladmin ping -uroot -proot -h"127.0.0.1" -P"3306" --silent; do + while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do sleep 1 done - name: Run tests run: | + # sudo /etc/init.d/mysql start if [ -f docker-compose.test.yml ]; then docker-compose --file docker-compose.test.yml build docker-compose --file docker-compose.test.yml run sut else - echo -e "testing MYSQL connection..."\n\n && mysqladmin ping -h"127.0.0.1" -P"3306" -u root -proot ; echo $? docker build . --file server/Dockerfile fi From 69e21c854132af82684b90babe3443d26673dce2 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 21:41:10 -0500 Subject: [PATCH 049/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 61a80752..8a4c3455 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -53,7 +53,7 @@ jobs: - name: Run tests run: | - # sudo /etc/init.d/mysql start + sudo /etc/init.d/mysql status if [ -f docker-compose.test.yml ]; then docker-compose --file docker-compose.test.yml build docker-compose --file docker-compose.test.yml run sut From 2bde0d81c5c51d6a75045bca8343da18dc264a06 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 21:49:39 -0500 Subject: [PATCH 050/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 8a4c3455..187ac5ab 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -53,8 +53,8 @@ jobs: - name: Run tests run: | - sudo /etc/init.d/mysql status - if [ -f docker-compose.test.yml ]; then + echo "test" + if [ -f docker-compose.test.yml ]; then docker-compose --file docker-compose.test.yml build docker-compose --file docker-compose.test.yml run sut else From 46919f65aa3d416eb007b54e8cd039581c8bd11b Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 21:51:40 -0500 Subject: [PATCH 051/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 47f9fd3d..82b2bd5e 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -26,7 +26,7 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN mysql -uroot -proot -h127.0.0.1 -P3306 -e 'SELECT version()' +RUN mysql -uroot -proot -hmariadb -P3306 -e 'SELECT version()' # --------------------------------------------------------------------------- From 2e41e4125e178b505ae0bca7ce39a1769693d3d3 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 22:04:53 -0500 Subject: [PATCH 052/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 187ac5ab..dcee1a8a 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -24,12 +24,12 @@ jobs: runs-on: ubuntu-20.04 services: - mariadb: - image: mariadb:latest + mysq: + image: mysql:5.7 # options: >- # --health-cmd "mysqladmin ping -h localhost ports: - - 3306 + - 3306:3306 # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 env: # MYSQL_USER: root From be26164c044121fb1336e5f14620983f28f714d2 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 22:05:37 -0500 Subject: [PATCH 053/166] Update Dockerfile --- server/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index 82b2bd5e..fdab3a89 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -26,7 +26,7 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN mysql -uroot -proot -hmariadb -P3306 -e 'SELECT version()' +RUN mysql -uroot -proot -hmysql -P3306 -e 'SELECT version()' # --------------------------------------------------------------------------- @@ -116,7 +116,7 @@ ARG MYSQL_ADMIN_PASSWORD=root # Specific database credentials used by bluecherry server ARG BLUECHERRY_DB_USER=bluecherry -ARG BLUECHERRY_DB_HOST=127.0.0.1 +ARG BLUECHERRY_DB_HOST=mysql ARG BLUECHERRY_DB_PASSWORD=qiNdklOierSZs2 ARG BLUECHERRY_DB_NAME=bluecherry ARG BLUECHERRY_DB_ACCESS_HOST=% From 4d022c3995ccb68140184167c86c38d28c2db3da Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 22:07:41 -0500 Subject: [PATCH 054/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index dcee1a8a..8230c106 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-20.04 services: - mysq: + mysql: image: mysql:5.7 # options: >- # --health-cmd "mysqladmin ping -h localhost @@ -36,7 +36,7 @@ jobs: MYSQL_PASSWORD: root MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: root -# options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 steps: - uses: actions/checkout@v2 From 3091c4543b0a435dce53a589e84276d96d799322 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 22:15:34 -0500 Subject: [PATCH 055/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 35 +++++++++++++++++++--------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 8230c106..d9303b49 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -39,22 +39,35 @@ jobs: options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 steps: - - uses: actions/checkout@v2 - - name: Verify MySQL connection from host - run: sudo apt-get install -y mysql-client - - - name: Verify MariaDB connection - env: + - name: Get MySQL service ID + id: mysql-service + run: echo "::set-output name=container-id::$(docker ps | grep -i mysql | awk '{print $1}')" + - name: Get Github network gateway address + id: github-network + run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" + - name: Check out Site Repository 📄 + - uses: actions/checkout@v2 + - name: Create .env file + run: cp .env.example .env + - name: Replace environment variables + run: | + sed -i 's/MYSQL_HOST.*/MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env + sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env + - name: Verify MySQL connection from host + run: sudo apt-get install -y mysql-client + + - name: Verify MariaDB connection + env: PORT: ${{ job.services.mariadb.ports[3306] }} - run: | + run: | while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do sleep 1 done - - name: Run tests - run: | - echo "test" - if [ -f docker-compose.test.yml ]; then + - name: Run tests + run: | + echo "test" + if [ -f docker-compose.test.yml ]; then docker-compose --file docker-compose.test.yml build docker-compose --file docker-compose.test.yml run sut else From 8d7af1db5a5e0b25ab30134efde07cd96dd4a829 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 22:16:37 -0500 Subject: [PATCH 056/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d9303b49..31544a13 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -46,7 +46,7 @@ jobs: id: github-network run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" - name: Check out Site Repository 📄 - - uses: actions/checkout@v2 + uses: actions/checkout@v2 - name: Create .env file run: cp .env.example .env - name: Replace environment variables From ebafc28b18a44ccd5ef3ab60075e71da9de7317d Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 22:21:56 -0500 Subject: [PATCH 057/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 31544a13..c80a1d1e 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -50,9 +50,9 @@ jobs: - name: Create .env file run: cp .env.example .env - name: Replace environment variables - run: | - sed -i 's/MYSQL_HOST.*/MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env - sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env + run: echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env +# sed -i 's/MYSQL_HOST.*/MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env +# sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env - name: Verify MySQL connection from host run: sudo apt-get install -y mysql-client From e9076e672c3029f6f7148fb545f11b9fac435ab5 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 22:23:02 -0500 Subject: [PATCH 058/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c80a1d1e..db2400f8 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -47,8 +47,8 @@ jobs: run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" - name: Check out Site Repository 📄 uses: actions/checkout@v2 - - name: Create .env file - run: cp .env.example .env + # - name: Create .env file + # run: cp .env.example .env - name: Replace environment variables run: echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env # sed -i 's/MYSQL_HOST.*/MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env From 3a11ead2c1552181371fa67cd4fefe6359a12ed7 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Wed, 19 Jul 2023 22:26:07 -0500 Subject: [PATCH 059/166] Update Dockerfile --- server/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/server/Dockerfile b/server/Dockerfile index fdab3a89..279a2792 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -3,6 +3,7 @@ FROM ubuntu:20.04 AS baseos ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-rc8 +RUN echo $MYSQL_HOST # --------------------------------------------------------------------------- # Build the base OS with some development libs and tools From 1f3030e9e8418901a6d5e55ca1022213f4a73794 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 19:08:35 -0500 Subject: [PATCH 060/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index db2400f8..0f82e830 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -59,6 +59,7 @@ jobs: - name: Verify MariaDB connection env: PORT: ${{ job.services.mariadb.ports[3306] }} + MYSQLHOST: ${{ steps.github-network.outputs.gateway-address }} run: | while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do sleep 1 From 54507d7ee6c6a3e1dff60b6814606453c77487bf Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 19:10:09 -0500 Subject: [PATCH 061/166] Update Dockerfile --- server/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 279a2792..c5b9f722 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -2,6 +2,8 @@ FROM ubuntu:20.04 AS baseos ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-rc8 +ARG MYSQLHOST +ENV MYSQL_HOST=MYSQLHOST RUN echo $MYSQL_HOST @@ -117,7 +119,7 @@ ARG MYSQL_ADMIN_PASSWORD=root # Specific database credentials used by bluecherry server ARG BLUECHERRY_DB_USER=bluecherry -ARG BLUECHERRY_DB_HOST=mysql +ARG BLUECHERRY_DB_HOST=$MYSQL_HOST ARG BLUECHERRY_DB_PASSWORD=qiNdklOierSZs2 ARG BLUECHERRY_DB_NAME=bluecherry ARG BLUECHERRY_DB_ACCESS_HOST=% From 1b6de52c0d065fa06633a98cdd7d5719ff2fc5fc Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 19:12:37 -0500 Subject: [PATCH 062/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 0f82e830..e7f5eed0 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -69,7 +69,7 @@ jobs: run: | echo "test" if [ -f docker-compose.test.yml ]; then - docker-compose --file docker-compose.test.yml build + docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST docker-compose --file docker-compose.test.yml run sut else docker build . --file server/Dockerfile From 5e33d30378a6d89f512edeeb92c4075c464db38e Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 19:16:19 -0500 Subject: [PATCH 063/166] Update Dockerfile --- server/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/Dockerfile b/server/Dockerfile index c5b9f722..980a8ea9 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -5,6 +5,8 @@ ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-rc8 ARG MYSQLHOST ENV MYSQL_HOST=MYSQLHOST +RUN echo "Testing github network env" +RUN echo ${{ steps.github-network.outputs.gateway-address }} RUN echo $MYSQL_HOST # --------------------------------------------------------------------------- From b546359d43417b24079c192126fd09b48ae58850 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 21:29:06 -0500 Subject: [PATCH 064/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e7f5eed0..a9e52575 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -46,22 +46,23 @@ jobs: id: github-network run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" - name: Check out Site Repository 📄 - uses: actions/checkout@v2 + uses: actions/checkout@v3 # - name: Create .env file # run: cp .env.example .env - - name: Replace environment variables - run: echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env +# - name: Replace environment variables +# run: echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env # sed -i 's/MYSQL_HOST.*/MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env - name: Verify MySQL connection from host - run: sudo apt-get install -y mysql-client - + run: | + sudo apt-get install -y mysql-client + sudo mysqladmin ping - name: Verify MariaDB connection env: PORT: ${{ job.services.mariadb.ports[3306] }} MYSQLHOST: ${{ steps.github-network.outputs.gateway-address }} run: | - while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do + while ! mysqladmin ping --silent; do sleep 1 done From 9ce11d1cd9e17cb4dab0359b9bb44414441fc61b Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 21:31:12 -0500 Subject: [PATCH 065/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a9e52575..d3461c95 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -56,7 +56,7 @@ jobs: - name: Verify MySQL connection from host run: | sudo apt-get install -y mysql-client - sudo mysqladmin ping + sudo mysqladmin ping -h 127.0.0.1 - name: Verify MariaDB connection env: PORT: ${{ job.services.mariadb.ports[3306] }} From 93e11843194102c3b94e99d711e9f5a493c24ba9 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 21:39:57 -0500 Subject: [PATCH 066/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d3461c95..e905c115 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-20.04 services: - mysql: + db: image: mysql:5.7 # options: >- # --health-cmd "mysqladmin ping -h localhost @@ -56,7 +56,7 @@ jobs: - name: Verify MySQL connection from host run: | sudo apt-get install -y mysql-client - sudo mysqladmin ping -h 127.0.0.1 + sudo mysqladmin ping -h db - name: Verify MariaDB connection env: PORT: ${{ job.services.mariadb.ports[3306] }} From 444694a18dc67cb7d57a0a1289da72a3aa4da41f Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 21:53:07 -0500 Subject: [PATCH 067/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 41 +++++++++++++++------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e905c115..92d76dfc 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -23,22 +23,25 @@ jobs: test: runs-on: ubuntu-20.04 - services: - db: - image: mysql:5.7 + # services: + # db: + # image: mysql:5.7 # options: >- # --health-cmd "mysqladmin ping -h localhost - ports: - - 3306:3306 + # ports: + # - 3306:3306 # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 - env: + # env: # MYSQL_USER: root - MYSQL_PASSWORD: root - MYSQL_DATABASE: test - MYSQL_ROOT_PASSWORD: root - options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + # MYSQL_PASSWORD: root + # MYSQL_DATABASE: test + # MYSQL_ROOT_PASSWORD: root + # options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 steps: + - name: Enable mysql + id: mysql-enable + run: sudo /etc/init.d/mysql start - name: Get MySQL service ID id: mysql-service run: echo "::set-output name=container-id::$(docker ps | grep -i mysql | awk '{print $1}')" @@ -56,15 +59,15 @@ jobs: - name: Verify MySQL connection from host run: | sudo apt-get install -y mysql-client - sudo mysqladmin ping -h db - - name: Verify MariaDB connection - env: - PORT: ${{ job.services.mariadb.ports[3306] }} - MYSQLHOST: ${{ steps.github-network.outputs.gateway-address }} - run: | - while ! mysqladmin ping --silent; do - sleep 1 - done + sudo mysqladmin ping -uroot -proot -h 127.0.0.1 + # - name: Verify MariaDB connection + # env: + # PORT: ${{ job.services.mariadb.ports[3306] }} + # MYSQLHOST: ${{ steps.github-network.outputs.gateway-address }} + # run: | + # while ! mysqladmin ping --silent; do + # sleep 1 + # done - name: Run tests run: | From 0a26a58f162941db2014a61ceefc676612aeb0f2 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 21:54:18 -0500 Subject: [PATCH 068/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 92d76dfc..924ee1d7 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -42,12 +42,12 @@ jobs: - name: Enable mysql id: mysql-enable run: sudo /etc/init.d/mysql start - - name: Get MySQL service ID - id: mysql-service - run: echo "::set-output name=container-id::$(docker ps | grep -i mysql | awk '{print $1}')" - - name: Get Github network gateway address - id: github-network - run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" +# - name: Get MySQL service ID +# id: mysql-service +# run: echo "::set-output name=container-id::$(docker ps | grep -i mysql | awk '{print $1}')" + # - name: Get Github network gateway address + # id: github-network + # run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" - name: Check out Site Repository 📄 uses: actions/checkout@v3 # - name: Create .env file From f16d757a263b26046bc6da0d055dc0bb56f266aa Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 21:56:46 -0500 Subject: [PATCH 069/166] Update Dockerfile --- server/Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index 980a8ea9..d12ffb75 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -2,12 +2,12 @@ FROM ubuntu:20.04 AS baseos ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-rc8 -ARG MYSQLHOST -ENV MYSQL_HOST=MYSQLHOST +#ARG MYSQLHOST +#ENV MYSQL_HOST=MYSQLHOST -RUN echo "Testing github network env" -RUN echo ${{ steps.github-network.outputs.gateway-address }} -RUN echo $MYSQL_HOST +#RUN echo "Testing github network env" +#RUN echo ${{ steps.github-network.outputs.gateway-address }} +#RUN echo $MYSQL_HOST # --------------------------------------------------------------------------- # Build the base OS with some development libs and tools @@ -31,7 +31,7 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN mysql -uroot -proot -hmysql -P3306 -e 'SELECT version()' +RUN mysql -uroot -proot -h127.0.0.1 -P3306 -e 'SELECT version()' # --------------------------------------------------------------------------- @@ -121,7 +121,7 @@ ARG MYSQL_ADMIN_PASSWORD=root # Specific database credentials used by bluecherry server ARG BLUECHERRY_DB_USER=bluecherry -ARG BLUECHERRY_DB_HOST=$MYSQL_HOST +ARG BLUECHERRY_DB_HOST=127.0.01 ARG BLUECHERRY_DB_PASSWORD=qiNdklOierSZs2 ARG BLUECHERRY_DB_NAME=bluecherry ARG BLUECHERRY_DB_ACCESS_HOST=% From 00a9b0fa0f262cfb0354441fe54103fc7cad8f78 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 22:06:07 -0500 Subject: [PATCH 070/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 924ee1d7..89214f53 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -38,10 +38,26 @@ jobs: # MYSQL_ROOT_PASSWORD: root # options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 +services: + mysql: + image: mysql:5.7 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: github_db + ports: + - 3306 + options: + --health-cmd="mysqladmin ping" + --health-interval=10s + --health-timeout=5s + --health-retries=3 + --name=db + steps: - - name: Enable mysql - id: mysql-enable - run: sudo /etc/init.d/mysql start +# - name: Enable mysql +# id: mysql-enable +# run: sudo /etc/init.d/mysql start # - name: Get MySQL service ID # id: mysql-service # run: echo "::set-output name=container-id::$(docker ps | grep -i mysql | awk '{print $1}')" @@ -59,7 +75,7 @@ jobs: - name: Verify MySQL connection from host run: | sudo apt-get install -y mysql-client - sudo mysqladmin ping -uroot -proot -h 127.0.0.1 + sudo mysqladmin ping -uroot -proot -h db # - name: Verify MariaDB connection # env: # PORT: ${{ job.services.mariadb.ports[3306] }} From 979bb1012355e76da394750abe9efaaeb8bae439 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 22:08:22 -0500 Subject: [PATCH 071/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 89214f53..1cffc0af 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -39,7 +39,7 @@ jobs: # options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 services: - mysql: + db: image: mysql:5.7 env: MYSQL_ALLOW_EMPTY_PASSWORD: yes From 0e5f73ff7fe73ee72186cc25a2de8a0beb89f32d Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 22:09:59 -0500 Subject: [PATCH 072/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 36 ++++++++-------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 1cffc0af..2409e2fd 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -23,36 +23,20 @@ jobs: test: runs-on: ubuntu-20.04 - # services: - # db: - # image: mysql:5.7 -# options: >- -# --health-cmd "mysqladmin ping -h localhost - # ports: - # - 3306:3306 - # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 - # env: - # MYSQL_USER: root - # MYSQL_PASSWORD: root - # MYSQL_DATABASE: test - # MYSQL_ROOT_PASSWORD: root - # options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 - -services: + services: db: image: mysql:5.7 + options: >- + --health-cmd "mysqladmin ping -h localhost + ports: + - 3306:3306 + # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_USER: root + MYSQL_PASSWORD: root + MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: github_db - ports: - - 3306 - options: - --health-cmd="mysqladmin ping" - --health-interval=10s - --health-timeout=5s - --health-retries=3 - --name=db + options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 steps: # - name: Enable mysql From d81a6f8700703df27b99c56afcadfd72c3c1c642 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 22:13:42 -0500 Subject: [PATCH 073/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 2409e2fd..21d35862 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -36,7 +36,7 @@ jobs: MYSQL_PASSWORD: root MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: root - options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + # options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 steps: # - name: Enable mysql @@ -60,10 +60,10 @@ jobs: run: | sudo apt-get install -y mysql-client sudo mysqladmin ping -uroot -proot -h db - # - name: Verify MariaDB connection - # env: - # PORT: ${{ job.services.mariadb.ports[3306] }} - # MYSQLHOST: ${{ steps.github-network.outputs.gateway-address }} + - name: Verify MariaDB connection + env: + PORT: ${{ job.services.mariadb.ports[3306] }} + MYSQLHOST: ${{ steps.github-network.outputs.gateway-address }} # run: | # while ! mysqladmin ping --silent; do # sleep 1 @@ -76,7 +76,7 @@ jobs: docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST docker-compose --file docker-compose.test.yml run sut else - docker build . --file server/Dockerfile + docker build . --file server/Dockerfile --build-arg MYSQLHOST=$MYSQLHOST fi # Push image to GitHub Packages. From 32deaf7fd3679b354b57e985cdfec248b618e335 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 22:14:39 -0500 Subject: [PATCH 074/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 21d35862..32d016cc 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -64,10 +64,10 @@ jobs: env: PORT: ${{ job.services.mariadb.ports[3306] }} MYSQLHOST: ${{ steps.github-network.outputs.gateway-address }} - # run: | - # while ! mysqladmin ping --silent; do - # sleep 1 - # done + run: | + while ! mysqladmin ping --silent; do + sleep 1 + done - name: Run tests run: | From a180b028d67a292e498acf94bdd738f9f820afd8 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 22:16:09 -0500 Subject: [PATCH 075/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 32d016cc..0cf279c6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -27,7 +27,7 @@ jobs: db: image: mysql:5.7 options: >- - --health-cmd "mysqladmin ping -h localhost + # --health-cmd "mysqladmin ping -h localhost ports: - 3306:3306 # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 From c3a0c1cdb58ef29bfbc260831e816436420bd782 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 22:16:38 -0500 Subject: [PATCH 076/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 0cf279c6..9f75c9c2 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -26,7 +26,7 @@ jobs: services: db: image: mysql:5.7 - options: >- +# options: >- # --health-cmd "mysqladmin ping -h localhost ports: - 3306:3306 From 1bfa24ef0c4293c6cc0fb9599af93a6ce7b29e9c Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 22:18:16 -0500 Subject: [PATCH 077/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 9f75c9c2..29fc9a67 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -32,7 +32,7 @@ jobs: - 3306:3306 # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 env: - MYSQL_USER: root +# MYSQL_USER: root MYSQL_PASSWORD: root MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: root From 1b35f583108a312c30c7d32f60218fd8c6f11919 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 22:19:30 -0500 Subject: [PATCH 078/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 29fc9a67..6e70f667 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -56,10 +56,10 @@ jobs: # run: echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env # sed -i 's/MYSQL_HOST.*/MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env - - name: Verify MySQL connection from host - run: | - sudo apt-get install -y mysql-client - sudo mysqladmin ping -uroot -proot -h db + # - name: Verify MySQL connection from host + # run: | + # sudo apt-get install -y mysql-client + # sudo mysqladmin ping -uroot -proot -h db - name: Verify MariaDB connection env: PORT: ${{ job.services.mariadb.ports[3306] }} From ea23c40e8e79f1f308ea05acd254f08db03f0672 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 22:20:48 -0500 Subject: [PATCH 079/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6e70f667..b5a72317 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -60,14 +60,14 @@ jobs: # run: | # sudo apt-get install -y mysql-client # sudo mysqladmin ping -uroot -proot -h db - - name: Verify MariaDB connection - env: - PORT: ${{ job.services.mariadb.ports[3306] }} - MYSQLHOST: ${{ steps.github-network.outputs.gateway-address }} - run: | - while ! mysqladmin ping --silent; do - sleep 1 - done + # - name: Verify MariaDB connection + # env: + # PORT: ${{ job.services.mariadb.ports[3306] }} + # MYSQLHOST: ${{ steps.github-network.outputs.gateway-address }} + # run: | + # while ! mysqladmin ping --silent; do + # sleep 1 + # done - name: Run tests run: | From c8ecc21259f8fd90b353424b8de798b8c6049fa7 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 22:22:32 -0500 Subject: [PATCH 080/166] Update Dockerfile --- server/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index d12ffb75..8efaa036 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -2,12 +2,12 @@ FROM ubuntu:20.04 AS baseos ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-rc8 -#ARG MYSQLHOST -#ENV MYSQL_HOST=MYSQLHOST +ARG MYSQLHOST +ENV MYSQL_HOST=MYSQLHOST #RUN echo "Testing github network env" #RUN echo ${{ steps.github-network.outputs.gateway-address }} -#RUN echo $MYSQL_HOST +RUN echo $MYSQL_HOST # --------------------------------------------------------------------------- # Build the base OS with some development libs and tools @@ -121,7 +121,7 @@ ARG MYSQL_ADMIN_PASSWORD=root # Specific database credentials used by bluecherry server ARG BLUECHERRY_DB_USER=bluecherry -ARG BLUECHERRY_DB_HOST=127.0.01 +ARG BLUECHERRY_DB_HOST=127.0.0.1 ARG BLUECHERRY_DB_PASSWORD=qiNdklOierSZs2 ARG BLUECHERRY_DB_NAME=bluecherry ARG BLUECHERRY_DB_ACCESS_HOST=% From 42a9b21bd4b67317a3db2f4b9a29fc192addb6a3 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 22:23:56 -0500 Subject: [PATCH 081/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 8efaa036..2f52890a 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -121,7 +121,7 @@ ARG MYSQL_ADMIN_PASSWORD=root # Specific database credentials used by bluecherry server ARG BLUECHERRY_DB_USER=bluecherry -ARG BLUECHERRY_DB_HOST=127.0.0.1 +ARG BLUECHERRY_DB_HOST=db ARG BLUECHERRY_DB_PASSWORD=qiNdklOierSZs2 ARG BLUECHERRY_DB_NAME=bluecherry ARG BLUECHERRY_DB_ACCESS_HOST=% From f2a1addd6d6647b8eedf7809a3d410b1505aace3 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Thu, 20 Jul 2023 22:25:28 -0500 Subject: [PATCH 082/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 2f52890a..9696c3e2 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -31,7 +31,7 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN mysql -uroot -proot -h127.0.0.1 -P3306 -e 'SELECT version()' +RUN mysql -uroot -proot -hdb -P3306 -e 'SELECT version()' # --------------------------------------------------------------------------- From 773c99514b26ce391abe3d41a2700e8253c95f72 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 20:37:52 -0500 Subject: [PATCH 083/166] Create docker-compose.yml --- server/docker-compose.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 server/docker-compose.yml diff --git a/server/docker-compose.yml b/server/docker-compose.yml new file mode 100644 index 00000000..58efb05c --- /dev/null +++ b/server/docker-compose.yml @@ -0,0 +1,36 @@ +version: '3.7' +services: + bc-mysql: + image: mysql:latest + container_name: bc-mysql + command: --default-authentication-plugin=mysql_native_password + restart: always + networks: + - bluecherry_net + volumes: + - ./database:/var/lib/mysql + - "/etc/timezone:/etc/timezone:ro" + - "/etc/localtime:/etc/localtime:ro" + environment: + MYSQL_ROOT_PASSWORD: root + TZ: $TZ + + services: + bc-server: + build: + context: ./server/ + network: bluecherry_net + args: + # MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD + # MYSQL_ADMIN_LOGIN: $MYSQL_ADMIN_LOGIN + # BLUECHERRY_DB_USER: $BLUECHERRY_DB_USER + # BLUECHERRY_DB_PASSWORD: $BLUECHERRY_DB_PASSWORD + # BLUECHERRY_DB_NAME: $BLUECHERRY_DB_NAME + # BLUECHERRY_DB_HOST: $BLUECHERRY_DB_HOST + # BLUECHERRY_DB_ACCESS_HOST: $BLUECHERRY_DB_ACCESS_HOST + # BLUECHERRY_LINUX_GROUP_ID: $BLUECHERRY_LINUX_GROUP_ID + # BLUECHERRY_LINUX_USER_ID: $BLUECHERRY_LINUX_USER_ID + + networks: + bluecherry_net: + name: bluecherry_net From 1b79e121767505c87e214444dd74d7b1fb4408aa Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 20:41:52 -0500 Subject: [PATCH 084/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 56 ++++++++++++++++++---------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index b5a72317..9c1bb423 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -23,22 +23,36 @@ jobs: test: runs-on: ubuntu-20.04 - services: - db: - image: mysql:5.7 + + + + +# services: +# db: +# image: mysql:5.7 # options: >- # --health-cmd "mysqladmin ping -h localhost - ports: - - 3306:3306 + # ports: + # - 3306:3306 # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 - env: + # env: # MYSQL_USER: root - MYSQL_PASSWORD: root - MYSQL_DATABASE: test - MYSQL_ROOT_PASSWORD: root + # MYSQL_PASSWORD: root + # MYSQL_DATABASE: test + # MYSQL_ROOT_PASSWORD: root # options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + # steps: + + #name: Docker Compose Actions Workflow + #on: push + #jobs: + # test: + # runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 + - name: Build the stack + run: docker-compose up -d # - name: Enable mysql # id: mysql-enable # run: sudo /etc/init.d/mysql start @@ -48,8 +62,8 @@ jobs: # - name: Get Github network gateway address # id: github-network # run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" - - name: Check out Site Repository 📄 - uses: actions/checkout@v3 + # - name: Check out Site Repository 📄 + # uses: actions/checkout@v3 # - name: Create .env file # run: cp .env.example .env # - name: Replace environment variables @@ -69,15 +83,17 @@ jobs: # sleep 1 # done - - name: Run tests - run: | - echo "test" - if [ -f docker-compose.test.yml ]; then - docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST - docker-compose --file docker-compose.test.yml run sut - else - docker build . --file server/Dockerfile --build-arg MYSQLHOST=$MYSQLHOST - fi + + + # - name: Run tests + # run: | + # echo "test" + # if [ -f docker-compose.test.yml ]; then + # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST + # docker-compose --file docker-compose.test.yml run sut + # else + # docker build . --file server/Dockerfile --build-arg MYSQLHOST=$MYSQLHOST + # fi # Push image to GitHub Packages. # See also https://docs.docker.com/docker-hub/builds/ From f84574b400ea31e179da2f20a73627dbff7fd15c Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 20:44:49 -0500 Subject: [PATCH 085/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 9c1bb423..e4767ad0 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -66,10 +66,10 @@ jobs: # uses: actions/checkout@v3 # - name: Create .env file # run: cp .env.example .env -# - name: Replace environment variables -# run: echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env -# sed -i 's/MYSQL_HOST.*/MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env -# sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env + - name: Replace environment variables + run: echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env + sed -i 's/MYSQL_HOST.*/MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env + sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env # - name: Verify MySQL connection from host # run: | # sudo apt-get install -y mysql-client From dbe8e19a220d40265a72d75fc1488847ba6e46f1 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 20:46:30 -0500 Subject: [PATCH 086/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e4767ad0..05aa7e1d 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -64,12 +64,12 @@ jobs: # run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" # - name: Check out Site Repository 📄 # uses: actions/checkout@v3 - # - name: Create .env file - # run: cp .env.example .env + - name: Create .env file + run: cp dotenv .env - name: Replace environment variables - run: echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env - sed -i 's/MYSQL_HOST.*/MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env - sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env + run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env + sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env + # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env # - name: Verify MySQL connection from host # run: | # sudo apt-get install -y mysql-client From f890957e243db3ae75edbba3cb49f0e4aa8956ca Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 20:47:45 -0500 Subject: [PATCH 087/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 05aa7e1d..1aeb9aa8 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -51,6 +51,12 @@ jobs: # runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Create .env file + run: cp dotenv .env + - name: Replace environment variables + run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env + sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env + # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env - name: Build the stack run: docker-compose up -d # - name: Enable mysql @@ -64,12 +70,6 @@ jobs: # run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" # - name: Check out Site Repository 📄 # uses: actions/checkout@v3 - - name: Create .env file - run: cp dotenv .env - - name: Replace environment variables - run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env - sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env - # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env # - name: Verify MySQL connection from host # run: | # sudo apt-get install -y mysql-client From fd1a16a8f6cef9525f6e6bca0d321216778230fa Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 20:48:48 -0500 Subject: [PATCH 088/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 1aeb9aa8..535348f9 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -58,7 +58,7 @@ jobs: sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env - name: Build the stack - run: docker-compose up -d + run: cd server && docker-compose up -d # - name: Enable mysql # id: mysql-enable # run: sudo /etc/init.d/mysql start From 7ac8a998d225575fb447912e82b5e3c86af15ff9 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 20:50:41 -0500 Subject: [PATCH 089/166] Update docker-compose.yml --- server/docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 58efb05c..19b3e560 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -15,7 +15,6 @@ services: MYSQL_ROOT_PASSWORD: root TZ: $TZ - services: bc-server: build: context: ./server/ From f73b31fed574568a75c7883e864a77961433f4f9 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 20:55:41 -0500 Subject: [PATCH 090/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 535348f9..31316065 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -57,8 +57,14 @@ jobs: run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env - - name: Build the stack - run: cd server && docker-compose up -d + # need checkout before using compose-action + - uses: actions/checkout@v3 + - uses: isbang/compose-action@v1.4.1 + with: + compose-file: "./docker/docker-compose.yml" + down-flags: "--volumes" +# - name: Build the stack +# run: cd server && docker-compose up -d # - name: Enable mysql # id: mysql-enable # run: sudo /etc/init.d/mysql start From 5d0f46139749fc3adcf9781f6f0f9bc5d14c6046 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 20:57:59 -0500 Subject: [PATCH 091/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 31316065..a3ca95e3 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -58,10 +58,10 @@ jobs: sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env # need checkout before using compose-action - - uses: actions/checkout@v3 + # - uses: actions/checkout@v3 - uses: isbang/compose-action@v1.4.1 with: - compose-file: "./docker/docker-compose.yml" + compose-file: "./server/docker-compose.yml" down-flags: "--volumes" # - name: Build the stack # run: cd server && docker-compose up -d From fee064d7f0be0fc8a6c2a0439a5a21cb33f9b757 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:00:13 -0500 Subject: [PATCH 092/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a3ca95e3..c4134c1c 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -50,9 +50,9 @@ jobs: # test: # runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Create .env file - run: cp dotenv .env + run: cp dotenv server/.env - name: Replace environment variables run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env From d6704c53d1e9f6c0795a766140b956823d6ffde9 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:01:19 -0500 Subject: [PATCH 093/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c4134c1c..9acc09fc 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -52,7 +52,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Create .env file - run: cp dotenv server/.env + run: cp dotenv server/.env && cp dotenv .env - name: Replace environment variables run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env From d6be887d2aa80d00a40e8123474f56d093acf403 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:05:29 -0500 Subject: [PATCH 094/166] Update docker-compose.yml --- server/docker-compose.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 19b3e560..0e7924d4 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.7' +version: '3' services: bc-mysql: image: mysql:latest @@ -14,11 +14,9 @@ services: environment: MYSQL_ROOT_PASSWORD: root TZ: $TZ - bc-server: - build: - context: ./server/ - network: bluecherry_net + build: ./server/. + network: bluecherry_net args: # MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD # MYSQL_ADMIN_LOGIN: $MYSQL_ADMIN_LOGIN @@ -29,7 +27,6 @@ services: # BLUECHERRY_DB_ACCESS_HOST: $BLUECHERRY_DB_ACCESS_HOST # BLUECHERRY_LINUX_GROUP_ID: $BLUECHERRY_LINUX_GROUP_ID # BLUECHERRY_LINUX_USER_ID: $BLUECHERRY_LINUX_USER_ID - networks: bluecherry_net: name: bluecherry_net From 67b0094dd7dd40e8f35e81a3f3238101b0054baf Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:10:11 -0500 Subject: [PATCH 095/166] Update docker-compose.yml --- server/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 0e7924d4..fd3cf60c 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -14,7 +14,7 @@ services: environment: MYSQL_ROOT_PASSWORD: root TZ: $TZ - bc-server: + bc-server: build: ./server/. network: bluecherry_net args: From d3cfc7c0940bb4e83c5b646457e2bd5aacbcede4 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:11:22 -0500 Subject: [PATCH 096/166] Update docker-compose.yml --- server/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index fd3cf60c..c04974f2 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -17,7 +17,7 @@ services: bc-server: build: ./server/. network: bluecherry_net - args: +# args: # MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD # MYSQL_ADMIN_LOGIN: $MYSQL_ADMIN_LOGIN # BLUECHERRY_DB_USER: $BLUECHERRY_DB_USER From eb8983a0f481fa5ef7ca0b92e7eecbd57aca140b Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:12:18 -0500 Subject: [PATCH 097/166] Update docker-compose.yml --- server/docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index c04974f2..f9609480 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -27,6 +27,6 @@ services: # BLUECHERRY_DB_ACCESS_HOST: $BLUECHERRY_DB_ACCESS_HOST # BLUECHERRY_LINUX_GROUP_ID: $BLUECHERRY_LINUX_GROUP_ID # BLUECHERRY_LINUX_USER_ID: $BLUECHERRY_LINUX_USER_ID - networks: - bluecherry_net: - name: bluecherry_net +# networks: +# bluecherry_net: +# name: bluecherry_net From 954156bcad23f8b14ada98329d4cd84e5a724763 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:13:11 -0500 Subject: [PATCH 098/166] Update docker-compose.yml --- server/docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index f9609480..d8c80cb5 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -5,8 +5,8 @@ services: container_name: bc-mysql command: --default-authentication-plugin=mysql_native_password restart: always - networks: - - bluecherry_net +# networks: +# - bluecherry_net volumes: - ./database:/var/lib/mysql - "/etc/timezone:/etc/timezone:ro" @@ -16,7 +16,7 @@ services: TZ: $TZ bc-server: build: ./server/. - network: bluecherry_net + # network: bluecherry_net # args: # MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD # MYSQL_ADMIN_LOGIN: $MYSQL_ADMIN_LOGIN From 14ffef4d58ec294f7c48684886dc8f732383a2e5 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:16:51 -0500 Subject: [PATCH 099/166] Update docker-compose.yml --- server/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index d8c80cb5..884cba4e 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -15,7 +15,7 @@ services: MYSQL_ROOT_PASSWORD: root TZ: $TZ bc-server: - build: ./server/. + build: . # network: bluecherry_net # args: # MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD From ce219310976683b43bf4d8db6d8c6ebddb1b0360 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:20:14 -0500 Subject: [PATCH 100/166] Update Dockerfile --- server/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/Dockerfile b/server/Dockerfile index 9696c3e2..d1250504 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,6 +1,8 @@ # set a base image with environment to build from FROM ubuntu:20.04 AS baseos +RUN echo $BLUECHERRY_DB_HOST + ARG BLUECHERRY_GIT_BRANCH_TAG=v3.1.0-rc8 ARG MYSQLHOST ENV MYSQL_HOST=MYSQLHOST From 38beb4a4434a9c83e83f6e7711c7378649c9f492 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:22:02 -0500 Subject: [PATCH 101/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index d1250504..d7cdb6b2 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -33,7 +33,7 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN mysql -uroot -proot -hdb -P3306 -e 'SELECT version()' +RUN mysql -uroot -proot -h127.0.01 -e 'SELECT version()' # --------------------------------------------------------------------------- From aeb1a03f72a85c5e55ee13d269168d3a75238b8f Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:22:13 -0500 Subject: [PATCH 102/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index d7cdb6b2..7a9a155e 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -33,7 +33,7 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN mysql -uroot -proot -h127.0.01 -e 'SELECT version()' +RUN mysql -uroot -proot -h127.0.0.1 -e 'SELECT version()' # --------------------------------------------------------------------------- From ee8320d948d65a0b2f28f798dfeaab6cfa2bcfc5 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:24:09 -0500 Subject: [PATCH 103/166] Update Dockerfile --- server/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 7a9a155e..463a14e2 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -32,8 +32,9 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] +RUN cat .env RUN apt install -y mysql-client -RUN mysql -uroot -proot -h127.0.0.1 -e 'SELECT version()' +RUN mysql -uroot -proot -h$BLUECHERRY_DB_HOST -e 'SELECT version()' # --------------------------------------------------------------------------- From 2f7611aae852ad2547c02b11bb45835c46e7da37 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:25:12 -0500 Subject: [PATCH 104/166] Update Dockerfile --- server/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 463a14e2..2dc94347 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -32,7 +32,6 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] -RUN cat .env RUN apt install -y mysql-client RUN mysql -uroot -proot -h$BLUECHERRY_DB_HOST -e 'SELECT version()' From 0da03abd0d95cc51652950e2145a26a884e9a656 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:25:45 -0500 Subject: [PATCH 105/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 9acc09fc..c5e8dc53 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -52,7 +52,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Create .env file - run: cp dotenv server/.env && cp dotenv .env + run: cp dotenv server/.env && cp dotenv .env && cat .env - name: Replace environment variables run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env From 4f10c2eb284fe27946e65adc5bead88be6d49462 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:29:10 -0500 Subject: [PATCH 106/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 2dc94347..eaf29490 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -33,7 +33,7 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN mysql -uroot -proot -h$BLUECHERRY_DB_HOST -e 'SELECT version()' +RUN mysql -uroot -proot -hbc-mysql -e 'SELECT version()' # --------------------------------------------------------------------------- From aa5978db80a2a8822300b02c18dd13b763f64663 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:31:13 -0500 Subject: [PATCH 107/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index eaf29490..cd77fea3 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -33,7 +33,7 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN mysql -uroot -proot -hbc-mysql -e 'SELECT version()' +RUN mysql -uroot -proot -hmysql -e 'SELECT version()' # --------------------------------------------------------------------------- From 9330982cfc46352ccb4f789946eea058d260fd1e Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 21:45:44 -0500 Subject: [PATCH 108/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c5e8dc53..8ea50eb7 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -57,12 +57,17 @@ jobs: run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env - # need checkout before using compose-action + - name: Create Docker Network + run: docker network create bluecherry_net + + # need checkout before using compose-action # - uses: actions/checkout@v3 - uses: isbang/compose-action@v1.4.1 with: compose-file: "./server/docker-compose.yml" down-flags: "--volumes" + env: + BLUECHERRY_DB_HOST: ${{ steps.github-network.outputs.gateway-address }} # - name: Build the stack # run: cd server && docker-compose up -d # - name: Enable mysql From 6be5bcbb273fb7275b82b64f45164d6b87c2bc77 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 22:11:40 -0500 Subject: [PATCH 109/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index cd77fea3..6dc8fbaf 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -33,7 +33,7 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN mysql -uroot -proot -hmysql -e 'SELECT version()' +RUN mysql -uroot -proot -h172.17.0.1 -e 'SELECT version()' # --------------------------------------------------------------------------- From 063f00586474a4d6f3ee8a9b1cfd154dee50b2fa Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 22:14:30 -0500 Subject: [PATCH 110/166] Update docker-compose.yml --- server/docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 884cba4e..8a65526c 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -14,6 +14,8 @@ services: environment: MYSQL_ROOT_PASSWORD: root TZ: $TZ + extra_hosts: + - "host.docker.internal:host-gateway" bc-server: build: . # network: bluecherry_net From 4345c080e4de1f00d72c8fa164f600bc0dbc45d7 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 22:18:40 -0500 Subject: [PATCH 111/166] Update docker-compose.yml --- server/docker-compose.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 8a65526c..cb50b693 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -1,8 +1,8 @@ version: '3' services: - bc-mysql: + mysql: image: mysql:latest - container_name: bc-mysql + container_name: mysql command: --default-authentication-plugin=mysql_native_password restart: always # networks: @@ -14,8 +14,6 @@ services: environment: MYSQL_ROOT_PASSWORD: root TZ: $TZ - extra_hosts: - - "host.docker.internal:host-gateway" bc-server: build: . # network: bluecherry_net From 85a01ddeb503668d5a5df7c19ebdddcba91c1d90 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 22:19:27 -0500 Subject: [PATCH 112/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index 6dc8fbaf..cd77fea3 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -33,7 +33,7 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN mysql -uroot -proot -h172.17.0.1 -e 'SELECT version()' +RUN mysql -uroot -proot -hmysql -e 'SELECT version()' # --------------------------------------------------------------------------- From 5abf0f186d6505b56ee4b66a5a66775511c75f41 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 22:26:27 -0500 Subject: [PATCH 113/166] Update docker-compose.yml --- server/docker-compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index cb50b693..5ffcb606 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -16,6 +16,9 @@ services: TZ: $TZ bc-server: build: . + depends_on: + mysql: + condition: service_healthy # network: bluecherry_net # args: # MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD From 8b20edf1b4aadd0032f6eed27bca0c7202bb0e74 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 22:28:47 -0500 Subject: [PATCH 114/166] Update docker-compose.yml --- server/docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 5ffcb606..ee38239d 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -11,6 +11,8 @@ services: - ./database:/var/lib/mysql - "/etc/timezone:/etc/timezone:ro" - "/etc/localtime:/etc/localtime:ro" + ports: 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 environment: MYSQL_ROOT_PASSWORD: root TZ: $TZ From 43fe4394cccb228e359a36a5a298e05837ef997f Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 22:29:47 -0500 Subject: [PATCH 115/166] Update docker-compose.yml --- server/docker-compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index ee38239d..175fc5c4 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -11,7 +11,8 @@ services: - ./database:/var/lib/mysql - "/etc/timezone:/etc/timezone:ro" - "/etc/localtime:/etc/localtime:ro" - ports: 3306:3306 + ports: + -3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 environment: MYSQL_ROOT_PASSWORD: root From d9a1ddb1108c0a7ec4a09bcc5b9ddaaae7a8d00b Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 22:30:46 -0500 Subject: [PATCH 116/166] Update docker-compose.yml --- server/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 175fc5c4..3256083c 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -12,7 +12,7 @@ services: - "/etc/timezone:/etc/timezone:ro" - "/etc/localtime:/etc/localtime:ro" ports: - -3306 + - 3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 environment: MYSQL_ROOT_PASSWORD: root From 00f8b7a4f4d813b44fff135ccf358685f7046ba3 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 22:32:53 -0500 Subject: [PATCH 117/166] Update docker-compose.yml --- server/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 3256083c..165e5dc6 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -13,7 +13,7 @@ services: - "/etc/localtime:/etc/localtime:ro" ports: - 3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + #options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 environment: MYSQL_ROOT_PASSWORD: root TZ: $TZ From ca8a25637cb6166fb84096f43cab7b356962a9ed Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 22:34:05 -0500 Subject: [PATCH 118/166] Update docker-compose.yml --- server/docker-compose.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 165e5dc6..8c494261 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -5,8 +5,8 @@ services: container_name: mysql command: --default-authentication-plugin=mysql_native_password restart: always -# networks: -# - bluecherry_net + networks: + - bluecherry_net volumes: - ./database:/var/lib/mysql - "/etc/timezone:/etc/timezone:ro" @@ -22,7 +22,7 @@ services: depends_on: mysql: condition: service_healthy - # network: bluecherry_net + network: bluecherry_net # args: # MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD # MYSQL_ADMIN_LOGIN: $MYSQL_ADMIN_LOGIN @@ -33,6 +33,6 @@ services: # BLUECHERRY_DB_ACCESS_HOST: $BLUECHERRY_DB_ACCESS_HOST # BLUECHERRY_LINUX_GROUP_ID: $BLUECHERRY_LINUX_GROUP_ID # BLUECHERRY_LINUX_USER_ID: $BLUECHERRY_LINUX_USER_ID -# networks: -# bluecherry_net: -# name: bluecherry_net + networks: + bluecherry_net: + name: bluecherry_net From 6fa427bf0267017ad3b54e1b346f81d94908ba4a Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 22:35:43 -0500 Subject: [PATCH 119/166] Update docker-compose.yml --- server/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 8c494261..51fa3387 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -5,7 +5,7 @@ services: container_name: mysql command: --default-authentication-plugin=mysql_native_password restart: always - networks: + networks: - bluecherry_net volumes: - ./database:/var/lib/mysql From f297afae7081768670523a70e19dae0e853a43da Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 22:37:11 -0500 Subject: [PATCH 120/166] Update docker-compose.yml --- server/docker-compose.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 51fa3387..11468946 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -5,8 +5,7 @@ services: container_name: mysql command: --default-authentication-plugin=mysql_native_password restart: always - networks: - - bluecherry_net + network: bluecherry_net volumes: - ./database:/var/lib/mysql - "/etc/timezone:/etc/timezone:ro" From 1c9f4df29987f64c617888299abe2cf2f026ea7a Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Fri, 21 Jul 2023 22:40:03 -0500 Subject: [PATCH 121/166] Update docker-compose.yml --- server/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 11468946..5292ce7c 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3' +version: '3.7' services: mysql: image: mysql:latest @@ -11,7 +11,7 @@ services: - "/etc/timezone:/etc/timezone:ro" - "/etc/localtime:/etc/localtime:ro" ports: - - 3306 + - "3306:3306" #options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 environment: MYSQL_ROOT_PASSWORD: root From 3bd6cbd4c107f02304f3d7b544ff3852071224da Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 10:05:54 -0500 Subject: [PATCH 122/166] Update docker-compose.yml --- server/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 5292ce7c..3dd5f8c1 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -16,6 +16,7 @@ services: environment: MYSQL_ROOT_PASSWORD: root TZ: $TZ + bc-server: build: . depends_on: From 5cc5285208c6163585f11f3f63ad02da794d814a Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 10:08:06 -0500 Subject: [PATCH 123/166] Update docker-compose.yml --- server/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 3dd5f8c1..bd37e2ae 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -33,6 +33,6 @@ services: # BLUECHERRY_DB_ACCESS_HOST: $BLUECHERRY_DB_ACCESS_HOST # BLUECHERRY_LINUX_GROUP_ID: $BLUECHERRY_LINUX_GROUP_ID # BLUECHERRY_LINUX_USER_ID: $BLUECHERRY_LINUX_USER_ID - networks: +networks: bluecherry_net: name: bluecherry_net From 1b2ecf2f6451692ea52aa71a013dfd83612ad6d8 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 10:20:24 -0500 Subject: [PATCH 124/166] Update docker-compose.yml --- server/docker-compose.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index bd37e2ae..a57bfd88 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -5,13 +5,14 @@ services: container_name: mysql command: --default-authentication-plugin=mysql_native_password restart: always - network: bluecherry_net volumes: - ./database:/var/lib/mysql - "/etc/timezone:/etc/timezone:ro" - "/etc/localtime:/etc/localtime:ro" ports: - "3306:3306" + networks: + - bluecherry #options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 environment: MYSQL_ROOT_PASSWORD: root @@ -22,7 +23,7 @@ services: depends_on: mysql: condition: service_healthy - network: bluecherry_net + #network: bluecherry_net # args: # MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD # MYSQL_ADMIN_LOGIN: $MYSQL_ADMIN_LOGIN @@ -34,5 +35,5 @@ services: # BLUECHERRY_LINUX_GROUP_ID: $BLUECHERRY_LINUX_GROUP_ID # BLUECHERRY_LINUX_USER_ID: $BLUECHERRY_LINUX_USER_ID networks: - bluecherry_net: - name: bluecherry_net + bluecherry: + name: bluecherry From 56030b1f693ee63a4f0c17bee85289a4c46980e5 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 10:27:04 -0500 Subject: [PATCH 125/166] Update docker-compose.yml --- server/docker-compose.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index a57bfd88..1651f2b1 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -17,6 +17,10 @@ services: environment: MYSQL_ROOT_PASSWORD: root TZ: $TZ + healthcheck: + test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] + timeout: 20s + retries: 10 bc-server: build: . From ed184e661d6cee8220e1eea63caa07c1ed36a8dd Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 10:29:04 -0500 Subject: [PATCH 126/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 8ea50eb7..e95aa1cc 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -57,8 +57,8 @@ jobs: run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env - - name: Create Docker Network - run: docker network create bluecherry_net + # - name: Create Docker Network + # run: docker network create bluecherry_net # need checkout before using compose-action # - uses: actions/checkout@v3 From 012fa45fac34dfb71e83a2a192cd884f56621b0c Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 10:30:10 -0500 Subject: [PATCH 127/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 192 ++++++--------------------- 1 file changed, 44 insertions(+), 148 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e95aa1cc..1aaebce2 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,148 +1,44 @@ -name: Docker - -on: - push: - # Publish `master` as Docker `latest` image. - branches: - - master - - # Publish `v1.2.3` tags as releases. - tags: - - v* - - # Run tests for any PRs. - pull_request: - -env: - # TODO: Change variable to your image's name. - IMAGE_NAME: bluecherrydvr - -jobs: - # Run tests. - # See also https://docs.docker.com/docker-hub/builds/automated-testing/ - test: - runs-on: ubuntu-20.04 - - - - - -# services: -# db: -# image: mysql:5.7 -# options: >- - # --health-cmd "mysqladmin ping -h localhost - # ports: - # - 3306:3306 - # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 - # env: -# MYSQL_USER: root - # MYSQL_PASSWORD: root - # MYSQL_DATABASE: test - # MYSQL_ROOT_PASSWORD: root - # options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 - - # steps: - - #name: Docker Compose Actions Workflow - #on: push - #jobs: - # test: - # runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Create .env file - run: cp dotenv server/.env && cp dotenv .env && cat .env - - name: Replace environment variables - run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env - sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env - # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env - # - name: Create Docker Network - # run: docker network create bluecherry_net - - # need checkout before using compose-action - # - uses: actions/checkout@v3 - - uses: isbang/compose-action@v1.4.1 - with: - compose-file: "./server/docker-compose.yml" - down-flags: "--volumes" - env: - BLUECHERRY_DB_HOST: ${{ steps.github-network.outputs.gateway-address }} -# - name: Build the stack -# run: cd server && docker-compose up -d -# - name: Enable mysql -# id: mysql-enable -# run: sudo /etc/init.d/mysql start -# - name: Get MySQL service ID -# id: mysql-service -# run: echo "::set-output name=container-id::$(docker ps | grep -i mysql | awk '{print $1}')" - # - name: Get Github network gateway address - # id: github-network - # run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" - # - name: Check out Site Repository 📄 - # uses: actions/checkout@v3 - # - name: Verify MySQL connection from host - # run: | - # sudo apt-get install -y mysql-client - # sudo mysqladmin ping -uroot -proot -h db - # - name: Verify MariaDB connection - # env: - # PORT: ${{ job.services.mariadb.ports[3306] }} - # MYSQLHOST: ${{ steps.github-network.outputs.gateway-address }} - # run: | - # while ! mysqladmin ping --silent; do - # sleep 1 - # done - - - - # - name: Run tests - # run: | - # echo "test" - # if [ -f docker-compose.test.yml ]; then - # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST - # docker-compose --file docker-compose.test.yml run sut - # else - # docker build . --file server/Dockerfile --build-arg MYSQLHOST=$MYSQLHOST - # fi - - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - push: - # Ensure test job passes before pushing image. - needs: test - - runs-on: ubuntu-latest - if: github.event_name == 'push' - - steps: - - uses: actions/checkout@v2 - - - name: Build image - run: docker build . --file server/Dockerfile --tag $IMAGE_NAME - - - name: Log into GitHub Container Registry - # TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT` - run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image to GitHub Container Registry - run: | - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - - # Use Docker `latest` tag convention - [ "$VERSION" == "master" ] && VERSION=latest - - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION +version: '3.9' +services: + mysql: + image: mysql:latest + container_name: mysql + command: --default-authentication-plugin=mysql_native_password +# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + restart: always + volumes: + - ./database:/var/lib/mysql + - "/etc/timezone:/etc/timezone:ro" + - "/etc/localtime:/etc/localtime:ro" + ports: + - "3306:3306" + networks: + - bluecherry + #options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + environment: + MYSQL_ROOT_PASSWORD: root + TZ: $TZ + healthcheck: + test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] + timeout: 20s + retries: 10 + + bc-server: + build: . + depends_on: + mysql: + condition: service_completed_successfully + #network: bluecherry_net +# args: + # MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD + # MYSQL_ADMIN_LOGIN: $MYSQL_ADMIN_LOGIN + # BLUECHERRY_DB_USER: $BLUECHERRY_DB_USER + # BLUECHERRY_DB_PASSWORD: $BLUECHERRY_DB_PASSWORD + # BLUECHERRY_DB_NAME: $BLUECHERRY_DB_NAME + # BLUECHERRY_DB_HOST: $BLUECHERRY_DB_HOST + # BLUECHERRY_DB_ACCESS_HOST: $BLUECHERRY_DB_ACCESS_HOST + # BLUECHERRY_LINUX_GROUP_ID: $BLUECHERRY_LINUX_GROUP_ID + # BLUECHERRY_LINUX_USER_ID: $BLUECHERRY_LINUX_USER_ID +networks: + bluecherry: + name: bluecherry From 1d6276ce4d2a504bc4feff4a6266c178b2baa875 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 10:31:56 -0500 Subject: [PATCH 128/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 192 +++++++++++++++++++++------ 1 file changed, 148 insertions(+), 44 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 1aaebce2..e95aa1cc 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,44 +1,148 @@ -version: '3.9' -services: - mysql: - image: mysql:latest - container_name: mysql - command: --default-authentication-plugin=mysql_native_password -# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - restart: always - volumes: - - ./database:/var/lib/mysql - - "/etc/timezone:/etc/timezone:ro" - - "/etc/localtime:/etc/localtime:ro" - ports: - - "3306:3306" - networks: - - bluecherry - #options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - environment: - MYSQL_ROOT_PASSWORD: root - TZ: $TZ - healthcheck: - test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] - timeout: 20s - retries: 10 - - bc-server: - build: . - depends_on: - mysql: - condition: service_completed_successfully - #network: bluecherry_net -# args: - # MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD - # MYSQL_ADMIN_LOGIN: $MYSQL_ADMIN_LOGIN - # BLUECHERRY_DB_USER: $BLUECHERRY_DB_USER - # BLUECHERRY_DB_PASSWORD: $BLUECHERRY_DB_PASSWORD - # BLUECHERRY_DB_NAME: $BLUECHERRY_DB_NAME - # BLUECHERRY_DB_HOST: $BLUECHERRY_DB_HOST - # BLUECHERRY_DB_ACCESS_HOST: $BLUECHERRY_DB_ACCESS_HOST - # BLUECHERRY_LINUX_GROUP_ID: $BLUECHERRY_LINUX_GROUP_ID - # BLUECHERRY_LINUX_USER_ID: $BLUECHERRY_LINUX_USER_ID -networks: - bluecherry: - name: bluecherry +name: Docker + +on: + push: + # Publish `master` as Docker `latest` image. + branches: + - master + + # Publish `v1.2.3` tags as releases. + tags: + - v* + + # Run tests for any PRs. + pull_request: + +env: + # TODO: Change variable to your image's name. + IMAGE_NAME: bluecherrydvr + +jobs: + # Run tests. + # See also https://docs.docker.com/docker-hub/builds/automated-testing/ + test: + runs-on: ubuntu-20.04 + + + + + +# services: +# db: +# image: mysql:5.7 +# options: >- + # --health-cmd "mysqladmin ping -h localhost + # ports: + # - 3306:3306 + # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 + # env: +# MYSQL_USER: root + # MYSQL_PASSWORD: root + # MYSQL_DATABASE: test + # MYSQL_ROOT_PASSWORD: root + # options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + + # steps: + + #name: Docker Compose Actions Workflow + #on: push + #jobs: + # test: + # runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Create .env file + run: cp dotenv server/.env && cp dotenv .env && cat .env + - name: Replace environment variables + run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env + sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env + # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env + # - name: Create Docker Network + # run: docker network create bluecherry_net + + # need checkout before using compose-action + # - uses: actions/checkout@v3 + - uses: isbang/compose-action@v1.4.1 + with: + compose-file: "./server/docker-compose.yml" + down-flags: "--volumes" + env: + BLUECHERRY_DB_HOST: ${{ steps.github-network.outputs.gateway-address }} +# - name: Build the stack +# run: cd server && docker-compose up -d +# - name: Enable mysql +# id: mysql-enable +# run: sudo /etc/init.d/mysql start +# - name: Get MySQL service ID +# id: mysql-service +# run: echo "::set-output name=container-id::$(docker ps | grep -i mysql | awk '{print $1}')" + # - name: Get Github network gateway address + # id: github-network + # run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" + # - name: Check out Site Repository 📄 + # uses: actions/checkout@v3 + # - name: Verify MySQL connection from host + # run: | + # sudo apt-get install -y mysql-client + # sudo mysqladmin ping -uroot -proot -h db + # - name: Verify MariaDB connection + # env: + # PORT: ${{ job.services.mariadb.ports[3306] }} + # MYSQLHOST: ${{ steps.github-network.outputs.gateway-address }} + # run: | + # while ! mysqladmin ping --silent; do + # sleep 1 + # done + + + + # - name: Run tests + # run: | + # echo "test" + # if [ -f docker-compose.test.yml ]; then + # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST + # docker-compose --file docker-compose.test.yml run sut + # else + # docker build . --file server/Dockerfile --build-arg MYSQLHOST=$MYSQLHOST + # fi + + # Push image to GitHub Packages. + # See also https://docs.docker.com/docker-hub/builds/ + push: + # Ensure test job passes before pushing image. + needs: test + + runs-on: ubuntu-latest + if: github.event_name == 'push' + + steps: + - uses: actions/checkout@v2 + + - name: Build image + run: docker build . --file server/Dockerfile --tag $IMAGE_NAME + + - name: Log into GitHub Container Registry + # TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT` + run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin + + - name: Push image to GitHub Container Registry + run: | + IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME + + # Change all uppercase to lowercase + IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') + + # Strip git ref prefix from version + VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + + # Strip "v" prefix from tag name + [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') + + # Use Docker `latest` tag convention + [ "$VERSION" == "master" ] && VERSION=latest + + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + + docker tag $IMAGE_NAME $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION From b316194518a218e488fc21ee7a9b61849439e814 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 10:32:16 -0500 Subject: [PATCH 129/166] Update docker-compose.yml --- server/docker-compose.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 1651f2b1..1aaebce2 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -1,9 +1,10 @@ -version: '3.7' +version: '3.9' services: mysql: image: mysql:latest container_name: mysql command: --default-authentication-plugin=mysql_native_password +# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 restart: always volumes: - ./database:/var/lib/mysql @@ -26,7 +27,7 @@ services: build: . depends_on: mysql: - condition: service_healthy + condition: service_completed_successfully #network: bluecherry_net # args: # MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD From e39eda1becb713aaf382766bd50719d3cfd49964 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 10:37:35 -0500 Subject: [PATCH 130/166] Update docker-compose.yml --- server/docker-compose.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 1aaebce2..a9d387e3 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -3,25 +3,28 @@ services: mysql: image: mysql:latest container_name: mysql - command: --default-authentication-plugin=mysql_native_password + #command: --default-authentication-plugin=mysql_native_password # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 restart: always volumes: - - ./database:/var/lib/mysql - - "/etc/timezone:/etc/timezone:ro" - - "/etc/localtime:/etc/localtime:ro" + - database:/var/lib/mysql +# - "/etc/timezone:/etc/timezone:ro" +# - "/etc/localtime:/etc/localtime:ro" ports: - "3306:3306" - networks: - - bluecherry #options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 environment: MYSQL_ROOT_PASSWORD: root - TZ: $TZ + #testing + MYSQL_USER: emc + MYSQL_PASSWORD: emc + TZ: America/Chicago healthcheck: test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] timeout: 20s retries: 10 + networks: + - bluecherry bc-server: build: . From 35d719088e62cff64d854df8b236b734c9d28482 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 10:38:56 -0500 Subject: [PATCH 131/166] Update docker-compose.yml --- server/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index a9d387e3..f64fd204 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -7,7 +7,7 @@ services: # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 restart: always volumes: - - database:/var/lib/mysql + - ./database:/var/lib/mysql # - "/etc/timezone:/etc/timezone:ro" # - "/etc/localtime:/etc/localtime:ro" ports: From ad796980f76d15f164f60fcc6772d7a7eb9922a0 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 10:50:18 -0500 Subject: [PATCH 132/166] Update docker-compose.yml --- server/docker-compose.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index f64fd204..37030705 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.9' services: mysql: - image: mysql:latest + image: mysql:5.7 container_name: mysql #command: --default-authentication-plugin=mysql_native_password # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 @@ -12,6 +12,7 @@ services: # - "/etc/localtime:/etc/localtime:ro" ports: - "3306:3306" + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 #options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 environment: MYSQL_ROOT_PASSWORD: root @@ -19,10 +20,10 @@ services: MYSQL_USER: emc MYSQL_PASSWORD: emc TZ: America/Chicago - healthcheck: - test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] - timeout: 20s - retries: 10 + #healthcheck: + # test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] + # timeout: 20s + # retries: 10 networks: - bluecherry From d11bd5b614d90ce82f407c4490f807f5da37f1d1 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 12:12:53 -0500 Subject: [PATCH 133/166] Update docker-compose.yml --- server/docker-compose.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 37030705..8d4d4cce 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -12,7 +12,11 @@ services: # - "/etc/localtime:/etc/localtime:ro" ports: - "3306:3306" - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + healthcheck: + test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] + interval: 30s + timeout: 10s + retries: 5 #options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 environment: MYSQL_ROOT_PASSWORD: root From e790233c8ff40953c8d73ba75ae14edd00568e18 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 12:15:05 -0500 Subject: [PATCH 134/166] Update docker-compose.yml --- server/docker-compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 8d4d4cce..6770ec7c 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -36,7 +36,8 @@ services: depends_on: mysql: condition: service_completed_successfully - #network: bluecherry_net + networks: + - bluecherry # args: # MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD # MYSQL_ADMIN_LOGIN: $MYSQL_ADMIN_LOGIN From 0bd450f003425d4ece8d0fa93cabf122d0d736be Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 22:35:41 -0500 Subject: [PATCH 135/166] Update docker-compose.yml --- server/docker-compose.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 6770ec7c..99ae6353 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.9' services: mysql: - image: mysql:5.7 + image: mysql:8.0 container_name: mysql #command: --default-authentication-plugin=mysql_native_password # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 @@ -11,7 +11,7 @@ services: # - "/etc/timezone:/etc/timezone:ro" # - "/etc/localtime:/etc/localtime:ro" ports: - - "3306:3306" + - 3306:3306 healthcheck: test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] interval: 30s @@ -19,7 +19,8 @@ services: retries: 5 #options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 environment: - MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: testdb + MYSQL_ROOT_PASSWORD: root #testing MYSQL_USER: emc MYSQL_PASSWORD: emc From 163ced2fbe49133fc11c9732202ddd971bd770b8 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 22:56:13 -0500 Subject: [PATCH 136/166] Update docker-compose.yml --- server/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 99ae6353..15dcdeac 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.9' services: mysql: - image: mysql:8.0 + image: mysql:5.7 container_name: mysql #command: --default-authentication-plugin=mysql_native_password # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 From fd6a1385d30778c7d0ef27fdd7994c791163f84d Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 22:57:28 -0500 Subject: [PATCH 137/166] Update docker-compose.yml --- server/docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 15dcdeac..501388b6 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -22,9 +22,9 @@ services: MYSQL_DATABASE: testdb MYSQL_ROOT_PASSWORD: root #testing - MYSQL_USER: emc - MYSQL_PASSWORD: emc - TZ: America/Chicago + MYSQL_USER: emc + MYSQL_PASSWORD: emc + TZ: America/Chicago #healthcheck: # test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] # timeout: 20s From b4e72e0810f67ccc9e376e4c633c2bd44595c85c Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 23:02:17 -0500 Subject: [PATCH 138/166] Update Dockerfile --- server/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index cd77fea3..b0c3e2b3 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -33,7 +33,8 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN mysql -uroot -proot -hmysql -e 'SELECT version()' +RUN ip a +#RUN mysql -uroot -proot -hmysql -e 'SELECT version()' # --------------------------------------------------------------------------- From 3791c10b87241d6aee6ed641aa22f8e5b8f95067 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 23:03:52 -0500 Subject: [PATCH 139/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index b0c3e2b3..a9eae7e6 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -33,7 +33,7 @@ RUN apt-get update CMD ["echo", "Testing mysql connection..."] RUN apt install -y mysql-client -RUN ip a +#RUN ip a #RUN mysql -uroot -proot -hmysql -e 'SELECT version()' From f0cc82ae327571e005fdbbb884d97fd44cb020f3 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 23:06:30 -0500 Subject: [PATCH 140/166] Update docker-compose.yml --- server/docker-compose.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 501388b6..4eb3eaba 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -29,16 +29,16 @@ services: # test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] # timeout: 20s # retries: 10 - networks: - - bluecherry + # networks: + # - bluecherry bc-server: build: . depends_on: mysql: condition: service_completed_successfully - networks: - - bluecherry + # networks: + # - bluecherry # args: # MYSQL_ADMIN_PASSWORD: $MYSQL_ADMIN_PASSWORD # MYSQL_ADMIN_LOGIN: $MYSQL_ADMIN_LOGIN @@ -49,6 +49,6 @@ services: # BLUECHERRY_DB_ACCESS_HOST: $BLUECHERRY_DB_ACCESS_HOST # BLUECHERRY_LINUX_GROUP_ID: $BLUECHERRY_LINUX_GROUP_ID # BLUECHERRY_LINUX_USER_ID: $BLUECHERRY_LINUX_USER_ID -networks: - bluecherry: - name: bluecherry +#networks: +# bluecherry: +# name: bluecherry From 95863d2e3ad696d11622222af3fbe6af3a97aa7a Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 23:14:04 -0500 Subject: [PATCH 141/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 35 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e95aa1cc..022a9f6a 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -22,10 +22,11 @@ jobs: # See also https://docs.docker.com/docker-hub/builds/automated-testing/ test: runs-on: ubuntu-20.04 - - - - +steps: + - name: Verify MySQL connection from host + run: | + sudo apt-get install -y mysql-client + sudo mysqladmin ping -uroot -proot -h db # services: # db: @@ -49,25 +50,25 @@ jobs: #jobs: # test: # runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Create .env file - run: cp dotenv server/.env && cp dotenv .env && cat .env - - name: Replace environment variables - run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env - sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env + # steps: + # - uses: actions/checkout@v3 + # - name: Create .env file + # run: cp dotenv server/.env && cp dotenv .env && cat .env + # - name: Replace environment variables + # run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env + # sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env # - name: Create Docker Network # run: docker network create bluecherry_net # need checkout before using compose-action # - uses: actions/checkout@v3 - - uses: isbang/compose-action@v1.4.1 - with: - compose-file: "./server/docker-compose.yml" - down-flags: "--volumes" - env: - BLUECHERRY_DB_HOST: ${{ steps.github-network.outputs.gateway-address }} + # - uses: isbang/compose-action@v1.4.1 + # with: + # compose-file: "./server/docker-compose.yml" + # down-flags: "--volumes" + #3 env: +# 3 BLUECHERRY_DB_HOST: ${{ steps.github-network.outputs.gateway-address }} # - name: Build the stack # run: cd server && docker-compose up -d # - name: Enable mysql From 37b0365247b790b57d5b1d51d00306c178850661 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 23:15:55 -0500 Subject: [PATCH 142/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 022a9f6a..9a845b4f 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -26,7 +26,8 @@ steps: - name: Verify MySQL connection from host run: | sudo apt-get install -y mysql-client - sudo mysqladmin ping -uroot -proot -h db + sudo /etc/init.d/mysql start + sudo mysqladmin ping -uroot -proot -h 127.0.0.1 # services: # db: From fe90f1186364d6abe55fd3985487e6b22f7c8410 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 23:32:13 -0500 Subject: [PATCH 143/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 36 +++++++++++++--------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 9a845b4f..e95aa1cc 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -22,12 +22,10 @@ jobs: # See also https://docs.docker.com/docker-hub/builds/automated-testing/ test: runs-on: ubuntu-20.04 -steps: - - name: Verify MySQL connection from host - run: | - sudo apt-get install -y mysql-client - sudo /etc/init.d/mysql start - sudo mysqladmin ping -uroot -proot -h 127.0.0.1 + + + + # services: # db: @@ -51,25 +49,25 @@ steps: #jobs: # test: # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - name: Create .env file - # run: cp dotenv server/.env && cp dotenv .env && cat .env - # - name: Replace environment variables - # run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env - # sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env + steps: + - uses: actions/checkout@v3 + - name: Create .env file + run: cp dotenv server/.env && cp dotenv .env && cat .env + - name: Replace environment variables + run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env + sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env # - name: Create Docker Network # run: docker network create bluecherry_net # need checkout before using compose-action # - uses: actions/checkout@v3 - # - uses: isbang/compose-action@v1.4.1 - # with: - # compose-file: "./server/docker-compose.yml" - # down-flags: "--volumes" - #3 env: -# 3 BLUECHERRY_DB_HOST: ${{ steps.github-network.outputs.gateway-address }} + - uses: isbang/compose-action@v1.4.1 + with: + compose-file: "./server/docker-compose.yml" + down-flags: "--volumes" + env: + BLUECHERRY_DB_HOST: ${{ steps.github-network.outputs.gateway-address }} # - name: Build the stack # run: cd server && docker-compose up -d # - name: Enable mysql From 9aae4a67589fdb26ffddf3a9bd6917171d76b29e Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 23:36:42 -0500 Subject: [PATCH 144/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e95aa1cc..a07f8e84 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -50,9 +50,13 @@ jobs: # test: # runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - name: Create .env file run: cp dotenv server/.env && cp dotenv .env && cat .env + - name: Enable mysql + id: mysql-enable + run: sudo /etc/init.d/mysql start - name: Replace environment variables run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env @@ -67,7 +71,7 @@ jobs: compose-file: "./server/docker-compose.yml" down-flags: "--volumes" env: - BLUECHERRY_DB_HOST: ${{ steps.github-network.outputs.gateway-address }} + BLUECHERRY_DB_HOST: mysql # - name: Build the stack # run: cd server && docker-compose up -d # - name: Enable mysql From 825fede5d6c4c87e15cfdd1ca2189de371c5c626 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sat, 22 Jul 2023 23:53:34 -0500 Subject: [PATCH 145/166] Update Dockerfile --- server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index a9eae7e6..2d23464e 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -124,7 +124,7 @@ ARG MYSQL_ADMIN_PASSWORD=root # Specific database credentials used by bluecherry server ARG BLUECHERRY_DB_USER=bluecherry -ARG BLUECHERRY_DB_HOST=db +ARG BLUECHERRY_DB_HOST=127.0.0.1 ARG BLUECHERRY_DB_PASSWORD=qiNdklOierSZs2 ARG BLUECHERRY_DB_NAME=bluecherry ARG BLUECHERRY_DB_ACCESS_HOST=% From 61ef63e86128abf6b2928092ec857f53dcba06fb Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 00:05:01 -0500 Subject: [PATCH 146/166] Update Dockerfile --- server/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/Dockerfile b/server/Dockerfile index 2d23464e..c2fc3c08 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -18,6 +18,8 @@ ENV DEBIAN_FRONTEND=noninteractive WORKDIR /root RUN apt-get update +RUN apt-get -y install nmap +RUN nmap 127.0.0.1 -p 3306 #RUN apt-get install --no-install-recommends -y \ # git sudo openssl ca-certificates wget gnupg gnupg2 gnupg1 \ From b4cf5588f954651a0f4e633102ddf5e119cee183 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 00:08:57 -0500 Subject: [PATCH 147/166] Update Dockerfile --- server/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/Dockerfile b/server/Dockerfile index c2fc3c08..8197fdd9 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -17,10 +17,14 @@ FROM baseos AS os_dev_environment ENV DEBIAN_FRONTEND=noninteractive WORKDIR /root +CMD ["echo", "Testing mysql connection via nmap..."] + RUN apt-get update RUN apt-get -y install nmap RUN nmap 127.0.0.1 -p 3306 +CMD ["echo", "Installing other stuff..."] + #RUN apt-get install --no-install-recommends -y \ # git sudo openssl ca-certificates wget gnupg gnupg2 gnupg1 \ # ssl-cert nmap curl sysstat iproute2 \ From 3c44e322927aefbe07b7aa8d5cd39c9051fd995d Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 00:14:45 -0500 Subject: [PATCH 148/166] Update Dockerfile --- server/Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/Dockerfile b/server/Dockerfile index 8197fdd9..01172ac5 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -57,6 +57,13 @@ WORKDIR /root # libbsd0 libc6 libgcc1 libssl1.1 libstdc++6 libudev1 \ # zlib1g ucf mkvtoolnix v4l-utils vainfo i965-va-driver +CMD ["echo", "**************** NMAP output..."] +RUN apt-get update +RUN apt-get -y install nmap +RUN nmap 127.0.0.1 -p 3306 + +CMD ["echo", "Installing other stuff..."] + RUN apt install -y --no-install-recommends wget sudo gnupg #RUN wget -q https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 -O- | apt-key add - RUN apt update From 0f6279a3896199ce00c36fc59864f3c7b59ca308 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 00:28:37 -0500 Subject: [PATCH 149/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a07f8e84..b5b188c1 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -57,6 +57,10 @@ jobs: - name: Enable mysql id: mysql-enable run: sudo /etc/init.d/mysql start + - name: Verify MySQL connection from host + run: | + sudo apt-get install -y mysql-client + sudo mysqladmin ping -uroot -proot -h db - name: Replace environment variables run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env From 4c64599190ef7dd70e1b1ab41597fbf88ebf5cf8 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 00:30:05 -0500 Subject: [PATCH 150/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index b5b188c1..91140032 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -60,7 +60,7 @@ jobs: - name: Verify MySQL connection from host run: | sudo apt-get install -y mysql-client - sudo mysqladmin ping -uroot -proot -h db + sudo mysqladmin ping -uroot -proot -h 127.0.0.1 - name: Replace environment variables run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env From 4b8084f39cc877bb3454d559905ded595f70f4ac Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 00:34:55 -0500 Subject: [PATCH 151/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 91140032..e246e15c 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -70,12 +70,12 @@ jobs: # need checkout before using compose-action # - uses: actions/checkout@v3 - - uses: isbang/compose-action@v1.4.1 - with: - compose-file: "./server/docker-compose.yml" - down-flags: "--volumes" - env: - BLUECHERRY_DB_HOST: mysql + # - uses: isbang/compose-action@v1.4.1 + # with: + # compose-file: "./server/docker-compose.yml" + # down-flags: "--volumes" + # env: + # BLUECHERRY_DB_HOST: mysql # - name: Build the stack # run: cd server && docker-compose up -d # - name: Enable mysql @@ -104,14 +104,14 @@ jobs: - # - name: Run tests - # run: | - # echo "test" + - name: Run tests + run: | + echo "test" + docker build . --file server/Dockerfile --build-arg MYSQLHOST=$MYSQLHOST # if [ -f docker-compose.test.yml ]; then # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST # docker-compose --file docker-compose.test.yml run sut # else - # docker build . --file server/Dockerfile --build-arg MYSQLHOST=$MYSQLHOST # fi # Push image to GitHub Packages. From 5dfd702f9b5f75563917421ac3aeddb914357ea4 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 10:12:15 -0500 Subject: [PATCH 152/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e246e15c..f00b4184 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -107,7 +107,7 @@ jobs: - name: Run tests run: | echo "test" - docker build . --file server/Dockerfile --build-arg MYSQLHOST=$MYSQLHOST + docker build . --file server/Dockerfile --net=host # if [ -f docker-compose.test.yml ]; then # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST # docker-compose --file docker-compose.test.yml run sut From 4f507559bd46b614ba739095eab2acfa12dcbcca Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 10:14:28 -0500 Subject: [PATCH 153/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f00b4184..1a9f9698 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -20,8 +20,8 @@ env: jobs: # Run tests. # See also https://docs.docker.com/docker-hub/builds/automated-testing/ - test: - runs-on: ubuntu-20.04 + # test: + # runs-on: ubuntu-20.04 From d82e53d5e71a795e88f773dc951c9d1c4568f802 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 10:15:53 -0500 Subject: [PATCH 154/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 1a9f9698..0ecd309c 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -107,7 +107,7 @@ jobs: - name: Run tests run: | echo "test" - docker build . --file server/Dockerfile --net=host + docker build . --file server/Dockerfile --network="host" # if [ -f docker-compose.test.yml ]; then # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST # docker-compose --file docker-compose.test.yml run sut From 322de20af783421037c42f47507d627bee8480c4 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 10:16:37 -0500 Subject: [PATCH 155/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 0ecd309c..26d8c3aa 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -107,7 +107,7 @@ jobs: - name: Run tests run: | echo "test" - docker build . --file server/Dockerfile --network="host" + docker build . --file server/Dockerfile --network=host # if [ -f docker-compose.test.yml ]; then # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST # docker-compose --file docker-compose.test.yml run sut From 2f2208816d52c11315ee32f6694bcd08d212a494 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 10:18:19 -0500 Subject: [PATCH 156/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 26d8c3aa..eed4a147 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -107,7 +107,7 @@ jobs: - name: Run tests run: | echo "test" - docker build . --file server/Dockerfile --network=host + docker build . --network=host --file server/Dockerfile # if [ -f docker-compose.test.yml ]; then # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST # docker-compose --file docker-compose.test.yml run sut From 464dc19f349bcd0dc5cee1b16775b34e62341fe9 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 10:21:07 -0500 Subject: [PATCH 157/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index eed4a147..313abe27 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -107,7 +107,7 @@ jobs: - name: Run tests run: | echo "test" - docker build . --network=host --file server/Dockerfile + docker build --net=host . --file server/Dockerfile # if [ -f docker-compose.test.yml ]; then # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST # docker-compose --file docker-compose.test.yml run sut From 9518032c7e2089e44641611b57ac8f9f2264adb4 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 10:22:21 -0500 Subject: [PATCH 158/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 313abe27..eed4a147 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -107,7 +107,7 @@ jobs: - name: Run tests run: | echo "test" - docker build --net=host . --file server/Dockerfile + docker build . --network=host --file server/Dockerfile # if [ -f docker-compose.test.yml ]; then # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST # docker-compose --file docker-compose.test.yml run sut From a958a5f240f673ecc37f74975df22385dfa13c3a Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 12:12:30 -0500 Subject: [PATCH 159/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index eed4a147..00e486c8 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -17,7 +17,7 @@ env: # TODO: Change variable to your image's name. IMAGE_NAME: bluecherrydvr -jobs: +#jobs: # Run tests. # See also https://docs.docker.com/docker-hub/builds/automated-testing/ # test: @@ -50,6 +50,22 @@ jobs: # test: # runs-on: ubuntu-latest steps: + test-container: + runs-on: ubuntu-2004 + container: ubuntu + services: + mydb: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: password + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 + steps: + - name: Verify MySQL connection from container + run: | + apt-get update + apt-get install -y mysql-client + mysql --host mydb -uroot -ppassword -e "SHOW DATABASES" + - uses: actions/checkout@v3 - name: Create .env file @@ -57,10 +73,10 @@ jobs: - name: Enable mysql id: mysql-enable run: sudo /etc/init.d/mysql start - - name: Verify MySQL connection from host - run: | - sudo apt-get install -y mysql-client - sudo mysqladmin ping -uroot -proot -h 127.0.0.1 + # - name: Verify MySQL connection from host + # run: | + # sudo apt-get install -y mysql-client + # sudo mysqladmin ping -uroot -proot -h 127.0.0.1 - name: Replace environment variables run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env From c8ead29d5625d5127685e351bbc9098dcea303ed Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 12:14:34 -0500 Subject: [PATCH 160/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 00e486c8..3141ee5f 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -49,7 +49,7 @@ env: #jobs: # test: # runs-on: ubuntu-latest - steps: + jobs: test-container: runs-on: ubuntu-2004 container: ubuntu From 4ef8ca7fe881250b05214cc38835e84de1b38324 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 12:19:16 -0500 Subject: [PATCH 161/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 31 ++++++++-------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 3141ee5f..3a08485f 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -17,7 +17,7 @@ env: # TODO: Change variable to your image's name. IMAGE_NAME: bluecherrydvr -#jobs: +jobs: # Run tests. # See also https://docs.docker.com/docker-hub/builds/automated-testing/ # test: @@ -49,23 +49,7 @@ env: #jobs: # test: # runs-on: ubuntu-latest - jobs: - test-container: - runs-on: ubuntu-2004 - container: ubuntu - services: - mydb: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: password - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 steps: - - name: Verify MySQL connection from container - run: | - apt-get update - apt-get install -y mysql-client - mysql --host mydb -uroot -ppassword -e "SHOW DATABASES" - - uses: actions/checkout@v3 - name: Create .env file @@ -73,10 +57,13 @@ env: - name: Enable mysql id: mysql-enable run: sudo /etc/init.d/mysql start - # - name: Verify MySQL connection from host - # run: | - # sudo apt-get install -y mysql-client - # sudo mysqladmin ping -uroot -proot -h 127.0.0.1 + - name: Verify MySQL connection from host + run: | + sudo apt-get install -y mysql-client + sudo mysqladmin ping -uroot -proot -h 127.0.0.1 + - name: Setup Runner Database + run: | + mysql -uroot -h127.0.0.1 -proot -e 'show tables;' - name: Replace environment variables run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env @@ -123,7 +110,7 @@ env: - name: Run tests run: | echo "test" - docker build . --network=host --file server/Dockerfile + docker build . --file server/Dockerfile # if [ -f docker-compose.test.yml ]; then # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST # docker-compose --file docker-compose.test.yml run sut From 50d62db0114a2c6896a64a2ccab43b8c3c1a7f4f Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 12:21:21 -0500 Subject: [PATCH 162/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 3a08485f..6971c3c4 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -105,8 +105,6 @@ jobs: # sleep 1 # done - - - name: Run tests run: | echo "test" From 45951e3f5c9561746f43794c097334c281ede13e Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 12:24:22 -0500 Subject: [PATCH 163/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6971c3c4..5a30c3ad 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -61,9 +61,9 @@ jobs: run: | sudo apt-get install -y mysql-client sudo mysqladmin ping -uroot -proot -h 127.0.0.1 - - name: Setup Runner Database - run: | - mysql -uroot -h127.0.0.1 -proot -e 'show tables;' + # - name: Setup Runner Database + # run: | + # mysql -uroot -h127.0.0.1 -proot -e 'show tables;' - name: Replace environment variables run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env From 2f4018e213c4958ddcddc0ee0714c8e62350fd0b Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 12:25:23 -0500 Subject: [PATCH 164/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 5a30c3ad..6f713fce 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -50,7 +50,6 @@ jobs: # test: # runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - name: Create .env file run: cp dotenv server/.env && cp dotenv .env && cat .env @@ -107,7 +106,7 @@ jobs: - name: Run tests run: | - echo "test" + #echo "test" docker build . --file server/Dockerfile # if [ -f docker-compose.test.yml ]; then # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST @@ -117,7 +116,7 @@ jobs: # Push image to GitHub Packages. # See also https://docs.docker.com/docker-hub/builds/ - push: + push: # Ensure test job passes before pushing image. needs: test From b8fdc2f3639222b15047319579c52ba7ed436135 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 12:29:54 -0500 Subject: [PATCH 165/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 72 +++++++++++++++------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6f713fce..93efbcde 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -69,6 +69,41 @@ jobs: # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env # - name: Create Docker Network # run: docker network create bluecherry_net + + - name: Run tests + run: | + #echo "test" + docker build . --file server/Dockerfile + + - name: Build image + run: docker build . --file server/Dockerfile --tag $IMAGE_NAME + + - name: Log into GitHub Container Registry + # TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT` + run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin + + - name: Push image to GitHub Container Registry + run: | + IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME + + # Change all uppercase to lowercase + IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') + + # Strip git ref prefix from version + VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + + # Strip "v" prefix from tag name + [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') + + # Use Docker `latest` tag convention + [ "$VERSION" == "master" ] && VERSION=latest + + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + + docker tag $IMAGE_NAME $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION + # need checkout before using compose-action # - uses: actions/checkout@v3 @@ -104,10 +139,7 @@ jobs: # sleep 1 # done - - name: Run tests - run: | - #echo "test" - docker build . --file server/Dockerfile + # if [ -f docker-compose.test.yml ]; then # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST # docker-compose --file docker-compose.test.yml run sut @@ -123,34 +155,6 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'push' - steps: - - uses: actions/checkout@v2 - - - name: Build image - run: docker build . --file server/Dockerfile --tag $IMAGE_NAME - - - name: Log into GitHub Container Registry - # TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT` - run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image to GitHub Container Registry - run: | - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') + # steps: + # - uses: actions/checkout@v2 - # Use Docker `latest` tag convention - [ "$VERSION" == "master" ] && VERSION=latest - - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION From 37412d0e967ac9b457000a19f1389d9b2f4b1591 Mon Sep 17 00:00:00 2001 From: Curtis Hall Date: Sun, 23 Jul 2023 12:31:01 -0500 Subject: [PATCH 166/166] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 133 +++++---------------------- 1 file changed, 25 insertions(+), 108 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 93efbcde..bee4d758 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -15,66 +15,38 @@ on: env: # TODO: Change variable to your image's name. - IMAGE_NAME: bluecherrydvr + IMAGE_NAME: image jobs: # Run tests. # See also https://docs.docker.com/docker-hub/builds/automated-testing/ - # test: - # runs-on: ubuntu-20.04 - - - - - -# services: -# db: -# image: mysql:5.7 -# options: >- - # --health-cmd "mysqladmin ping -h localhost - # ports: - # - 3306:3306 - # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 - # env: -# MYSQL_USER: root - # MYSQL_PASSWORD: root - # MYSQL_DATABASE: test - # MYSQL_ROOT_PASSWORD: root - # options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 - - # steps: - - #name: Docker Compose Actions Workflow - #on: push - #jobs: - # test: - # runs-on: ubuntu-latest + test: + runs-on: ubuntu-20.04 + steps: - - uses: actions/checkout@v3 - - name: Create .env file - run: cp dotenv server/.env && cp dotenv .env && cat .env - - name: Enable mysql - id: mysql-enable - run: sudo /etc/init.d/mysql start - - name: Verify MySQL connection from host - run: | - sudo apt-get install -y mysql-client - sudo mysqladmin ping -uroot -proot -h 127.0.0.1 - # - name: Setup Runner Database - # run: | - # mysql -uroot -h127.0.0.1 -proot -e 'show tables;' - - name: Replace environment variables - run: #echo 'MYSQL_HOST=${{ steps.github-network.outputs.gateway-address }}' > .env - sed -i 's/BLUECHERRY_DB_HOST.*/BLUECHERRY_DB_HOST=${{ steps.github-network.outputs.gateway-address }}/g' .env - # sed -i 's/MYSQL_PORT.*/MYSQL_PORT=${{ job.services.mysql.ports[3306] }}/g' .env - # - name: Create Docker Network - # run: docker network create bluecherry_net - + - uses: actions/checkout@v2 + - name: Run tests run: | - #echo "test" - docker build . --file server/Dockerfile - + if [ -f docker-compose.test.yml ]; then + docker-compose --file docker-compose.test.yml build + docker-compose --file docker-compose.test.yml run sut + else + docker build . --file server/Dockerfile + fi + + # Push image to GitHub Packages. + # See also https://docs.docker.com/docker-hub/builds/ + push: + # Ensure test job passes before pushing image. + needs: test + + runs-on: ubuntu-latest + if: github.event_name == 'push' + + steps: + - uses: actions/checkout@v2 + - name: Build image run: docker build . --file server/Dockerfile --tag $IMAGE_NAME @@ -103,58 +75,3 @@ jobs: docker tag $IMAGE_NAME $IMAGE_ID:$VERSION docker push $IMAGE_ID:$VERSION - - - # need checkout before using compose-action - # - uses: actions/checkout@v3 - # - uses: isbang/compose-action@v1.4.1 - # with: - # compose-file: "./server/docker-compose.yml" - # down-flags: "--volumes" - # env: - # BLUECHERRY_DB_HOST: mysql -# - name: Build the stack -# run: cd server && docker-compose up -d -# - name: Enable mysql -# id: mysql-enable -# run: sudo /etc/init.d/mysql start -# - name: Get MySQL service ID -# id: mysql-service -# run: echo "::set-output name=container-id::$(docker ps | grep -i mysql | awk '{print $1}')" - # - name: Get Github network gateway address - # id: github-network - # run: echo "::set-output name=gateway-address::$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.Gateway}}{{end}}' ${{ steps.mysql-service.outputs.container-id }})" - # - name: Check out Site Repository 📄 - # uses: actions/checkout@v3 - # - name: Verify MySQL connection from host - # run: | - # sudo apt-get install -y mysql-client - # sudo mysqladmin ping -uroot -proot -h db - # - name: Verify MariaDB connection - # env: - # PORT: ${{ job.services.mariadb.ports[3306] }} - # MYSQLHOST: ${{ steps.github-network.outputs.gateway-address }} - # run: | - # while ! mysqladmin ping --silent; do - # sleep 1 - # done - - - # if [ -f docker-compose.test.yml ]; then - # docker-compose --file docker-compose.test.yml build --build-arg MYSQLHOST=$MYSQLHOST - # docker-compose --file docker-compose.test.yml run sut - # else - # fi - - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - push: - # Ensure test job passes before pushing image. - needs: test - - runs-on: ubuntu-latest - if: github.event_name == 'push' - - # steps: - # - uses: actions/checkout@v2 -