forked from leodotcloud/swiss-army-knife
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request leodotcloud#6 from leodotcloud/drone
enable drone
- Loading branch information
Showing
111 changed files
with
9,416 additions
and
5,924 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# | ||
# This file is used for running on CI server | ||
# Need to keep this in sync with .drone.yml | ||
# | ||
|
||
kind: pipeline | ||
type: docker | ||
name: default-amd64 | ||
|
||
platform: | ||
os: linux | ||
arch: amd64 | ||
|
||
trigger: | ||
branch: | ||
- master | ||
|
||
workspace: | ||
base: /go | ||
path: src/github.com/leodotcloud/swiss-army-knife | ||
|
||
steps: | ||
- name: version | ||
image: golang:1.13.9-buster | ||
commands: | ||
- ./scripts/version | ||
|
||
- name: lint | ||
image: golangci/golangci-lint:v1.24.0 | ||
commands: | ||
- ./scripts/lint | ||
|
||
- name: test | ||
image: golang:1.13.9-buster | ||
environment: | ||
CGO_ENABLED: 0 | ||
GOFLAGS: -mod=vendor | ||
commands: | ||
- . ./version.env | ||
- ./scripts/test | ||
|
||
- name: build | ||
image: golang:1.13.9-buster | ||
environment: | ||
CGO_ENABLED: 0 | ||
GOFLAGS: -mod=vendor | ||
commands: | ||
- . ./version.env | ||
- ./scripts/build | ||
|
||
- name: publish | ||
image: plugins/docker | ||
settings: | ||
username: | ||
from_secret: DOCKERHUB_USERNAME | ||
password: | ||
from_secret: DOCKERHUB_PASSWORD | ||
repo: leodotcloud/swiss-army-knife | ||
dockerfile: package/Dockerfile | ||
auto_tag: true | ||
when: | ||
branch: | ||
- master | ||
event: | ||
- tag | ||
|
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 |
---|---|---|
@@ -1,23 +1,71 @@ | ||
--- | ||
# | ||
# This file is used for local development/builds | ||
# Need to keep this in sync with .drone.ci.yml | ||
# | ||
|
||
kind: pipeline | ||
type: exec | ||
name: default-amd64 | ||
|
||
platform: | ||
os: linux | ||
arch: amd64 | ||
|
||
steps: | ||
- name: build | ||
pull: default | ||
image: rancher/dapper:v0.4.1 | ||
commands: | ||
- dapper ci | ||
privileged: true | ||
volumes: | ||
workspace: | ||
base: /go | ||
path: src/github.com/leodotcloud/swiss-army-knife | ||
|
||
volumes: | ||
- name: docker | ||
path: /var/run/docker.sock | ||
when: | ||
event: | ||
- push | ||
- pull_request | ||
- tag | ||
host: | ||
path: /var/lib/docker | ||
- name: docker_socket | ||
host: | ||
path: /var/run/docker.sock | ||
|
||
steps: | ||
- name: version | ||
image: golang:1.13.9-buster | ||
commands: | ||
- ./scripts/version | ||
|
||
- name: lint | ||
image: golangci/golangci-lint:v1.24.0 | ||
commands: | ||
- ./scripts/lint | ||
|
||
- name: test | ||
image: golang:1.13.9-buster | ||
environment: | ||
CGO_ENABLED: 0 | ||
GOFLAGS: -mod=vendor | ||
commands: | ||
- . ./version.env | ||
- ./scripts/test | ||
|
||
- name: build | ||
image: golang:1.13.9-buster | ||
environment: | ||
CGO_ENABLED: 0 | ||
GOFLAGS: -mod=vendor | ||
commands: | ||
- . ./version.env | ||
- ./scripts/build | ||
|
||
- name: publish | ||
image: plugins/docker | ||
volumes: | ||
- name: docker | ||
path: /var/lib/docker | ||
- name: docker_socket | ||
path: /var/run/docker.sock | ||
settings: | ||
username: | ||
from_secret: DOCKERHUB_USERNAME | ||
password: | ||
from_secret: DOCKERHUB_PASSWORD | ||
repo: leodotcloud/swiss-army-knife | ||
tags: | ||
- dev | ||
dockerfile: package/Dockerfile | ||
dry_run: true |
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 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,11 @@ | ||
run: | ||
skip-dirs: | ||
- vendor | ||
|
||
linters: | ||
enable: | ||
- goimports | ||
|
||
linters-settings: | ||
govet: | ||
check-shadowing: false |
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
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,16 @@ | ||
# Below variables can be used to override values from .drone.yml | ||
# for local builds | ||
# | ||
# drone exec --env-file=custom.env | ||
|
||
# PLUGIN_REPO lets to change the default repo | ||
#PLUGIN_REPO=your_repo/swiss-army-knife | ||
|
||
# For local builds, the publish step builds the docker image, but | ||
# does not push to the registry. | ||
# PLUGIN_DRY_RUN allows the push action if set to false | ||
#PLUGIN_DRY_RUN=false | ||
|
||
# PLUGIN_TAGS can be used to override the default "dev" tag for | ||
# the image built locally | ||
#PLUGIN_TAGS=tag1,tag2 |
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,12 @@ | ||
module github.com/leodotcloud/swiss-army-knife | ||
|
||
go 1.13 | ||
|
||
require ( | ||
github.com/Sirupsen/logrus v1.0.4 // indirect | ||
github.com/leodotcloud/log v0.1.0 | ||
github.com/rancher/go-rancher-metadata v0.0.0-20170929155856-d2103caca587 | ||
github.com/urfave/cli v1.22.3 | ||
golang.org/x/crypto v0.0.0-20180119165957-a66000089151 // indirect | ||
golang.org/x/sys v0.0.0-20180117170059-2c42eef0765b // indirect | ||
) |
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,22 @@ | ||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= | ||
github.com/Sirupsen/logrus v1.0.4 h1:yilvuj073Hm7wwwz12E96GjrdivMNuTMJk9ddjde+D8= | ||
github.com/Sirupsen/logrus v1.0.4/go.mod h1:rmk17hk6i8ZSAJkSDa7nOxamrG+SP4P0mm+DAvExv4U= | ||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= | ||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= | ||
github.com/leodotcloud/log v0.1.0 h1:sx3MwuD7q9Van4nbonbNbYREQCTJKehWfhm8I6ovYm0= | ||
github.com/leodotcloud/log v0.1.0/go.mod h1:nUeGmzAy2eQifbL7coShqTc1EmaDKOJBQNzDCD9YWLw= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/rancher/go-rancher-metadata v0.0.0-20170929155856-d2103caca587 h1:T97rmLRz0aLeqPwj1isJ+IF34XI0yfoXXfoU0nNhwdM= | ||
github.com/rancher/go-rancher-metadata v0.0.0-20170929155856-d2103caca587/go.mod h1:2GCT10S59Rl3M/hwW7BG6MMCqvuedd7VWJ1TneSeWsQ= | ||
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= | ||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= | ||
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= | ||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= | ||
github.com/urfave/cli v1.22.3 h1:FpNT6zq26xNpHZy08emi755QwzLPs6Pukqjlc7RfOMU= | ||
github.com/urfave/cli v1.22.3/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= | ||
golang.org/x/crypto v0.0.0-20180119165957-a66000089151 h1:du7dTgoJooIwkyksVuOCfUbQDgZE9oIUdVk/v/tqou4= | ||
golang.org/x/crypto v0.0.0-20180119165957-a66000089151/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= | ||
golang.org/x/sys v0.0.0-20180117170059-2c42eef0765b h1:mxo/dXmtEd5rXc/ZzMKg0qDhMT+51+LvV65S9dP6nh4= | ||
golang.org/x/sys v0.0.0-20180117170059-2c42eef0765b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= |
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 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 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 |
---|---|---|
@@ -1,16 +1,18 @@ | ||
#!/bin/bash | ||
set -ex | ||
#!/bin/sh | ||
|
||
source $(dirname $0)/version | ||
set -e | ||
|
||
# This logic is to make sure, we can build directly from CLI | ||
if [ -z ${VERSION_SET+x} ];then | ||
source $(dirname $0)/version | ||
fi | ||
|
||
cd $(dirname $0)/.. | ||
|
||
mkdir -p bin | ||
[ "$(uname)" != "Darwin" ] && [ "${OS}" != "windows" ] && LINKFLAGS="-linkmode external -extldflags -static -s" | ||
[ "$(uname)" != "Darwin" ] && [ "${OS}" != "windows" ] && LINKFLAGS="" | ||
|
||
OUTPUT=bin/swiss-army-knife | ||
if [ "${OS}" == "windows" ]; then | ||
OUTPUT=bin/swiss-army-knife.exe | ||
OUTPUT=swiss-army-knife | ||
if [ "${OS}" = "windows" ]; then | ||
OUTPUT=swiss-army-knife.exe | ||
fi | ||
|
||
GOOS=${OS} GOARCH=${ARCH} go build -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o ${OUTPUT} |
Oops, something went wrong.