Skip to content

Commit 26d11cc

Browse files
committed
update makefile
1 parent c1c0e51 commit 26d11cc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,16 @@ deb: source_for_deb ## Packaging for DEB
175175

176176
packagecloud: ## Upload archives to PackageCloud
177177
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Releasing for PackageCloud$(RESET)"
178-
curl -X POST \
178+
@HTTP_CODE=$$(curl -s -o /dev/null -w "%{http_code}" -X POST \
179179
-F "package[distro_version_id]=$(shell misc/packagecloud.sh $(DIST_ID) $(DIST_CODENAME))" \
180180
-F "package[package_file]=@builds/$(shell find ./builds -maxdepth 1 -name "*.deb" | head -1 | awk -F '/' '{print $$3}' ORS='')" \
181181
-H "Authorization: Bearer $(PACKAGECLOUD_TOKEN)" \
182-
https://packagecloud.io/api/v1/repos/linyows/octopass/packages.json
182+
https://packagecloud.io/api/v1/repos/linyows/octopass/packages.json); \
183+
if [ "$$HTTP_CODE" -ne 201 ]; then \
184+
echo "Upload failed with HTTP status: $$HTTP_CODE"; \
185+
exit 1; \
186+
fi
187+
@echo "Upload successful with HTTP status: $$HTTP_CODE"
183188

184189
pkg: clean ## Create some distribution packages
185190
docker-compose up

0 commit comments

Comments
 (0)