Skip to content
Snippets Groups Projects
build.sh 1.04 KiB
Newer Older
Ryan Smith's avatar
Ryan Smith committed
#!/usr/bin/env sh

Ryan Smith's avatar
Ryan Smith committed
# Creates a folder to zip.
Ryan Smith's avatar
Ryan Smith committed
rm -f xapi.zip
Ryan Smith's avatar
Ryan Smith committed
php -r "readfile('https://getcomposer.org/installer');" | php
php composer.phar install --no-interaction --no-dev
Ryan Smith's avatar
Ryan Smith committed
cp -r . ../moodle_logstore_build
Ryan Smith's avatar
Ryan Smith committed

# Removes unused files and folders.
find ../moodle_logstore_build -type d -name 'tests' | xargs rm -rf
find ../moodle_logstore_build -type d -name 'docs' | xargs rm -rf
find ../moodle_logstore_build -type d -name '.git' | xargs rm -rf
find ../moodle_logstore_build -type f -name '.gitignore' | xargs rm -rf
Ryan Smith's avatar
Ryan Smith committed
find ../moodle_logstore_build -type f -name 'composer.*' | xargs rm -rf
find ../moodle_logstore_build -type f -name 'phpunit.*' | xargs rm -rf
find ../moodle_logstore_build -type f -name '*.md' | xargs rm -rf
find ../moodle_logstore_build -type f -name 'node_modules' | xargs rm -rf
find ../moodle_logstore_build -type f -name 'package-lock.json' | xargs rm -rf
find ../moodle_logstore_build -type f -name 'package.json' | xargs rm -rf
Ryan Smith's avatar
Ryan Smith committed

# Creates the zip file.
Ryan Smith's avatar
Ryan Smith committed
mv ../moodle_logstore_build xapi
zip -r xapi.zip xapi -x "xapi/.git/**/*"
rm -rf xapi