Skip to content

Commit 081fbb5

Browse files
authored
Fix deploy.json (#152)
1 parent 23a65b1 commit 081fbb5

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

Makefile

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -512,36 +512,44 @@ deploy-bin: $(DS_BIN)
512512
$(DS_BIN_REPO) \
513513
s3://$(S3_BUCKET)/$(PLATFORM)/ds-bin/$(GIT_BRANCH)/$(PRODUCT_VERSION)/
514514

515+
comma := ,
516+
json_edit = cp -f $(1) $(1).tmp; jq $(2) $(1).tmp > $(1); rm -f $(1).tmp
517+
515518
$(DEPLOY_JSON):
516519
echo '{}' > $@
517-
cat <<< $$(jq '. + { \
518-
product: "$(PRODUCT_NAME_LOW)", \
519-
version: "$(PRODUCT_VERSION)", \
520+
$(call json_edit, $@, '. + { \
521+
product: "$(PRODUCT_NAME_LOW)"$(comma) \
522+
version: "$(PRODUCT_VERSION)"$(comma) \
520523
build: "$(BUILD_NUMBER)" \
521-
}' $@) > $@
524+
}')
522525
ifeq ($(PLATFORM), win)
523-
cat <<< $$(jq '.items += [{ \
524-
platform: "windows", \
525-
title: "Windows Server 2012 64-bit", \
526-
path: "$(EXE_URI)" }]' $@) > $@
526+
$(call json_edit, $@, '.items += [{ \
527+
platform: "windows"$(comma) \
528+
title: "Windows Server 2012 64-bit"$(comma) \
529+
path: "$(EXE_URI)" \
530+
}]')
527531
endif
528532
ifeq ($(PLATFORM), linux)
529-
cat <<< $$(jq '.items += [{ \
530-
platform: "ubuntu", \
531-
title: "Debian 8 9 10, Ubuntu 14 16 18 20 and derivatives", \
532-
path: "$(DEB_URI)" }]' $@) > $@
533-
cat <<< $$(jq '.items += [{ \
534-
platform: "centos", \
535-
title: "Centos 7, Redhat 7, Fedora latest and derivatives", \
536-
path: "$(RPM_URI)" }]' $@) > $@
537-
cat <<< $$(jq '.items += [{ \
538-
platform: "altlinux", \
539-
title: "Altlinux p8 p9", \
540-
path: "$(APT_RPM_URI)" }]' $@) > $@
541-
cat <<< $$(jq '.items += [{ \
542-
platform: "linux", \
543-
title: "Linux portable", \
544-
path: "$(TAR_URI)" }]' $@) > $@
533+
$(call json_edit, $@, '.items += [{ \
534+
platform: "ubuntu"$(comma) \
535+
title: "Debian 8 9 10$(comma) Ubuntu 14 16 18 20 and derivatives"$(comma) \
536+
path: "$(DEB_URI)" \
537+
}]')
538+
$(call json_edit, $@, '.items += [{ \
539+
platform: "centos"$(comma) \
540+
title: "Centos 7$(comma) Redhat 7$(comma) Fedora latest and derivatives"$(comma) \
541+
path: "$(RPM_URI)" \
542+
}]')
543+
$(call json_edit, $@, '.items += [{ \
544+
platform: "altlinux"$(comma) \
545+
title: "Altlinux p8 p9"$(comma) \
546+
path: "$(APT_RPM_URI)" \
547+
}]')
548+
$(call json_edit, $@, '.items += [{ \
549+
platform: "linux"$(comma) \
550+
title: "Linux portable"$(comma) \
551+
path: "$(TAR_URI)" \
552+
}]')
545553
endif
546554

547555
deploy: $(DEPLOY) $(DEPLOY_JSON)

0 commit comments

Comments
 (0)