-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: futuretea <[email protected]>
- Loading branch information
Showing
11 changed files
with
157 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,6 @@ linters: | |
- unused | ||
- unparam | ||
- ineffassign | ||
- scopelint | ||
- maligned | ||
- prealloc | ||
- stylecheck | ||
- goconst | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,19 +3,19 @@ FROM golang:1.16.5-alpine3.13 | |
ARG DAPPER_HOST_ARCH | ||
ENV ARCH $DAPPER_HOST_ARCH | ||
|
||
RUN apk update && apk -U add bash git gcc musl-dev docker vim less file curl wget ca-certificates | ||
RUN apk update && apk -U add bash git gcc musl-dev docker vim less file curl wget ca-certificates zip perl-utils | ||
|
||
# install goimports | ||
RUN GO111MODULE=on go get golang.org/x/tools/cmd/[email protected].2 | ||
RUN GO111MODULE=on go get golang.org/x/tools/cmd/[email protected].9 | ||
|
||
## install golangci-lint | ||
RUN if [ "${ARCH}" = "amd64" ]; then \ | ||
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b "$(go env GOPATH)/bin" v1.27.0; \ | ||
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b "$(go env GOPATH)/bin" v1.44.0; \ | ||
fi | ||
|
||
ENV DAPPER_ENV REPO TAG DRONE_TAG CROSS | ||
ENV DAPPER_SOURCE /go/src/github.com/harvester/terraform-provider-harvester | ||
ENV DAPPER_OUTPUT ./bin ./dist | ||
ENV DAPPER_OUTPUT ./bin ./dist ./build | ||
ENV DAPPER_DOCKER_SOCKET true | ||
ENV HOME ${DAPPER_SOURCE} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
source $(dirname $0)/version | ||
|
||
cd $(dirname $0)/.. | ||
|
||
BIN_NAME_PREFIX="terraform-provider-harvester" | ||
BUILD_DIR="./build" | ||
BUILD_BIN_DIR="${BUILD_DIR}/bin" | ||
if [ -z "$(ls -A ${BUILD_BIN_DIR})" ]; then | ||
exit 0 | ||
fi | ||
|
||
VERSION_NO_V=${VERSION/[v|V]/} | ||
echo "==> Packaging binaries version ${VERSION_NO_V} ..." | ||
|
||
DIST=$(pwd)/dist/artifacts | ||
|
||
mkdir -p "${DIST}" | ||
|
||
for i in "${BUILD_BIN_DIR}"/*; do | ||
if [ ! -e "${i}" ]; then | ||
continue | ||
fi | ||
|
||
ARCHIVE_DIR=${BUILD_DIR}/archive | ||
|
||
rm -rf "${ARCHIVE_DIR}" | ||
mkdir -p "${ARCHIVE_DIR}" | ||
|
||
EXT= | ||
if [[ $i =~ .*windows.* ]]; then | ||
EXT=.exe | ||
fi | ||
|
||
cp "${i}" "${ARCHIVE_DIR}/${BIN_NAME_PREFIX}_${VERSION}${EXT}" | ||
|
||
( | ||
cd "${ARCHIVE_DIR}" | ||
NAME=$(basename "${i}" | cut -f1 -d_) | ||
ARCH=$(basename "${i}" | cut -f2,3 -d_ | cut -f1 -d.) | ||
ARCHIVE_FILE="${NAME}_${VERSION_NO_V}_${ARCH}.zip" | ||
echo "Packaging $DIST/${ARCHIVE_FILE} ..." | ||
zip -q "${DIST}/${ARCHIVE_FILE}" ./* | ||
) | ||
done | ||
|
||
( | ||
cd "${DIST}" | ||
shasum -a 256 ./* > "${BIN_NAME_PREFIX}_${VERSION_NO_V}_SHA256SUMS" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.