updated dip
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Paul 2022-10-30 15:40:18 +01:00
parent cfcb9d9387
commit 85a7d0bb3a
3 changed files with 1 additions and 84 deletions

View File

@ -1,21 +0,0 @@
# dip Makefile
PROJECT=dip
GOCMD=go
GOBUILDCMD=${GOCMD} build
GOOPTIONS=-mod=vendor -ldflags="-s -w" -o ${PROJECT}
PACKRCMD=${GOPATH}/bin/packr2
RMCMD=/bin/rm
SRCFILES=cmd/dip/*.go
all: build
build:
${PACKRCMD}
${GOBUILDCMD} ${GOOPTIONS} ${SRCFILES}
clean:
${RMCMD} ${PROJECT}
${PACKRCMD} clean

View File

@ -37,7 +37,7 @@ curl -H "Accept: text/html" http://localhost:8080/
## License ## License
```text ```text
Copyright (c) 2019, 2020, 2021 PaulBSD Copyright (c) 2019, 2020, 2021, 2022 PaulBSD
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@ -1,62 +0,0 @@
#!/bin/bash
set -e
PROJECTNAME=dip
RELEASENAME=${PROJECTNAME}
VERSION="0"
GOOPTIONS="-mod=vendor"
SRCFILES=cmd/dip/*.go
build() {
echo "Begin of build"
if [[ ! -z $DRONE_TAG ]]
then
echo "Drone tag set, let's do a release"
VERSION=$DRONE_TAG
echo "${PROJECTNAME} ${VERSION}" > /build/VERSION
elif [[ ! -z $DRONE_TAG ]]
then
echo "Drone not set, let's only do a build"
VERSION=$DRONE_COMMIT
fi
if [[ ! -z $VERSION && ! -z $GOOS && ! -z $GOARCH ]]
then
echo "Let's set a release name"
RELEASENAME=${PROJECTNAME}-${VERSION}-${GOOS}-${GOARCH}
fi
echo "Building project"
go build -o ${PROJECTNAME} ${GOOPTIONS} ${SRCFILES}
if [[ ! -z $DRONE_TAG ]]
then
echo "Let's make archives"
mkdir -p /build
tar -czvf /build/${RELEASENAME}.tar.gz ${PROJECTNAME}
fi
echo "Removing binary file"
rm ${PROJECTNAME}
echo "End of build"
}
clean() {
rm -rf $RELEASEDIR
}
case $1 in
"build")
build
;;
"clean")
clean
;;
*)
echo "No options choosen"
exit 1
;;
esac