Go to file
Paul J Stevens 3cd4fb83a5 wip 2022-10-16 17:14:12 +02:00
data update sample csv 2022-06-13 18:04:32 +02:00
deploy/staging fix: ensure mysql connections can work 2022-06-06 14:28:08 +02:00
nginx nginx: fix upload limit 2022-10-12 12:38:00 +02:00
wp wip 2022-10-16 17:14:12 +02:00
.env reproduce locally 2022-10-07 20:54:08 +02:00
.gitignore ignore archives 2022-06-13 16:46:52 +02:00
.gitlab-ci.yml ci: only build on main 2022-06-05 15:08:02 +02:00
Makefile wip 2022-10-16 17:14:12 +02:00
README.md document requirement: docker compose 2022-10-16 11:33:09 +02:00
docker-compose.yml wip 2022-10-16 17:14:12 +02:00
image.sh wip 2022-10-16 17:14:12 +02:00
transip-debian.sh civi installed 2021-11-07 23:28:58 +01:00

README.md

BIJ1 CiviCRM

Requirements

Usage

download

version=5.53.0
plugins=./wordpress/wp-content/plugins/
mkdir -p $plugins
wget -O $plugins/civi.zip https://download.civicrm.org/civicrm-$version-wordpress.zip
wget -O $plugins/civi-l10n.tar.gz https://download.civicrm.org/civicrm-$version-l10n.tar.gz
unzip ./$plugins/civi.zip -d $plugins
tar -xf ./$plugins/civi-l10n.tar.gz -C $plugins/civicrm

run

make start
sleep 2  # give the containers time to spin up
make install
# http://localhost/wp-admin/admin.php?page=CiviCRM
# civi
# password123

deploy

docker swarm init
docker stack deploy -c ./deploy/staging/stack.yml civi
docker stack ps civi
docker stack rm civi

back up db

DB=exampledb
USER=exampleuser
PW=examplepass
DBHOST=127.0.0.1
mkdir -p sql
# we'll back up civicrm tables containing settings, not tables containing user data, credentials or ephemeral stuff
# make sure to use bash as zsh bugs out on this list variable assignment
# handling skipped tables here rather than in .gitignore so that sensitive data wouldn't even get downloaded
tables=`mysqlshow -h $DBHOST -u $USER --password="$PW" $DB | tail -n +5 | grep --only-matching --extended-regexp 'civicrm_[_a-z]+' | grep -v '_cache' | grep -v 'log_civicrm_' | grep -v '_log' | grep -v '_contact\>' | grep -v '_address\>' | grep -v '_cxn' | grep -v '_mailing_event' | grep -v '_pledge' | grep -v '_trxn' | grep -v '_contribution\>' | grep -v '_contribution_recur' | grep -v '_contribution_soft' | grep -v '_discount' | grep -v '_domain' | grep -v '_email' | grep -v '_entity_batch' | grep -v '_email' | grep -v '_entity_batch' | grep -v '_entity_file' | grep -v '_entity_financial_account' | grep -v '_entity_financial_trxn' | grep -v '_entity_tag' | grep -v '_financial_account' | grep -v '_financial_item' | grep -v '_grant' | grep -v '_group_organization' | grep -v '_im' | grep -v '_line_item' | grep -v '_loc_block' | grep -v '_mail_settings' | grep -v '_mailing_job' | grep -v '_mailing_recipients' | grep -v '_mailing_spool' | grep -v '_membership\>' | grep -v '_membership_payment' | grep -v '_note' | grep -v '_openid' | grep -v '_participant\>' | grep -v '_participant_payment' | grep -v '_payment_processor\>' | grep -v '_payment_token' | grep -v '_pcp' | grep -v '_phone' | grep -v '_relationship\>' | grep -v '_saved_search' | grep -v '_sms_provider' | grep -v '_subscription_history' | grep -v '_uf_match'`
for tbl in $tables; do mysqldump --column-statistics=0 -h $DBHOST -u $USER --password="$PW" $DB $tbl 2>/dev/null | head -n -2 > ./sql/$tbl.sql; done

restoring a db backup

for file in `ls -d sql/*`; do mysql -h $DBHOST -u $USER --password="$PW" $DB < $file; done