-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck-versions.sh
executable file
·170 lines (132 loc) · 4.36 KB
/
check-versions.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#!/bin/bash
# vim: filetype=sh:tabstop=2:shiftwidth=2:expandtab
# http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/
readonly PROGNAME=$(basename $0)
readonly PROGDIR="$( cd "$(dirname "$0")" ; pwd -P )"
readonly ARGS="$@"
readonly TODAY=$(date +%Y%m%d%H%M%S)
# pull in utils
source "${PROGDIR}/utils.sh"
if ! command_exists curl; then
warn "curl doesn't appear to be installed."
exit 0
fi
if ! command_exists jq; then
warn "jq doesn't appear to be installed."
exit 0
fi
compare() {
local desc=$1
local url=$2
local old=$3
local new=
if [[ $url == http* ]]; then
new=$(curl --silent "$url" | sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p' || "meh?")
else
new=$url
fi
# if using jq, the new version value may be wrapped in quotes
temp="${new%\"}"
temp="${new#\"}"
if [ "$old" != "$new" ]; then
inf "$desc: Using $old; $new is available"
fi
}
## https://github.com/azure/draft
compare "draft" \
"https://api.github.com/repos/azure/draft/releases/latest" \
"$DRAFT_VER"
## https://github.com/google/protobuf
compare "protobuf" \
"https://api.github.com/repos/google/protobuf/releases/latest" \
"$PROTOBUF_VER"
## https://github.com/uber/prototool
compare "prototool" \
"https://api.github.com/repos/uber/prototool/releases/latest" \
"$PROTOTOOL_VER"
## https://github.com/apex/up
compare "up" \
"https://api.github.com/repos/apex/up/releases/latest" \
"$UP_VER"
#GOLANG_NEW_VER="1.10"
## https://github.com/kubernetes/helm
compare "helm" \
"https://api.github.com/repos/kubernetes/helm/releases/latest" \
"$HELM_VER"
## https://github.com/kubernetes/minikube
compare "minikube" \
"https://api.github.com/repos/kubernetes/minikube/releases/latest" \
"$MINIKUBE_VER"
## https://github.com/hashicorp/terraform
compare "terraform" \
"https://api.github.com/repos/hashicorp/terraform/releases/latest" \
"$TERRAFORM_VER"
## https://github.com/cloudflare/cfssl
compare "cfssl" \
"https://api.github.com/repos/cloudflare/cfssl/releases/latest" \
"$CFSSL_VER"
## https://github.com/kubernetes/kops
compare "kops" \
"https://api.github.com/repos/kubernetes/kops/releases/latest" \
"$KOPS_VER"
## https://github.com/kubernetes/kubernetes
compare "kubernetes" \
"$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)" \
"$KUBE_VER"
## https://github.com/digitalocean/doctl
compare "doctl" \
"https://api.github.com/repos/digitalocean/doctl/releases/latest" \
"$DOCTL_VER"
#DOCKER_NEW_VER="17.03.2" # this version is compatiable w/k8s v1.9
#HABITAT_NEW_VER="0.54.0"
#HABITAT_NEW_VER_TS="20180221022026"
## https://github.com/ansible/ansible/releases
compare "ansible" \
"https://api.github.com/repos/ansible/ansible/releases/latest" \
"$ANSIBLE_VER"
## https://github.com/Azure/azure-cli
compare "azure" \
"https://api.github.com/repos/Azure/azure-cli/releases/latest" \
"$AZURE_VER"
#NGROK_NEW_VER="2.2.6"
#
###
#compare "jfrog" \
# "https://api.github.com/repos/JFrogDev/jfrog-cli-go/releases/latest" \
# "$JFROG_VER"
## https://github.com/JFrogDev/jfrog-cli-go
compare "jfrog" \
"https://api.github.com/repos/JFrogDev/jfrog-cli-go/releases/latest" \
"$JFROG_VER"
## https://github.com/chef/inspec
compare "inspec" \
"https://api.github.com/repos/chef/inspec/releases/latest" \
"$INSPEC_VER"
## https://github.com/bazelbuild/bazel
compare "bazel" \
"https://api.github.com/repos/bazelbuild/bazel/releases/latest" \
"$BAZEL_VER"
## https://github.com/jenkins-x/jx
compare "jenkins-x" \
"https://api.github.com/repos/jenkins-x/jx/releases/latest" \
"$JENKINSX_VER"
## https://github.com/GoogleContainerTools/skaffold
compare "skaffold" \
"https://api.github.com/repos/GoogleContainerTools/skaffold/releases/latest" \
"$SKAFFOLD_VER"
## https://github.com/goreleaser/goreleaser
compare "goreleaser" \
"https://api.github.com/repos/goreleaser/goreleaser/releases/latest" \
"$GORELEASER_VER"
## https://github.com/fission/fission
compare "fission" \
"https://api.github.com/repos/fission/fission/releases/latest" \
"$FISSION_VER"
## https://github.com/bitnami-labs/sealed-secrets
compare "sealed-secrets" \
"https://api.github.com/repos/bitnami-labs/sealed-secrets/releases/latest" \
"$K8S_SEALED_SECRETS_VER"
## https://github.com/rust-lang-nursery/rustup.rs
compare "rustup" \
"https://api.github.com/repos/rust-lang-nursery/rustup.rs/releases/latest" \
"RUSTUP_VER"