wallabag/Makefile

62 lines
2.2 KiB
Makefile
Raw Normal View History

2016-10-09 18:21:02 +00:00
TMP_FOLDER=/tmp
RELEASE_FOLDER=wllbg-release
SSH_USER=framasoft_bag
SSH_HOST=78.46.248.87
SSH_PATH=/var/www/framabag.org/web
2016-10-09 19:06:26 +00:00
ENV=prod
2016-10-09 19:15:57 +00:00
help: ## Display this help menu
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
2016-10-09 18:21:02 +00:00
2016-10-09 19:15:57 +00:00
clean: ## Clear the application cache
2016-10-09 19:06:26 +00:00
@rm -rf var/cache/*
2016-10-09 19:15:57 +00:00
install: ## Install wallabag with the latest version
2016-10-09 18:21:02 +00:00
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
@git checkout $(TAG)
2016-10-09 19:06:26 +00:00
@SYMFONY_ENV=$(ENV) composer install --no-dev -o --prefer-dist
@php bin/console wallabag:install --env=$(ENV)
2016-10-09 18:21:02 +00:00
2016-10-09 19:15:57 +00:00
update: ## Update the wallabag installation to the latest version
2016-10-09 19:06:26 +00:00
@rm -rf var/cache/*
@git fetch origin
@git fetch --tags
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
@git checkout $(TAG)
@SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
@php bin/console cache:clear --env=prod
2016-10-09 19:15:57 +00:00
run: ## Run the wallabag server
2016-10-09 19:06:26 +00:00
php bin/console server:run --env=$(ENV)
2016-10-09 18:21:02 +00:00
2016-10-09 19:15:57 +00:00
build: ## Run grunt
2016-10-09 19:06:26 +00:00
@grunt
2016-10-09 18:21:02 +00:00
2016-10-09 19:15:57 +00:00
test: ## Launch wallabag testsuite
2016-10-09 19:06:26 +00:00
@ant prepare && phpunit -v
2016-10-09 18:21:02 +00:00
2016-10-09 19:15:57 +00:00
release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`).
ifndef VERSION
$(error VERSION is not set)
endif
2016-10-09 18:21:02 +00:00
version=$(VERSION)
2016-10-09 19:06:26 +00:00
@rm -rf $(TMP_FOLDER)/$(RELEASE_FOLDER)
@mkdir $(TMP_FOLDER)/$(RELEASE_FOLDER)
2016-10-09 18:21:02 +00:00
@git clone git@github.com:wallabag/wallabag.git -b $(VERSION) $(TMP_FOLDER)/$(RELEASE_FOLDER)/$(VERSION)
2016-10-09 19:06:26 +00:00
@cd $(TMP_FOLDER)/$(RELEASE_FOLDER)/$(VERSION) && SYMFONY_ENV=$(ENV) composer up -n --no-dev
@cd $(TMP_FOLDER)/$(RELEASE_FOLDER)/$(VERSION) && php bin/console wallabag:install --env=$(ENV)
@cd $(TMP_FOLDER)/$(RELEASE_FOLDER) && tar czf wallabag-$(VERSION).tar.gz --exclude="var/cache/*" --exclude="var/logs/*" --exclude="var/sessions/*" --exclude=".git" $(VERSION)
2016-10-09 18:21:02 +00:00
@echo "MD5 checksum of the package for wallabag $(VERSION)"
@md5 $(TMP_FOLDER)/$(RELEASE_FOLDER)/wallabag-$(VERSION).tar.gz
2016-10-09 19:06:26 +00:00
@scp $(TMP_FOLDER)/$(RELEASE_FOLDER)/wallabag-$(VERSION).tar.gz $(SSH_USER)@$(SSH_HOST):$(SSH_PATH)
@rm -rf $(TMP_FOLDER)/$(RELEASE_FOLDER)
2016-10-09 18:21:02 +00:00
2016-10-09 19:15:57 +00:00
travis: ## Make some stuff for Travis-CI
2016-10-09 19:06:26 +00:00
2016-10-09 19:15:57 +00:00
deploy: ## Deploy wallabag
2016-10-09 19:06:26 +00:00
@bundle exec cap staging deploy
.PHONY: help clean install update build test release travis deploy