Skip to content

Commit

Permalink
Put distribution files in subfolder of the current working directory.…
Browse files Browse the repository at this point in the history
… This will be needed to build a docker image locally later.
  • Loading branch information
stefanwichmann committed Apr 4, 2017
1 parent 3a32c71 commit 0e6a820
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ _testmain.go
*.exe
*.test
*.prof

# Kelvin files
dist

# macOS
.DS_Store
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ deploy:
api_key:
secure: XIx3ud8z/GEEEh+/ay7/ajwpdXmwTalYJR5e3wUpmZh0Uaa3S7SiYnqVxc6ukiWq7+WsQn9HuuqOhB8epSQ1cgxr2Y1r4j6BHXbOm38OJ5R6UFDzIM8iB23/p8yXoD1BIvG22NTGYVZsHE5kbnckj1pB48DAH4JxQR/41OvcriT87Gf2NR4gejluCg773byWNERvg7IjFQcGXSZgHdrbYo+qHmIU00oLSxEZBy1u3wf48fqhnrw8osT6qR4ZDGWX1bHky9UzzJiLR6I/NkA8dicOEZpPNNKBxupfbICLzoDVPnhfwwfO585Tw0ntQx4q+o9r9+27mU6860Qe59l27nIfHVYBefQ2rIvHA8wf/6i2yu8tJQay0KsjsOpwz96Yt2JrK58T4bZJXkw1ZywVgjkfO0yjGEV2+b9BaaQBiYclIn4rt8f9i/PyHqxmUoCSMMNrc0go3hvwUO6tpfSPBkdmg0LN0cJIDTshRbLMw33FEcghk0yj/Z/v6bQS3kLViKXgNDDd80E2KDI5+1uuGySSgqZj2npAvHeRHZ6dKWUu8+3unZDcfDXi8xfALMlmAKaTTwA6tdvJVBWprpOB1lLVJUGnbhJgh2GakD33MQ4FTZmNYfJ8vNRdW6SpRr3nWTAFCHh2c6NtGItkdjWi95RjgkHq9s2h63jwsdQCk8Y=
file_glob: true
file: ${GOPATH}/dist/archives/*
file: dist/archives/*
skip_cleanup: true
on:
tags: true
10 changes: 5 additions & 5 deletions scripts/dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ buildTarget() {
fi

# configure paths
DIST_PATH=$GOPATH/dist
DIST_PATH="dist"
ARCHIVE_PATH="archives"
OUTPUT_FOLDER="$BINARY_NAME-$TARGET-$GIT_TAG"
OUTPUT_PATH=$DIST_PATH/$OUTPUT_FOLDER
OUTPUT_BINARY=$OUTPUT_PATH/$BINARY_NAME
if [ "$OS" = "windows" ]; then
OUTPUT_BINARY="$OUTPUT_BINARY.exe"
fi
ARCHIVE_PATH=$DIST_PATH/archives
ARCHIVE_NAME=$ARCHIVE_PATH/"$BINARY_NAME-$TARGET-$GIT_TAG"
if [ "$OS" = "windows" ]; then
ARCHIVE_NAME="$ARCHIVE_NAME.zip"
else
ARCHIVE_NAME="$ARCHIVE_NAME.tar.gz"
fi
mkdir "-p" "$OUTPUT_PATH"
mkdir "-p" "$ARCHIVE_PATH"
mkdir "-p" "$DIST_PATH/$ARCHIVE_PATH"

# Start go build
echo ===== Starting build =====
Expand All @@ -58,9 +58,9 @@ buildTarget() {
DIR="$(pwd)"
cd "$DIST_PATH"
if [ "$OS" = "windows" ]; then
zip -r "$ARCHIVE_NAME" "$OUTPUT_FOLDER"
zip -r "./$ARCHIVE_NAME" "$OUTPUT_FOLDER"
else
tar cfvz "$ARCHIVE_NAME" "$OUTPUT_FOLDER"
tar cfvz "./$ARCHIVE_NAME" "$OUTPUT_FOLDER" #
fi
cd "$DIR"
echo ===== "$TARGET" build successfull =====
Expand Down

0 comments on commit 0e6a820

Please sign in to comment.