Skip to content

Commit a3a07ae

Browse files
authored
Fix bintray tag set (#927)
1 parent 4464d83 commit a3a07ae

File tree

5 files changed

+26
-8
lines changed

5 files changed

+26
-8
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
deploy:
144144
provider: bintray
145145
file: .travis.deploy.json
146-
user: asbin
146+
user: $BINTRAY_USER
147147
key: $BINTRAY_APIKEY
148148

149149
- stage: Deploy
@@ -157,7 +157,7 @@ jobs:
157157

158158
script:
159159
- make docker_build
160-
- echo $BINTRAY_APIKEY | docker login -u asbin --password-stdin monicahq-docker-docker.bintray.io
160+
- echo $BINTRAY_APIKEY | docker login -u $BINTRAY_USER --password-stdin monicahq-docker-docker.bintray.io
161161
- make docker_push_bintray
162162

163163
after_script: skip

.travis.yml.sig

0 Bytes
Binary file not shown.

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ docker_push:
3737
docker push monicahq/monicahq:$(GIT_TAG)
3838
docker push monicahq/monicahq:latest
3939

40-
docker_push_bintray:
40+
docker_push_bintray: .travis.deploy.json
4141
docker tag monicahq/monicahq monicahq-docker-docker.bintray.io/monicahq/monicahq:$(BUILD)
4242
docker push monicahq-docker-docker.bintray.io/monicahq/monicahq:$(BUILD)
43+
BUILD=$(BUILD) scripts/tests/fix-bintray.sh
4344

4445
.PHONY: docker docker_build docker_tag docker_push docker_push_bintray
4546

@@ -107,11 +108,10 @@ COMMIT_MESSAGE := $(shell echo "$$TRAVIS_COMMIT_MESSAGE" | sed -s 's/"/\\\\\\\\\
107108
cp $< $@
108109
sed -si "s/\$$(version)/$(BUILD)/" $@
109110
sed -si "s/\$$(description)/$(COMMIT_MESSAGE)/" $@
110-
sed -si "s/\$$(released)/$(shell date --iso-8601=date)/" $@
111+
sed -si "s/\$$(released)/$(shell date --iso-8601=s)/" $@
111112
sed -si "s/\$$(travis_tag)/$(TRAVIS_TAG)/" $@
112113
sed -si "s/\$$(travis_commit)/$(GIT_COMMIT)/" $@
113114
sed -si "s/\$$(travis_build_number)/$(TRAVIS_BUILD_NUMBER)/" $@
114-
sed -si "s/\$$(date)/$(shell date --iso-8601=s)/" $@
115115

116116
results/%.tar.xz: % prepare
117117
tar chfJ $@ --exclude .gitignore --exclude .gitkeep $<

scripts/tests/.travis.deploy.json.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repo": "builds",
55
"subject": "monicahq",
66
"desc": "MonicaHQ, the Personal Relationship Manager",
7-
"website_url": "www.monicahq.com",
7+
"website_url": "https://www.monicahq.com",
88
"issue_tracker_url": "https://github.com/monicahq/monica/issues",
99
"vcs_url": "https://github.com/monicahq/monica.git",
1010
"github_use_tag_release_notes": true,
@@ -20,10 +20,10 @@
2020
"desc": "$(description)",
2121
"released": "$(released)",
2222
"vcs_tag": "$(travis_tag)",
23+
"github_use_tag_release_notes": true,
2324
"attributes": [
2425
{"name": "commit", "values" : ["$(travis_commit)"], "type": "string"},
25-
{"name": "build", "values" : ["$(travis_build_number)"], "type": "integer"},
26-
{"name": "date", "values" : ["$(date)"], "type": "date"}
26+
{"name": "build", "values" : [$(travis_build_number)]}
2727
]
2828
},
2929
"files": [

scripts/tests/fix-bintray.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -v
4+
5+
SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && /bin/pwd -P)
6+
ROOT=$(realpath $SELF_PATH/../..)
7+
8+
SLUG=${SLUG:-monicahq}
9+
REPO=${REPO:-docker}
10+
PACKAGE=${PACKAGE:-monicahq%3Amonicahq}
11+
12+
curl -sS --user "${BINTRAY_USER}:${BINTRAY_APIKEY}" -H "Content-Type: application/json" \
13+
-X PATCH https://api.bintray.com/packages/${SLUG}/${REPO}/${PACKAGE}/versions/${BUILD} \
14+
-d "$(jq -r ".version" $ROOT/.travis.deploy.json)"
15+
16+
curl -sS --user "${BINTRAY_USER}:${BINTRAY_APIKEY}" -H "Content-Type: application/json" \
17+
-X POST https://api.bintray.com/packages/${SLUG}/${REPO}/${PACKAGE}/versions/${BUILD}/attributes \
18+
-d "$(jq -r ".version.attributes" $ROOT/.travis.deploy.json)"

0 commit comments

Comments
 (0)