@@ -512,36 +512,44 @@ deploy-bin: $(DS_BIN)
512
512
$(DS_BIN_REPO ) \
513
513
s3://$(S3_BUCKET ) /$(PLATFORM ) /ds-bin/$(GIT_BRANCH ) /$(PRODUCT_VERSION ) /
514
514
515
+ comma := ,
516
+ json_edit = cp -f $(1 ) $(1 ) .tmp; jq $(2 ) $(1 ) .tmp > $(1 ) ; rm -f $(1 ) .tmp
517
+
515
518
$(DEPLOY_JSON ) :
516
519
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 ) \
520
523
build: " $( BUILD_NUMBER) " \
521
- } ' $@) > $@
524
+ } ' )
522
525
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
+ }]')
527
531
endif
528
532
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
+ }]')
545
553
endif
546
554
547
555
deploy : $(DEPLOY ) $(DEPLOY_JSON )
0 commit comments