Skip to content

Commit

Permalink
fix makefile (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria authored May 11, 2020
1 parent 818584c commit cda45c2
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ yarn-error.log
public/dist/user.css
aliases

Lychee-v*
Lychee/*
.phpunit*
_ide*

Expand Down
20 changes: 3 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,9 @@ addons:
- php-gd

before_script:
- echo ${TRAVIS_COMPOSER_DEV}
- echo ${SQL}
- printf "\n" | pecl install imagick
# Install ExifTool
- sh -c "if [ '$EXIFTOOL' = 'yes' ] ; then wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-11.77.tar.gz ; fi"
- sh -c "if [ '$EXIFTOOL' = 'yes' ] ; then tar -zxvf Image-ExifTool-11.77.tar.gz ; fi"
- sh -c "if [ '$EXIFTOOL' = 'yes' ] ; then cd Image-ExifTool-11.77 && perl Makefile.PL && make test && sudo make install ; fi"
- sh -c "if [ '$EXIFTOOL' = 'yes' ] ; then cd .. && rm -rf Image-ExifTool-11.77 ; fi"
- sh -c "if [ '$EXIFTOOL' = 'yes' ] ; then bash setup_exiftool.sh ; fi"
# create db for mariadb
- sh -c "if [ '$SQL' = 'mariadb' ] ; then mysql -e 'create database homestead_test;' ; fi"
# create db for postgresql
Expand All @@ -62,19 +57,10 @@ before_script:
- sh -c "if [ '$SQL' = 'sqlite' ] ; then touch database/database.sqlite ; fi"
# composer stuff
- composer self-update
- sh -c "if [ '$TRAVIS_COMPOSER_DEV' = 'yes' ] ; then composer install --no-interaction ; fi"
- sh -c "if [ '$TRAVIS_COMPOSER_DEV' = 'no' ] ; then composer install --no-interaction --no-dev ; fi"
- sh -c "if [ '$TRAVIS_COMPOSER_DEV' = 'no' ] ; then find vendor -wholename '*/[Tt]ests/*' -delete ; fi"
- sh -c "if [ '$TRAVIS_COMPOSER_DEV' = 'no' ] ; then find vendor -wholename '*/[Tt]est/*' -delete ; fi"


script:
- sh -c "if [ '$TRAVIS_COMPOSER_DEV' = 'yes' ] ; then vendor/bin/php-cs-fixer fix --config=.php_cs --verbose --diff --dry-run ; fi"
- cp .env.${SQL}.travis .env
- php artisan key:generate
- php artisan migrate
- sh -c "if [ '$TRAVIS_COMPOSER_DEV' = 'yes' ] ; then vendor/bin/phpunit --verbose; fi"
- php artisan migrate:rollback
- sh -c "if [ '$TRAVIS_COMPOSER_DEV' = 'yes' ] ; then bash test_dev.sh ; fi"
- sh -c "if [ '$TRAVIS_COMPOSER_DEV' = 'no' ] ; then bash test_dist.sh ; fi"

after_success:
- bash codecov.sh
Expand Down
124 changes: 62 additions & 62 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
VERSION=`cat version.md`
FILES=$(wildcard *)

.PHONY: dist clean
.PHONY: dist-gen dist-clean dist clean

composer:
rm -r vendor
rm -r vendor 2> /dev/null || true
composer install --prefer-dist --no-dev

dist-gen: clean composer
@echo "packaging..."
@mkdir Lychee-v$(VERSION)
@mkdir Lychee-v$(VERSION)/public
@mkdir Lychee-v$(VERSION)/public/dist
@mkdir Lychee-v$(VERSION)/public/img
@mkdir Lychee-v$(VERSION)/public/uploads
@mkdir Lychee-v$(VERSION)/public/uploads/small
@mkdir Lychee-v$(VERSION)/public/uploads/medium
@mkdir Lychee-v$(VERSION)/public/uploads/big
@mkdir Lychee-v$(VERSION)/public/uploads/thumb
@mkdir Lychee-v$(VERSION)/public/uploads/raw
@mkdir Lychee-v$(VERSION)/public/uploads/import
@mkdir Lychee-v$(VERSION)/public/sym
@cp -r public/dist Lychee-v$(VERSION)/public
@cp -r public/installer Lychee-v$(VERSION)/public
@cp -r public/img/* Lychee-v$(VERSION)/public/img
@cp -r app Lychee-v$(VERSION)
@cp -r bootstrap Lychee-v$(VERSION)
@cp -r config Lychee-v$(VERSION)
@cp -r database Lychee-v$(VERSION)
@cp -r resources Lychee-v$(VERSION)
@cp -r index.html Lychee-v$(VERSION)
@cp -r routes Lychee-v$(VERSION)
@cp -r storage Lychee-v$(VERSION)
@cp -r vendor Lychee-v$(VERSION) 2> /dev/null || true
@cp -r public/.htaccess Lychee-v$(VERSION)/public
@cp -r public/.user.ini Lychee-v$(VERSION)/public
@cp -r public/favicon.ico Lychee-v$(VERSION)/public
@cp -r public/index.php Lychee-v$(VERSION)/public
@cp -r public/robots.txt Lychee-v$(VERSION)/public
@cp -r public/web.config Lychee-v$(VERSION)/public
@cp -r .env.example Lychee-v$(VERSION)
@cp -r artisan Lychee-v$(VERSION)
@cp -r composer.json Lychee-v$(VERSION)
@cp -r composer.lock Lychee-v$(VERSION)
@cp -r composer-cache Lychee-v$(VERSION)
@cp -r LICENSE Lychee-v$(VERSION)
@cp -r readme.md Lychee-v$(VERSION)
@cp -r server.php Lychee-v$(VERSION)
@cp -r version.md Lychee-v$(VERSION)
@touch Lychee-v$(VERSION)/storage/logs/laravel.log
@touch Lychee-v$(VERSION)/public/dist/user.css
@touch Lychee-v$(VERSION)/public/uploads/big/index.html
@touch Lychee-v$(VERSION)/public/uploads/small/index.html
@touch Lychee-v$(VERSION)/public/uploads/medium/index.html
@touch Lychee-v$(VERSION)/public/uploads/thumb/index.html
@touch Lychee-v$(VERSION)/public/uploads/raw/index.html
@touch Lychee-v$(VERSION)/public/uploads/import/index.html
@touch Lychee-v$(VERSION)/public/sym/index.html
@mkdir Lychee
@mkdir Lychee/public
@mkdir Lychee/public/dist
@mkdir Lychee/public/img
@mkdir Lychee/public/uploads
@mkdir Lychee/public/uploads/small
@mkdir Lychee/public/uploads/medium
@mkdir Lychee/public/uploads/big
@mkdir Lychee/public/uploads/thumb
@mkdir Lychee/public/uploads/raw
@mkdir Lychee/public/uploads/import
@mkdir Lychee/public/sym
@cp -r public/dist Lychee/public
@cp -r public/installer Lychee/public
@cp -r public/img/* Lychee/public/img
@cp -r app Lychee
@cp -r bootstrap Lychee
@cp -r config Lychee
@cp -r database Lychee
@cp -r resources Lychee
@cp -r index.php Lychee
@cp -r simple_error_template.html Lychee
@cp -r routes Lychee
@cp -r storage Lychee
@cp -r vendor Lychee 2> /dev/null || true
@cp -r public/.htaccess Lychee/public
@cp -r public/.user.ini Lychee/public
@cp -r public/favicon.ico Lychee/public
@cp -r public/index.php Lychee/public
@cp -r public/robots.txt Lychee/public
@cp -r public/web.config Lychee/public
@cp -r .env.example Lychee
@cp -r artisan Lychee
@cp -r composer.json Lychee
@cp -r composer.lock Lychee
@cp -r composer-cache Lychee
@cp -r LICENSE Lychee
@cp -r readme.md Lychee
@cp -r server.php Lychee
@cp -r version.md Lychee
@touch Lychee/storage/logs/laravel.log
@touch Lychee/public/dist/user.css
@touch Lychee/public/uploads/big/index.html
@touch Lychee/public/uploads/small/index.html
@touch Lychee/public/uploads/medium/index.html
@touch Lychee/public/uploads/thumb/index.html
@touch Lychee/public/uploads/raw/index.html
@touch Lychee/public/uploads/import/index.html
@touch Lychee/public/sym/index.html

dist-clean: dist-gen
find Lychee -wholename '*/[Tt]ests/*' -delete
find Lychee -wholename '*/[Tt]est/*' -delete
@rm -r Lychee/storage/framework/cache/data/* 2> /dev/null || true
@rm Lychee/storage/framework/sessions/* 2> /dev/null || true
@rm Lychee/storage/framework/views/* 2> /dev/null || true
@rm Lychee/storage/logs/* 2> /dev/null || true

dist: dist-gen
find Lychee-v$(VERSION) -wholename '*/[Tt]ests/*' -delete
find Lychee-v$(VERSION) -wholename '*/[Tt]est/*' -delete
@rm -r Lychee-v$(VERSION)/storage/framework/cache/data/* 2> /dev/null || true
@rm Lychee-v$(VERSION)/storage/framework/sessions/* 2> /dev/null || true
@rm Lychee-v$(VERSION)/storage/framework/views/* 2> /dev/null || true
@rm Lychee-v$(VERSION)/storage/logs/* 2> /dev/null || true
@zip -r Lychee-v$(VERSION).zip Lychee-v$(VERSION)
dist: dist-clean
@zip -r Lychee.zip Lychee

contrib_add:
@echo "npx all-contributors-cli add <user> <bug|code|design|doc|question|tool|test|translation>"
Expand All @@ -77,7 +77,7 @@ contrib_check:
npx all-contributors-cli check

clean:
@rm -r Lychee-v* 2> /dev/null || true
@rm -r Lychee 2> /dev/null || true

test:
@if [ -x "vendor/bin/phpunit" ]; then \
Expand Down
10 changes: 10 additions & 0 deletions setup_exiftool.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-11.77.tar.gz
tar -zxvf Image-ExifTool-11.77.tar.gz
cd Image-ExifTool-11.77
perl Makefile.PL
make test
sudo make install
cd ..
rm -rf Image-ExifTool-11.77
9 changes: 9 additions & 0 deletions test_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

composer install --prefer-dist --no-interaction
cp .env.${SQL}.travis .env
vendor/bin/php-cs-fixer fix --config=.php_cs --verbose --diff --dry-run
php artisan key:generate
php artisan migrate
vendor/bin/phpunit --verbose
php artisan migrate:rollback
8 changes: 8 additions & 0 deletions test_dist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

make dist-clean
cd Lychee
cp ../.env.${SQL}.travis .env
php artisan key:generate
php artisan migrate
php artisan migrate:rollback

0 comments on commit cda45c2

Please sign in to comment.