Skip to content

Commit 556cfb0

Browse files
jonpspricsantanapr
authored andcommitted
Add s390x architecture to build.
1 parent a6bfa01 commit 556cfb0

1 file changed

Lines changed: 30 additions & 22 deletions

File tree

tools/travis/build_tag_releases.sh

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
11
#!/usr/bin/env bash
22

3-
declare -a os_list=("linux" "windows" "darwin")
4-
declare -a arc_list=("amd64" "386")
3+
# Currently supported combinations of OS and Architecture
4+
declare -a builds=(
5+
"linux amd64"
6+
"linux 386"
7+
"linux s390x"
8+
"darwin amd64"
9+
"darwin 386"
10+
"windows amd64"
11+
"windows 386"
12+
)
13+
514
build_file_name=${1:-"wsk"}
615
zip_file_name=${2:-"OpenWhisk_CLI"}
716

8-
for os in "${os_list[@]}"
17+
for build in "${builds[@]}"
918
do
10-
for arc in "${arc_list[@]}"
11-
do
12-
wsk=$build_file_name
13-
os_name=$os
14-
if [ "$os" == "windows" ]; then
15-
wsk="$wsk.exe"
16-
fi
17-
if [ "$os" == "darwin" ]; then
18-
os_name="mac"
19-
fi
20-
cd $TRAVIS_BUILD_DIR
21-
GOOS=$os GOARCH=$arc go build -ldflags "-X main.CLI_BUILD_TIME=`date -u '+%Y-%m-%dT%H:%M:%S%:z'`" -o build/$os/$arc/$wsk
22-
cd build/$os/$arc
23-
if [[ "$os" == "linux" ]]; then
24-
tar -czvf "$TRAVIS_BUILD_DIR/$zip_file_name-$TRAVIS_TAG-$os_name-$arc.tgz" $wsk
25-
else
26-
zip -r "$TRAVIS_BUILD_DIR/$zip_file_name-$TRAVIS_TAG-$os_name-$arc.zip" $wsk
27-
fi
28-
done
19+
# A little bash foo to tokenize the build string
20+
IFS=' ' read os arc <<< "${build}"
21+
wsk=$build_file_name
22+
os_name=$os
23+
if [ "$os" == "windows" ]; then
24+
wsk="$wsk.exe"
25+
fi
26+
if [ "$os" == "darwin" ]; then
27+
os_name="mac"
28+
fi
29+
cd $TRAVIS_BUILD_DIR || exit
30+
GOOS=$os GOARCH=$arc go build -ldflags "-X main.CLI_BUILD_TIME=`date -u '+%Y-%m-%dT%H:%M:%S%:z'`" -o build/$os/$arc/$wsk
31+
cd build/$os/$arc || exit
32+
if [[ "$os" == "linux" ]]; then
33+
tar -czvf "$TRAVIS_BUILD_DIR/$zip_file_name-$TRAVIS_TAG-$os_name-$arc.tgz" $wsk
34+
else
35+
zip -r "$TRAVIS_BUILD_DIR/$zip_file_name-$TRAVIS_TAG-$os_name-$arc.zip" $wsk
36+
fi
2937
done

0 commit comments

Comments
 (0)