Projects STRLCPY dnstt Commits 981dc1d4
🤬
  • ■ ■ ■ ■ ■ ■
    .circleci/config.yml
     1 +version: 2
     2 +jobs:
     3 + build:
     4 + docker:
     5 + - image: circleci/golang:1.14.2
     6 + working_directory: ~/code
     7 + steps:
     8 + - checkout
     9 + - run: sudo apt-get update && sudo apt-get install -y upx
     10 + - restore_cache:
     11 + key: go-pkg-{{ checksum "go.sum" }}
     12 + - run: ./build-release.sh
     13 + - save_cache:
     14 + paths:
     15 + - /go/pkg
     16 + key: go-pkg-{{ checksum "go.sum" }}
     17 + - store_artifacts:
     18 + path: bin
     19 + destination: bin
     20 + 
  • ■ ■ ■ ■ ■ ■
    .gitignore
    1 1  dnstt-client/dnstt-client
    2 2  dnstt-server/dnstt-server
    3 3   
     4 +/dnstt-client_*
     5 +/dnstt-server_*
     6 +/bin/
     7 + 
  • ■ ■ ■ ■ ■ ■
    build-release.sh
     1 +#!/bin/bash
     2 +sum="sha1sum"
     3 + 
     4 +if ! hash sha1sum 2>/dev/null; then
     5 + if ! hash shasum 2>/dev/null; then
     6 + echo "I can't see 'sha1sum' or 'shasum'"
     7 + echo "Please install one of them!"
     8 + exit
     9 + fi
     10 + sum="shasum"
     11 +fi
     12 + 
     13 +[[ -z $upx ]] && upx="echo pending"
     14 +if [[ $upx == "echo pending" ]] && hash upx 2>/dev/null; then
     15 + upx="upx -9"
     16 +fi
     17 + 
     18 +VERSION=$(git describe --tags)
     19 +LDFLAGS="-s -w"
     20 +GCFLAGS=""
     21 + 
     22 +OSES=(linux darwin windows freebsd)
     23 +ARCHS=(amd64 386)
     24 + 
     25 +mkdir bin
     26 + 
     27 + 
     28 +for os in ${OSES[@]}; do
     29 + for arch in ${ARCHS[@]}; do
     30 + suffix=""
     31 + if [ "$os" == "windows" ]
     32 + then
     33 + suffix=".exe"
     34 + fi
     35 + 
     36 + build () {
     37 + env CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -v -ldflags "$LDFLAGS" -gcflags "$GCFLAGS" -o $1_${os}_${arch}${suffix} ./$1
     38 + $upx $1_${os}_${arch}${suffix} >/dev/null
     39 + tar -zcf bin/$1-${os}-${arch}-$VERSION.tar.gz $1_${os}_${arch}${suffix}
     40 + $sum bin/$1-${os}-${arch}-$VERSION.tar.gz
     41 + }
     42 + build 'dnstt-client'
     43 + build 'dnstt-server'
     44 + done
     45 +done
     46 + 
Please wait...
Page is in error, reload to recover