Skip to content

Commit

Permalink
Merge pull request #11 from dataiku/feature/dss12-sc-134006-change-th…
Browse files Browse the repository at this point in the history
…e-zip-command-to-build-the-plugin

sc-134006 use dev target and minor tweaks
  • Loading branch information
liamlynch-data committed May 22, 2023
2 parents 47a46c6 + f3aec1c commit a8db285
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,28 @@ archive_file_name="dss-plugin-${plugin_id}-${plugin_version}.zip"
remote_url=`git config --get remote.origin.url`
last_commit_id=`git rev-parse HEAD`

.DEFAULT_GOAL := plugin

plugin:
plugin: dist-clean
@echo "[START] Archiving plugin to dist/ folder..."
@cat plugin.json | json_pp > /dev/null
@rm -rf dist
@mkdir dist
@echo "{\"remote_url\":\"${remote_url}\",\"last_commit_id\":\"${last_commit_id}\"}" > release_info.json
@git archive -v -9 --format zip -o dist/${archive_file_name} HEAD
@zip --delete dist/${archive_file_name} "tests/*"
@if [[ -d tests ]]; then \
zip --delete dist/${archive_file_name} "tests/*"; \
fi
@zip -u dist/${archive_file_name} release_info.json
@rm release_info.json
@echo "[SUCCESS] Archiving plugin to dist/ folder: Done!"

dev: dist-clean
@echo "[START] Archiving plugin to dist/ folder... (dev mode)"
@cat plugin.json | json_pp > /dev/null
@mkdir dist
@zip -v -9 dist/${archive_file_name} -r . --exclude "tests/*" "env/*" ".git/*" ".pytest_cache/*"
@echo "[SUCCESS] Archiving plugin to dist/ folder: Done!"

unit-tests:
@echo "Running unit tests..."
@( \
Expand Down Expand Up @@ -50,4 +59,4 @@ integration-tests:
tests: unit-tests integration-tests

dist-clean:
rm -rf dist
rm -rf dist

0 comments on commit a8db285

Please sign in to comment.