Skip to content

Commit b82eedd

Browse files
authored
Changes quickstart to look at Maven central as Bintray is no longer used (#11)
Right now, people can't download zipkin anymore. This fixes it by using central until there is a better way. Note: This drops GPG verification, as the assumption about who signed the dist is no longer valid. This is better than scaring people. Note: There's no requirement to sign the md5 file, even if Bintray did that by default. ASF projects do not sign the md5.
1 parent 72780f6 commit b82eedd

File tree

1 file changed

+27
-65
lines changed

1 file changed

+27
-65
lines changed

quickstart.sh

+27-65
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
set -euo pipefail
44

55
# This will be set to 1 if we instruct the user to manually verify signatures,
6-
# when they have GPG but don't have the BinTray public key. Would be super confusing
7-
# to tell the user to use files that we've cleaned up.
6+
# when they have GPG but don't have the public key of the signer. Would be super
7+
# confusing to tell the user to use files that we've cleaned up.
88
DO_CLEANUP=0
99

1010
# shellcheck disable=SC2015
@@ -15,6 +15,8 @@ color_bad=$(tput setaf 1 || true)
1515
color_warn=$(tput setaf 3 || true)
1616
color_reset=$(tput sgr0 || true)
1717

18+
repo=https://repo.maven.apache.org/maven2
19+
1820
usage() {
1921
cat <<EOF
2022
${color_title}$0${color_reset}
@@ -25,16 +27,16 @@ Downloads the "VERSION" version of GROUP:ARTIFACT with classifier "CLASSIFIER"
2527
to path "TARGET" on the local file system. "VERSION" can take the special value
2628
"LATEST", in which case the latest Zipkin release will be used. For example:
2729
28-
${color_title}$0 io.zipkin.java:zipkin-autoconfigure-collector-scribe:LATEST:module scribe.jar${color_reset}
30+
${color_title}$0 io.zipkin.aws:zipkin-autoconfigure-collector-kinesis:LATEST:module kinesis.jar${color_reset}
2931
downloads the latest version of the artifact with group "io.zipkin.aws",
30-
artifact id "zipkin-autoconfigure-collector-scribe", and classifier "module"
31-
to PWD/scribe.jar
32+
artifact id "zipkin-autoconfigure-collector-kinesis", and classifier "module"
33+
to PWD/kinesis.jar
3234
EOF
3335
}
3436

3537
welcome() {
3638
cat <<EOF
37-
${color_title}Thank you for trying OpenZipkin!${color_reset}
39+
${color_title}Thank you for trying Zipkin!${color_reset}
3840
This installer is provided as a quick-start helper, so you can try Zipkin out
3941
without a lengthy installation process.
4042
@@ -64,7 +66,7 @@ cleanup() {
6466
local base_filename="$1"; shift
6567
if [[ "$DO_CLEANUP" -eq 0 ]]; then
6668
printf '\n%s\n' "${color_title}Cleaning up checksum and signature files${color_reset}"
67-
execute_and_log rm -f "$base_filename"{.md5,.asc,.md5.asc}
69+
execute_and_log rm -f "$base_filename"{.md5,.asc}
6870
DO_CLEANUP=1
6971
fi
7072
}
@@ -79,15 +81,15 @@ handle_shutdown() {
7981
${color_bad}
8082
It looks like quick-start setup has failed. Please run the command again
8183
with the debug flag like below, and open an issue on
82-
https://github.com/openzipkin/zipkin/issues/new. Make sure to include the
83-
full output of the run.
84+
https://github.com/apache/incubator-zipkin-website/issues/new. Make sure
85+
to include the full output of the run.
8486
${color_reset}
85-
\\curl -sSL http://zipkin.io/quickstart.sh | bash -sx -- $@
87+
\\curl -sSL https://zipkin.apache.org/quickstart.sh | bash -sx -- $@
8688
8789
In the meanwhile, you can manually download and run the latest executable jar
8890
from the following URL:
8991
90-
https://dl.bintray.com/openzipkin/maven/io/zipkin/java/zipkin-server/
92+
https://search.maven.org/remote_content?g=org.apache.zipkin&a=zipkin-server&v=LATEST&c=exec
9193
EOF
9294
fi
9395
}
@@ -107,48 +109,8 @@ fetch() {
107109
fetch_latest_version() {
108110
local artifact_group="$1"; shift
109111
local artifact_id="$1"; shift
110-
local url="https://api.bintray.com/search/packages/maven?g=${artifact_group}&a=${artifact_id}&subject=openzipkin"
111-
local package_data
112-
local package_count
113-
local have_jq
114-
115-
# We'll have more robustness if jq is present, but will do our best without it as well
116-
if command -v jq >/dev/null 2>&1; then
117-
have_jq=0
118-
else
119-
have_jq=1
120-
printf >&2 '%s\n' \
121-
"${color_warn}jq not found on path. This script will still do its best, but installing jq" \
122-
"will allow it to parse data from Bintray in a more robust fashion.${color_reset}"
123-
fi
124-
125-
# Call the Bintray API to search for releases
126-
package_data="$(execute_and_log curl -SL "'$url'")"
127-
128-
# Count how many packages we got from the search
129-
if [[ $have_jq -eq 0 ]]; then
130-
package_count="$(jq length <<< "$package_data")"
131-
else
132-
package_count="$(grep -c latest_version <<< "${package_data//,/$'\n'}")"
133-
fi
134-
# We want exactly one result.
135-
if [[ "$package_count" -eq 0 ]]; then
136-
printf >&2 '%s%s%s\n' \
137-
"${color_bad}" \
138-
'No package information found; the provided group or artifact ID may be invalid.' \
139-
"${color_reset}"
140-
exit 1
141-
elif [[ "$package_count" -gt 1 ]]; then
142-
printf >&2 '%s\n' "${color_bad}More than one package returned from search by Maven group and artifact ID.${color_reset}"
143-
exit 1
144-
fi
145-
146-
# Finally, extract the actual package version
147-
if [[ $have_jq -eq 0 ]]; then
148-
jq '.[0].latest_version' -r <<< "$package_data"
149-
else
150-
grep latest_version <<< "${package_data//,/$'\n'}" | sed 's/^.*"latest_version" *: *"*\([^"]*\)".*$/\1/'
151-
fi
112+
local url="${repo}/${artifact_group_with_slashes}/${artifact_id}/maven-metadata.xml"
113+
printf $(curl -sSL $url | sed -n '/<version>/s/.*<version>\([^<]*\)<\/version>.*/\1/p'|tail -1)
152114
}
153115

154116
artifact_part() {
@@ -198,22 +160,21 @@ verify_signature() {
198160

199161
printf '\n%s\n' "${color_title}Verifying GPG signature of $filename...${color_reset}"
200162

201-
local bintray_gpg_key='D401AB61'
163+
local gpg_key='D401AB61'
202164

203165
if command -v gpg >/dev/null 2>&1; then
204166
fetch "$url.asc" "$filename.asc"
205-
if gpg --list-keys "$bintray_gpg_key" >/dev/null 2>&1; then
167+
if gpg --list-keys "$gpg_key" >/dev/null 2>&1; then
206168
execute_and_log gpg --verify "$filename.asc" "$filename"
207169
printf '%s\n' "${color_good}GPG signature for ${filename} passes verification${color_reset}"
208170
else
209171
cat <<EOF
210172
${color_warn}
211-
JFrog BinTray GPG signing key is not known, skipping signature verification.
212-
You can import it, then verify the signature of $filename, using the following
213-
commands:
173+
GPG signing key is not known, skipping signature verification.
174+
Use the following commands to manually verify the signature of $filename:
214175
215-
gpg --keyserver keyserver.ubuntu.com --recv $bintray_gpg_key
216-
# Optionally trust the key via 'gpg --edit-key $bintray_gpg_key', then typing 'trust',
176+
gpg --keyserver keyserver.ubuntu.com --recv $gpg_key
177+
# Optionally trust the key via 'gpg --edit-key $gpg_key', then typing 'trust',
217178
# choosing a trust level, and exiting the interactive GPG session by 'quit'
218179
gpg --verify $filename.asc $filename
219180
${color_reset}
@@ -226,7 +187,7 @@ EOF
226187
}
227188

228189
main() {
229-
local artifact_group=io.zipkin.java
190+
local artifact_group=org.apache.zipkin
230191
local artifact_id=zipkin-server
231192
local artifact_version=LATEST
232193
local artifact_version_lowercase=latest
@@ -263,6 +224,7 @@ main() {
263224

264225
welcome
265226

227+
artifact_group_with_slashes="${artifact_group//.//}"
266228
artifact_version_lowercase="$(tr '[:upper:]' '[:lower:]' <<< "$artifact_version")"
267229
if [ "${artifact_version_lowercase}" = 'latest' ]; then
268230
printf '%s\n' "${color_title}Fetching version number of latest ${artifact_group}:${artifact_id} release...${color_reset}"
@@ -272,12 +234,12 @@ main() {
272234
printf '%s\n\n' "${color_good}Latest release of ${artifact_group}:${artifact_id} seems to be ${artifact_version}${color_reset}"
273235

274236
printf '%s\n' "${color_title}Downloading $artifact_group:$artifact_id:$artifact_version:$artifact_classifier to $filename...${color_reset}"
275-
artifact_group_with_slashes="${artifact_group//.//}"
276-
artifact_url="https://dl.bintray.com/openzipkin/maven/${artifact_group_with_slashes}/${artifact_id}/$artifact_version/${artifact_id}-${artifact_version}${artifact_classifier_suffix}.jar"
237+
artifact_url="${repo}/${artifact_group_with_slashes}/${artifact_id}/$artifact_version/${artifact_id}-${artifact_version}${artifact_classifier_suffix}.jar"
277238
fetch "$artifact_url" "$filename"
278239
verify_checksum "$artifact_url" "$filename"
279-
verify_signature "$artifact_url" "$filename"
280-
verify_signature "$artifact_url.md5" "$filename.md5"
240+
# Disabled as it is assuming the GPG key is from Bintray, which it won't be. This is better than
241+
# scaring people. In the future, we can do fancy things to determine which of the ASF keys it is.
242+
# verify_signature "$artifact_url" "$filename"
281243

282244
cleanup "$filename"
283245
farewell "$artifact_classifier" "$filename"

0 commit comments

Comments
 (0)