Merge pull request #5 from mattermost/fix_upload
fix the upload thru api
This commit is contained in:
commit
41037d02e1
1 changed files with 7 additions and 7 deletions
12
Makefile
12
Makefile
|
@ -76,13 +76,13 @@ dist: apply \
|
||||||
deploy: dist
|
deploy: dist
|
||||||
ifneq ($(and $(MM_SERVICESETTINGS_SITEURL),$(MM_ADMIN_USERNAME),$(MM_ADMIN_PASSWORD)),)
|
ifneq ($(and $(MM_SERVICESETTINGS_SITEURL),$(MM_ADMIN_USERNAME),$(MM_ADMIN_PASSWORD)),)
|
||||||
@echo "Installing plugin via API"
|
@echo "Installing plugin via API"
|
||||||
http --print b --check-status $(MM_SERVICESETTINGS_SITEURL)/api/v4/users/me || ( \
|
(TOKEN=`http --print h POST $(MM_SERVICESETTINGS_SITEURL)/api/v4/users/login login_id=$(MM_ADMIN_USERNAME) password=$(MM_ADMIN_PASSWORD) | grep Token | cut -f2 -d' '` && \
|
||||||
TOKEN=`http --print h POST $(MM_SERVICESETTINGS_SITEURL)/api/v4/users/login login_id=$(MM_ADMIN_USERNAME) password=$(MM_ADMIN_PASSWORD) | grep Token | cut -f2 -d' '` && \
|
http --print b GET $(MM_SERVICESETTINGS_SITEURL)/api/v4/users/me Authorization:"Bearer $$TOKEN" && \
|
||||||
http --print b GET $(MM_SERVICESETTINGS_SITEURL)/api/v4/users/me Authorization:"Bearer $$TOKEN" \
|
http --print b DELETE $(MM_SERVICESETTINGS_SITEURL)/api/v4/plugins/$(PLUGIN_ID) Authorization:"Bearer $$TOKEN" && \
|
||||||
|
http --print b --check-status --form POST $(MM_SERVICESETTINGS_SITEURL)/api/v4/plugins plugin@dist/$(PLUGIN_ID).tar.gz Authorization:"Bearer $$TOKEN" && \
|
||||||
|
http --print b POST $(MM_SERVICESETTINGS_SITEURL)/api/v4/plugins/$(PLUGIN_ID)/enable Authorization:"Bearer $$TOKEN" && \
|
||||||
|
http --print b POST $(MM_SERVICESETTINGS_SITEURL)/api/v4/users/logout Authorization:"Bearer $$TOKEN" \
|
||||||
)
|
)
|
||||||
http --print b DELETE $(MM_SERVICESETTINGS_SITEURL)/api/v4/plugins/$(PLUGIN_ID)
|
|
||||||
http --print b --check-status --form POST $(MM_SERVICESETTINGS_SITEURL)/api/v4/plugins plugin@dist/$(PLUGIN_ID).tar.gz && \
|
|
||||||
http --print b POST $(MM_SERVICESETTINGS_SITEURL)/api/v4/plugins/$(PLUGIN_ID)/enable
|
|
||||||
else ifneq ($(wildcard ../mattermost-server/.*),)
|
else ifneq ($(wildcard ../mattermost-server/.*),)
|
||||||
@echo "Installing plugin via filesystem. Server restart and manual plugin enabling required"
|
@echo "Installing plugin via filesystem. Server restart and manual plugin enabling required"
|
||||||
mkdir -p ../mattermost-server/plugins
|
mkdir -p ../mattermost-server/plugins
|
||||||
|
|
Reference in a new issue