forked from redhat-developer/odo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate-bintray-json.sh
executable file
·78 lines (67 loc) · 2.49 KB
/
generate-bintray-json.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
DATE=`date --iso-8601=date`
TIME=`date --iso-8601=seconds`
# generate ./dist/bin/info.txt
# this file contains information about what files were build and what was source of build
commit_id=$(git rev-parse HEAD)
origin=$(git config --get remote.origin.url)
cat > "./dist/bin/info.txt" <<EOF
date: ${TIME}
build_from: ${origin}
commit_id: ${commit_id}
files:
EOF
for f in $(ls -1 ./dist/bin/*/* | grep -v info.txt); do
sha256sum=$(sha256sum $f | cut -d ' ' -f 1);
name=$(echo $f | sed "s/^\.\/dist\/bin\///")
updated_on=$(stat -c %y $f)
cat >> "./dist/bin/info.txt" <<EOF
- name: ${name}"
sha256sum: ${sha256sum}"
updated_on: ${updated_on}
EOF
done
# generate .bintray.json
# this file contains all information on what will be upload to bintray
# for mor info: https://docs.travis-ci.com/user/deployment/bintray/
cat > "./.bintray.json" <<EOF
{
"package": {
"name": "odo",
"repo": "odo",
"subject": "odo",
"desc": "OpenShift Command line for Developers",
"website_url": "https://github.com/redhat-developer/odo",
"issue_tracker_url": "https://github.com/redhat-developer/odo/issues",
"vcs_url": "https://github.com/redhat-developer/odo.git",
"licenses": ["Apache-2.0"],
"public_download_numbers": false,
"public_stats": false
},
"version": {
"name": "latest",
"desc": "odo build from master branch",
"released": "${DATE}",
"vcs_tag": "${TRAVIS_COMMIT}",
"attributes": [{"name": "TRAVIS_JOB_NUMBER", "values" : ["${TRAVIS_JOB_NUMBER}"], "type": "string"},
{"name": "TRAVIS_JOB_ID", "values" : ["${TRAVIS_JOB_ID}"], "type": "string"},
{"name": "TRAVIS_COMMIT", "values" : ["${TRAVIS_COMMIT}"], "type": "string"},
{"name": "TRAVIS_BRANCH", "values" : ["${TRAVIS_BRANCH}"], "type": "string"},
{"name": "TRAVIS_PULL_REQUEST", "values" : ["${TRAVIS_PULL_REQUEST}"], "type": "string"},
{"name": "date", "values" : ["${TIME}"], "type": "date"}],
"gpgSign": false
},
"files":
[
{"includePattern": "dist\/bin\/([^\/]+)\/(.*)",
"uploadPattern": "./latest/\$1/\$2",
"matrixParams": {"override": 1 }
},
{"includePattern": "dist/bin/info.txt",
"uploadPattern": "./latest/info.txt",
"matrixParams": {"override": 1 }
}
],
"publish": true
}
EOF