diff --git a/.travis.yml b/.travis.yml index 5ab537503e8..b5754946675 100644 --- a/.travis.yml +++ b/.travis.yml @@ -143,7 +143,7 @@ jobs: deploy: provider: bintray file: .travis.deploy.json - user: asbin + user: $BINTRAY_USER key: $BINTRAY_APIKEY - stage: Deploy @@ -157,7 +157,7 @@ jobs: script: - make docker_build - - echo $BINTRAY_APIKEY | docker login -u asbin --password-stdin monicahq-docker-docker.bintray.io + - echo $BINTRAY_APIKEY | docker login -u $BINTRAY_USER --password-stdin monicahq-docker-docker.bintray.io - make docker_push_bintray after_script: skip diff --git a/.travis.yml.sig b/.travis.yml.sig index ed1b3f91d47..fc97166a359 100644 Binary files a/.travis.yml.sig and b/.travis.yml.sig differ diff --git a/Makefile b/Makefile index 15a128227be..e20b65b5b0b 100644 --- a/Makefile +++ b/Makefile @@ -37,9 +37,10 @@ docker_push: docker push monicahq/monicahq:$(GIT_TAG) docker push monicahq/monicahq:latest -docker_push_bintray: +docker_push_bintray: .travis.deploy.json docker tag monicahq/monicahq monicahq-docker-docker.bintray.io/monicahq/monicahq:$(BUILD) docker push monicahq-docker-docker.bintray.io/monicahq/monicahq:$(BUILD) + BUILD=$(BUILD) scripts/tests/fix-bintray.sh .PHONY: docker docker_build docker_tag docker_push docker_push_bintray @@ -107,11 +108,10 @@ COMMIT_MESSAGE := $(shell echo "$$TRAVIS_COMMIT_MESSAGE" | sed -s 's/"/\\\\\\\\\ cp $< $@ sed -si "s/\$$(version)/$(BUILD)/" $@ sed -si "s/\$$(description)/$(COMMIT_MESSAGE)/" $@ - sed -si "s/\$$(released)/$(shell date --iso-8601=date)/" $@ + sed -si "s/\$$(released)/$(shell date --iso-8601=s)/" $@ sed -si "s/\$$(travis_tag)/$(TRAVIS_TAG)/" $@ sed -si "s/\$$(travis_commit)/$(GIT_COMMIT)/" $@ sed -si "s/\$$(travis_build_number)/$(TRAVIS_BUILD_NUMBER)/" $@ - sed -si "s/\$$(date)/$(shell date --iso-8601=s)/" $@ results/%.tar.xz: % prepare tar chfJ $@ --exclude .gitignore --exclude .gitkeep $< diff --git a/scripts/tests/.travis.deploy.json.in b/scripts/tests/.travis.deploy.json.in index 9e18c9bb166..c5f92ae7907 100644 --- a/scripts/tests/.travis.deploy.json.in +++ b/scripts/tests/.travis.deploy.json.in @@ -4,7 +4,7 @@ "repo": "builds", "subject": "monicahq", "desc": "MonicaHQ, the Personal Relationship Manager", - "website_url": "www.monicahq.com", + "website_url": "https://www.monicahq.com", "issue_tracker_url": "https://github.com/monicahq/monica/issues", "vcs_url": "https://github.com/monicahq/monica.git", "github_use_tag_release_notes": true, @@ -20,10 +20,10 @@ "desc": "$(description)", "released": "$(released)", "vcs_tag": "$(travis_tag)", + "github_use_tag_release_notes": true, "attributes": [ {"name": "commit", "values" : ["$(travis_commit)"], "type": "string"}, - {"name": "build", "values" : ["$(travis_build_number)"], "type": "integer"}, - {"name": "date", "values" : ["$(date)"], "type": "date"} + {"name": "build", "values" : [$(travis_build_number)]} ] }, "files": [ diff --git a/scripts/tests/fix-bintray.sh b/scripts/tests/fix-bintray.sh new file mode 100644 index 00000000000..7a4d3ebdb80 --- /dev/null +++ b/scripts/tests/fix-bintray.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -v + +SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && /bin/pwd -P) +ROOT=$(realpath $SELF_PATH/../..) + +SLUG=${SLUG:-monicahq} +REPO=${REPO:-docker} +PACKAGE=${PACKAGE:-monicahq%3Amonicahq} + +curl -sS --user "${BINTRAY_USER}:${BINTRAY_APIKEY}" -H "Content-Type: application/json" \ + -X PATCH https://api.bintray.com/packages/${SLUG}/${REPO}/${PACKAGE}/versions/${BUILD} \ + -d "$(jq -r ".version" $ROOT/.travis.deploy.json)" + +curl -sS --user "${BINTRAY_USER}:${BINTRAY_APIKEY}" -H "Content-Type: application/json" \ + -X POST https://api.bintray.com/packages/${SLUG}/${REPO}/${PACKAGE}/versions/${BUILD}/attributes \ + -d "$(jq -r ".version.attributes" $ROOT/.travis.deploy.json)"