File tree Expand file tree Collapse file tree 1 file changed +38
-3
lines changed Expand file tree Collapse file tree 1 file changed +38
-3
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- TAG=$( cat VERSION)
3
- docker build . -t infuseai/primehub-usage:$TAG
4
- docker push infuseai/primehub-usage:$TAG
2
+ VERSION=$( cat VERSION)
3
+ DRY_RUN=false
4
+
5
+ info () {
6
+ echo -e " \033[0;32m$1 \033[0m"
7
+ }
8
+
9
+ warn () {
10
+ echo -e " \033[0;93m$1 \033[0m"
11
+ }
12
+
13
+ error () {
14
+ echo -e " \033[0;91m$1 \033[0m" >&2
15
+ }
16
+
17
+ if ! command -v curl > /dev/null; then
18
+ error " [Fail] Not install curl"
19
+ exit 1
20
+ fi
21
+
22
+ if [ " ${1:- } " == " --dry-run" ]; then
23
+ warn " [Dry run mode]"
24
+ DRY_RUN=true
25
+ fi
26
+
27
+ tag=" $VERSION "
28
+ name=" primehub-usage $VERSION "
29
+ info " [Release] Primehub-usage with version $VERSION "
30
+ echo " name: $name "
31
+ echo " tag: $tag "
32
+
33
+ if [ " $DRY_RUN " == false ]; then
34
+ curl \
35
+ -X POST \
36
+ -H " Accept: application/vnd.github.v3+json" \
37
+ https://api.github.com/repos/infuseai/primehub-usage/releases \
38
+ -d " {\" tag_name\" :\" $tag \" , \" name\" :\" $name \" }"
39
+ fi
You can’t perform that action at this time.
0 commit comments