use mariadb in another docker for ci test

This commit is contained in:
einhornimmond 2025-05-08 18:20:15 +02:00
parent d25574c22f
commit 4e0783fc8e
2 changed files with 4 additions and 21 deletions

View File

@ -31,10 +31,5 @@ jobs:
- name: docker-compose mariadb
run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps mariadb
- name: run install script, which will run start.sh
run: |
cd deployment/hetzner_cloud
sudo ./install.sh ${{ github.ref_name }}
#- name: Deploy Bare Metal | Build image
# run: docker build -f ./deployment/bare_metal/Dockerfile --build-arg BRANCH_NAME=${{ github.ref_name }} -t "gradido/deploy-bare-metal:local" .
- name: Deploy Bare Metal | Build image
run: docker build --network host -f ./deployment/bare_metal/Dockerfile --build-arg BRANCH_NAME=${{ github.ref_name }} -t "gradido/deploy-bare-metal:local" .

View File

@ -68,20 +68,10 @@ RUN npm i -g yarn
# Install pm2
RUN npm i -g pm2 && pm2 startup
# create db user
ENV DB_USER=gradido
RUN DB_PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c 32)
ENV DB_PASSWORD=$DB_PASSWORD
RUN
RUN service mariadb start && mysql <<EOFMYSQL
CREATE USER IF NOT EXISTS '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO '$DB_USER'@'localhost';
FLUSH PRIVILEGES;
EOFMYSQL
WORKDIR /app/gradido
# Configure database
RUN DB_USER=gradido
RUN DB_PASSWORD=
RUN envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < database/.env.template > database/.env
# Configure backend
@ -106,8 +96,6 @@ RUN envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < federation/.env.templat
###########################################################################################
FROM install as start
RUN /etc/init.d/mariadb start
WORKDIR /app/gradido/deployment/bare_metal
# mock sudo