Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
deploy:
provider: bintray
file: .travis.deploy.json
user: asbin
user: $BINTRAY_USER
key: $BINTRAY_APIKEY

- stage: Deploy
Expand All @@ -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
Binary file modified .travis.yml.sig
Binary file not shown.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 $<
Expand Down
6 changes: 3 additions & 3 deletions scripts/tests/.travis.deploy.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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": [
Expand Down
18 changes: 18 additions & 0 deletions scripts/tests/fix-bintray.sh
Original file line number Diff line number Diff line change
@@ -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)"