Merge pull request #7 from yggdrasil-network/develop

Branch Develop: Branch to Patch
This commit is contained in:
Christer Warén 2018-12-19 11:32:34 +02:00 committed by GitHub
commit 3bbe922f5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 10 deletions

View File

@ -103,7 +103,7 @@ jobs:
name: Create tags (master branch only) name: Create tags (master branch only)
command: > command: >
if [ "${CIRCLE_BRANCH}" == "master" ]; then if [ "${CIRCLE_BRANCH}" == "master" ]; then
git tag -f -a $(sh contrib/semver/version.sh) -m "Created by CircleCI" && git push -f --tags; (git tag -a $(sh contrib/semver/version.sh) -m "Created by CircleCI" && git push --tags) || true;
else else
echo "Only runs for master branch (this is ${CIRCLE_BRANCH})"; echo "Only runs for master branch (this is ${CIRCLE_BRANCH})";
fi; fi;

View File

@ -25,7 +25,7 @@ if [ $PKGARCH = "amd64" ]; then GOARCH=amd64 GOOS=linux ./build
elif [ $PKGARCH = "i386" ]; then GOARCH=386 GOOS=linux ./build elif [ $PKGARCH = "i386" ]; then GOARCH=386 GOOS=linux ./build
elif [ $PKGARCH = "mipsel" ]; then GOARCH=mipsle GOOS=linux ./build elif [ $PKGARCH = "mipsel" ]; then GOARCH=mipsle GOOS=linux ./build
elif [ $PKGARCH = "mips" ]; then GOARCH=mips64 GOOS=linux ./build elif [ $PKGARCH = "mips" ]; then GOARCH=mips64 GOOS=linux ./build
elif [ $PKGARCH = "armhf" ]; then GOARCH=arm GOOS=linux GOARM=7 ./build elif [ $PKGARCH = "armhf" ]; then GOARCH=arm GOOS=linux GOARM=6 ./build
elif [ $PKGARCH = "arm64" ]; then GOARCH=arm64 GOOS=linux ./build elif [ $PKGARCH = "arm64" ]; then GOARCH=arm64 GOOS=linux ./build
else else
echo "Specify PKGARCH=amd64,i386,mips,mipsel,armhf,arm64" echo "Specify PKGARCH=amd64,i386,mips,mipsel,armhf,arm64"
@ -73,7 +73,7 @@ cat > /tmp/$PKGNAME/debian/postinst << EOF
#!/bin/sh #!/bin/sh
if ! getent group yggdrasil 2>&1 > /dev/null; then if ! getent group yggdrasil 2>&1 > /dev/null; then
addgroup --system --quiet yggdrasil groupadd --system --force yggdrasil || echo "Failed to create group 'yggdrasil' - please create it manually and reinstall"
fi fi
if [ -f /etc/yggdrasil.conf ]; if [ -f /etc/yggdrasil.conf ];

View File

@ -2,6 +2,9 @@ FROM docker.io/golang:alpine as builder
COPY . /src COPY . /src
WORKDIR /src WORKDIR /src
ENV CGO_ENABLED=0
RUN apk add git && ./build RUN apk add git && ./build
FROM docker.io/alpine FROM docker.io/alpine

View File

@ -3,14 +3,14 @@
# Merge commits from this branch are counted # Merge commits from this branch are counted
DEVELOPBRANCH="yggdrasil-network/develop" DEVELOPBRANCH="yggdrasil-network/develop"
# Get the last tag that denotes moving to a major version number # Get the last tag
TAG=$(git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*\.0" 2>/dev/null) TAG=$(git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*\.0" 2>/dev/null)
# Get last merge to master # Get last merge to master
MERGE=$(git rev-list $TAG..master --grep "from $DEVELOPBRANCH" 2>/dev/null | head -n 1) MERGE=$(git rev-list $TAG..master --grep "from $DEVELOPBRANCH" 2>/dev/null | head -n 1)
# Get the number of merges since the last merge to master # Get the number of merges since the last merge to master
PATCH=$(git rev-list $TAG..master --count --merges --grep="from $DEVELOPBRANCH" 2>/dev/null) PATCH=$(git rev-list $TAG..master --count --merges --grep="from $DEVELOPBRANCH" --first-parent master 2>/dev/null)
# Decide whether we should prepend the version with "v" - the default is that # Decide whether we should prepend the version with "v" - the default is that
# we do because we use it in git tags, but we might not always need it # we do because we use it in git tags, but we might not always need it
@ -51,13 +51,17 @@ else
printf '%s%d.%d.%d' "$PREPEND" "$MAJOR" "$MINOR" "$PATCH" printf '%s%d.%d.%d' "$PREPEND" "$MAJOR" "$MINOR" "$PATCH"
fi fi
# Get the number of merges on the current branch since the last tag
TAG=$(git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*\.[0-9]*" --first-parent master 2>/dev/null)
BUILD=$(git rev-list $TAG.. --count)
# Add the build tag on non-master branches # Add the build tag on non-master branches
if [ $BRANCH != "master" ]; then if [ $BRANCH != "master" ]; then
# Get the number of merges on the current branch since the last tag
BUILDTAG=$(git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*\.[0-9]*" 2>/dev/null)
BUILD=$(git rev-list $BUILDTAG..HEAD --count --merges)
if [ $BUILD != 0 ]; then if [ $BUILD != 0 ]; then
printf -- "-%04d" "$BUILD" printf -- "-%04d" "$BUILD"
fi fi
else
if [ $BUILD != 0 ]; then
printf -- "-%d" "$(($BUILD+1))"
fi
fi fi

View File

@ -395,7 +395,7 @@ func (a *admin) listen() {
for { for {
conn, err := a.listener.Accept() conn, err := a.listener.Accept()
if err == nil { if err == nil {
a.handleRequest(conn) go a.handleRequest(conn)
} }
} }
} }