[DEV-190] Fix tests in Github Actions (#1217)

* Silly test

* Add better debugging, try starting service

* Try stopping and re-starting the mysql service, the old way

* Check status before running MySQL command

* Now that indeed mysql is not started, make it start

* [DEV-190] Try removing background-running of make run

* Ignore mysql service when not running at the beginning

* [DEV-190] Mount folder with instructions on how to initialize

* [DEV-190] Go back to using normal make run

* Adding -v command to mount volume with init scripts

* Remove SSH terminal to Github Actions instance

* Remove enabling of MySQL

* Remove unnecessary parts from Makefile
This commit is contained in:
Maximiliano Redigonda 2022-06-01 07:00:00 -03:00 committed by GitHub
parent b620baf5ed
commit 8c732f5dda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 5 deletions

View File

@ -0,0 +1 @@
mysql -u root -e "CREATE DATABASE IF NOT EXISTS development;"

View File

@ -11,18 +11,17 @@ build:
install:
@docker exec -it opensupports-srv bash -c "cd /var/www/html && composer install" || echo "${red}Please execute 'make run' first${reset}"
@docker exec -u root -it opensupports-db bash -c "service mysql start; mysql -u root -e \"CREATE DATABASE IF NOT EXISTS development;\" " || echo "${red}Please execute 'make run' first${reset}"
@docker exec -u root -it opensupports-db bash -c "mysql -u root -e \"CREATE DATABASE IF NOT EXISTS development;\" " || echo "${red}Please execute 'make run' first${reset}"
install-not-interactive:
@docker exec opensupports-srv bash -c "cd /var/www/html && composer install" || echo "${red}Please execute 'make run' first${reset}"
@docker exec -u root opensupports-db bash -c "service mysql start; mysql -u root -e \"CREATE DATABASE IF NOT EXISTS development;\" " || echo "${red}Please execute 'make run' first${reset}"
docker exec opensupports-srv bash -c "cd /var/www/html && composer install" || echo "${red}Please execute 'make run' first${reset}"
setup-vendor-permissions:
@docker exec opensupports-srv bash -c "cd /var/www/html && chmod 777 -R vendor/ezyang" || echo "${red}Please execute 'make run' first${reset}"
@docker exec opensupports-srv bash -c "cd /var/www/html && chmod 777 -R files" || echo "${red}Please execute 'make run' first${reset}"
run: stop
@docker run --platform=linux/amd64 -d --network os-net --name opensupports-db -p 4040:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -v $(PWD)/.dbdata/:/var/lib/mysql mysql:5.6
@docker run --platform=linux/amd64 -d --network os-net --name opensupports-db -p 4040:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -v $(PWD)/.dbdata/:/var/lib/mysql -v $(PWD)/.start-db:/docker-entrypoint-initdb.d mysql:5.6
@docker run --platform=linux/amd64 -d --network os-net --name opensupports-myadmin --link opensupports-db:db -p 6060:80 phpmyadmin/phpmyadmin
@docker run --platform=linux/amd64 -d --network os-net --name opensupports-fakesmtp -p 7070:25 -v ${PWD}/.fakemail/:/var/mail munkyboy/fakesmtp
@docker run --platform=linux/amd64 -d --network os-net --name opensupports-srv -p 8080:80 --link opensupports-db:mysql --rm -e LOG_STDOUT=true -e LOG_STDERR=true -e LOG_LEVEL=debug -v ${PWD}:/var/www/html opensupports-srv

View File

@ -1,6 +1,5 @@
#!/bin/bash
# DELETE ALL TABLES
service mysql start;
TABLES=$(mysql --host ${MYSQL_HOST} --port ${MYSQL_PORT} -u root development -e "SHOW TABLES IN development;" | awk '{ print $1}' | grep -v '^Tables')
for t in $TABLES