diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 37 |
1 files changed, 35 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | # Shaarli, the personal, minimalist, super-fast, no-database delicious clone. | 1 | # The personal, minimalist, super-fast, database free, bookmarking service. |
2 | # Makefile for PHP code analysis & testing | 2 | # Makefile for PHP code analysis & testing, documentation and release generation |
3 | 3 | ||
4 | # Prerequisites: | 4 | # Prerequisites: |
5 | # - install Composer, either: | 5 | # - install Composer, either: |
@@ -128,6 +128,39 @@ test: | |||
128 | @$(BIN)/phpunit tests | 128 | @$(BIN)/phpunit tests |
129 | 129 | ||
130 | ## | 130 | ## |
131 | # Custom release archive generation | ||
132 | # | ||
133 | # For each tagged revision, GitHub provides tar and zip archives that correspond | ||
134 | # to the output of git-archive | ||
135 | # | ||
136 | # These targets produce similar archives, featuring 3rd-party dependencies | ||
137 | # to ease deployment on shared hosting. | ||
138 | ## | ||
139 | ARCHIVE_VERSION := shaarli-$$(git describe)-full | ||
140 | ARCHIVE_PREFIX=Shaarli/ | ||
141 | |||
142 | release_archive: release_tar release_zip | ||
143 | |||
144 | ### download 3rd-party PHP libraries | ||
145 | composer_dependencies: clean | ||
146 | composer update --no-dev | ||
147 | find vendor/ -name ".git" -type d -exec rm -rf {} + | ||
148 | |||
149 | ### generate a release tarball and include 3rd-party dependencies | ||
150 | release_tar: composer_dependencies | ||
151 | git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).tar HEAD | ||
152 | tar rvf $(ARCHIVE_VERSION).tar --transform "s|^vendor|$(ARCHIVE_PREFIX)vendor|" vendor/ | ||
153 | gzip $(ARCHIVE_VERSION).tar | ||
154 | |||
155 | ### generate a release zip and include 3rd-party dependencies | ||
156 | release_zip: composer_dependencies | ||
157 | git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).zip -9 HEAD | ||
158 | mkdir $(ARCHIVE_PREFIX) | ||
159 | rsync -a vendor/ $(ARCHIVE_PREFIX)vendor/ | ||
160 | zip -r $(ARCHIVE_VERSION).zip $(ARCHIVE_PREFIX)vendor/ | ||
161 | rm -rf $(ARCHIVE_PREFIX) | ||
162 | |||
163 | ## | ||
131 | # Targets for repository and documentation maintenance | 164 | # Targets for repository and documentation maintenance |
132 | ## | 165 | ## |
133 | 166 | ||