wip: improving docker/downloader
This commit is contained in:
parent
194cd95de2
commit
0eff53c136
|
@ -2,3 +2,6 @@
|
|||
*.tar.gz
|
||||
wordpress/
|
||||
deploy/staging/env
|
||||
scripts/cv
|
||||
scripts/wp
|
||||
scripts/civix
|
||||
|
|
14
Dockerfile
14
Dockerfile
|
@ -12,19 +12,9 @@ RUN apt-get update \
|
|||
USER root
|
||||
RUN docker-php-ext-install intl pdo_mysql
|
||||
|
||||
ADD https://download.civicrm.org/cv/cv.phar /usr/local/bin/cv
|
||||
ADD https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar /usr/local/bin/wp
|
||||
RUN chmod a+rx /usr/local/bin/cv /usr/local/bin/wp
|
||||
COPY --chmod=750 --chown=root:www-data --link scripts/* /usr/local/bin/
|
||||
ADD --link wordpress/wp-content/* /var/www/civi/wp-content/
|
||||
|
||||
WORKDIR /var/www/civi/
|
||||
|
||||
COPY bin/*.sh /usr/local/bin/
|
||||
RUN chmod a+rx /usr/local/bin/*.sh
|
||||
|
||||
RUN download.sh
|
||||
|
||||
|
||||
RUN chown www-data /var/www/civi/ /var/www/civi/wp-content/uploads/
|
||||
RUN find /var/www/ -type d |xargs chmod 755
|
||||
|
||||
USER www-data
|
||||
|
|
14
Makefile
14
Makefile
|
@ -12,9 +12,21 @@ clean:
|
|||
start:
|
||||
${COMPOSE} up -d
|
||||
|
||||
build:
|
||||
build: downloads
|
||||
bash ./image.sh build
|
||||
|
||||
downloads: scripts/cv scripts/civix scripts/wp
|
||||
scripts/download.sh
|
||||
|
||||
scripts/cv:
|
||||
curl -LsS --output scripts/cv https://download.civicrm.org/cv/cv.phar
|
||||
|
||||
scripts/wp:
|
||||
curl -LsS --output scripts/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
|
||||
|
||||
scripts/civix:
|
||||
curl -LsS --output scripts/civix https://download.civicrm.org/civix/civix.phar
|
||||
|
||||
build-dev: build
|
||||
|
||||
reset-db:
|
||||
|
|
|
@ -1,45 +1,62 @@
|
|||
#!/bin/bash
|
||||
set -xe
|
||||
set -e
|
||||
|
||||
version=5.48.0
|
||||
|
||||
TMP_DIR=${TMP_DIR:-$PWD/tmp/}
|
||||
WP_BASE=${1:-$PWD/wordpress/}
|
||||
|
||||
function download_ext {
|
||||
# work-around for timeout issues on lab.civicrm.org during download
|
||||
echo "download_ext $@"
|
||||
name="$1"
|
||||
url="$2"
|
||||
|
||||
filename=$(mktemp)
|
||||
if [ -d "$name" ]; then
|
||||
echo "skip $name"
|
||||
return
|
||||
fi
|
||||
|
||||
filename=${TMP_DIR}$(basename $url)
|
||||
|
||||
if [ ! -e $filename ]; then
|
||||
echo "download_ext $filename $@"
|
||||
curl -L --output $filename $url
|
||||
fi
|
||||
|
||||
filetype=$(file --brief --mime $filename|cut -f1 -d';'|cut -f2 -d/)
|
||||
case $filetype in
|
||||
zip)
|
||||
unzip -q $filename
|
||||
;;
|
||||
gzip)
|
||||
tar xf $filename
|
||||
;;
|
||||
esac
|
||||
|
||||
dirname=$(find -maxdepth 1 -name "${name}*" -type d)
|
||||
[ -z "$dirname" ] && return
|
||||
dirname=$(basename $dirname)
|
||||
|
||||
[ "$dirname" = "$name" ] || mv -v $dirname $name
|
||||
}
|
||||
|
||||
mkdir -p $TMP_DIR
|
||||
mkdir -p ${WP_BASE}/wp-content/plugins
|
||||
mkdir -p ${WP_BASE}/wp-content/uploads/civicrm/ext
|
||||
|
||||
mkdir -p /var/www/civi/wp-content/plugins && cd /var/www/civi/wp-content/plugins
|
||||
curl -L -o /tmp/civi.zip https://download.civicrm.org/civicrm-$version-wordpress.zip
|
||||
unzip /tmp/civi.zip -d .
|
||||
|
||||
curl -L -o /tmp/l10n.tar.gz https://download.civicrm.org/civicrm-$version-l10n.tar.gz
|
||||
tar -xf /tmp/l10n.tar.gz -C ./civicrm
|
||||
|
||||
curl -LsS https://download.civicrm.org/civix/civix.phar -o /usr/local/bin/civix
|
||||
chmod +x /usr/local/bin/civix
|
||||
|
||||
mkdir -p /var/www/civi/wp-content/uploads/civicrm/ext && cd /var/www/civi/wp-content/uploads/civicrm/ext
|
||||
|
||||
# clone BIJ1 specific extensions
|
||||
git config --global pull.ff only
|
||||
# git clone --depth 1 https://code.bij1.org/bij1/crm-bij1migratie.git
|
||||
# git clone --depth 1 https://code.bij1.org/bij1/crm-bij1rules.git
|
||||
# git clone --depth 1 https://code.bij1.org/bij1/crm-bij1algemeen.git
|
||||
git clone --depth 1 https://lab.civicrm.org/partners/civicoop/bij1/bij1migratie.git
|
||||
git clone --depth 1 https://lab.civicrm.org/partners/civicoop/bij1/bij1rules.git
|
||||
git clone --depth 1 https://lab.civicrm.org/partners/civicoop/bij1/bij1algemeen.git
|
||||
# download all extensions
|
||||
cd $WP_BASE/wp-content/plugins
|
||||
download_ext civicrm https://download.civicrm.org/civicrm-$version-wordpress.zip
|
||||
|
||||
cd $WP_BASE/wp-content/plugins/civicrm
|
||||
download_ext l10n https://download.civicrm.org/civicrm-$version-l10n.tar.gz
|
||||
|
||||
cd ${WP_BASE}/wp-content/uploads/civicrm/ext
|
||||
for repo in bij1migratie bij1rules bij1algemeen; do
|
||||
[ -e crm-${repo} ] || git clone --depth 1 https://code.bij1.org/bij1/crm-${repo}.git
|
||||
done
|
||||
|
||||
download_ext de.systopia.identitytracker https://github.com/systopia/de.systopia.identitytracker/releases/download/1.3/de.systopia.identitytracker-1.3.zip
|
||||
download_ext org.project60.banking https://github.com/Project60/org.project60.banking/releases/download/0.7/org.project60.banking-0.7.zip
|
Loading…
Reference in New Issue