refactor: replace " with '

This commit is contained in:
Bo-Yi Wu
2019-02-09 18:17:59 +08:00
parent 3b6ecc789b
commit 8d54929d2a
2 changed files with 104 additions and 104 deletions
+98 -98
View File
@@ -1,201 +1,201 @@
local name = 'drone-discord';
local PipelineTesting = {
kind: "pipeline",
name: "testing",
kind: 'pipeline',
name: 'testing',
platform: {
os: "linux",
arch: "amd64",
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: "vet",
image: "golang:1.11",
pull: "always",
name: 'vet',
image: 'golang:1.11',
pull: 'always',
environment: {
GO111MODULE: "on",
GO111MODULE: 'on',
},
commands: [
"make vet",
'make vet',
],
volumes: [
{
name: "gopath",
path: "/go",
name: 'gopath',
path: '/go',
},
],
},
{
name: "lint",
image: "golang:1.11",
pull: "always",
name: 'lint',
image: 'golang:1.11',
pull: 'always',
environment: {
GO111MODULE: "on",
GO111MODULE: 'on',
},
commands: [
"make lint",
'make lint',
],
volumes: [
{
name: "gopath",
path: "/go",
name: 'gopath',
path: '/go',
},
],
},
{
name: "misspell",
image: "golang:1.11",
pull: "always",
name: 'misspell',
image: 'golang:1.11',
pull: 'always',
environment: {
GO111MODULE: "on",
GO111MODULE: 'on',
},
commands: [
"make misspell-check",
'make misspell-check',
],
volumes: [
{
name: "gopath",
path: "/go",
name: 'gopath',
path: '/go',
},
],
},
{
name: "test",
image: "golang:1.11",
pull: "always",
name: 'test',
image: 'golang:1.11',
pull: 'always',
environment: {
GO111MODULE: "on",
WEBHOOK_ID: { "from_secret": "webhook_id" },
WEBHOOK_TOKEN: { "from_secret": "webhook_token" },
GO111MODULE: 'on',
WEBHOOK_ID: { 'from_secret': 'webhook_id' },
WEBHOOK_TOKEN: { 'from_secret': 'webhook_token' },
},
commands: [
"make test",
"make coverage",
'make test',
'make coverage',
],
volumes: [
{
name: "gopath",
path: "/go",
name: 'gopath',
path: '/go',
},
],
},
{
name: "codecov",
image: "robertstettner/drone-codecov",
pull: "always",
name: 'codecov',
image: 'robertstettner/drone-codecov',
pull: 'always',
settings: {
token: { "from_secret": "codecov_token" },
token: { 'from_secret': 'codecov_token' },
},
},
],
volumes: [
{
name: "gopath",
name: 'gopath',
temp: {},
},
],
};
local PipelineBuild(name, os="linux", arch="amd64") = {
kind: "pipeline",
name: os + "-" + arch,
local PipelineBuild(name, os='linux', arch='amd64') = {
kind: 'pipeline',
name: os + '-' + arch,
platform: {
os: os,
arch: arch,
},
steps: [
{
name: "build-push",
image: "golang:1.11",
pull: "always",
name: 'build-push',
image: 'golang:1.11',
pull: 'always',
environment: {
CGO_ENABLED: "0",
GO111MODULE: "on",
CGO_ENABLED: '0',
GO111MODULE: 'on',
},
commands: [
"go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/" + os + "/" + arch + "/" + name,
'go build -v -ldflags \'-X main.build=${DRONE_BUILD_NUMBER}\' -a -o release/' + os + '/' + arch + '/' + name,
],
when: {
event: {
exclude: [ "tag" ],
exclude: [ 'tag' ],
},
},
},
{
name: "build-tag",
image: "golang:1.11",
pull: "always",
name: 'build-tag',
image: 'golang:1.11',
pull: 'always',
environment: {
CGO_ENABLED: "0",
GO111MODULE: "on",
CGO_ENABLED: '0',
GO111MODULE: 'on',
},
commands: [
"go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/" + os + "/" + arch + "/" + name,
'go build -v -ldflags \'-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\' -a -o release/' + os + '/' + arch + '/' + name,
],
when: {
event: [ "tag" ],
event: [ 'tag' ],
},
},
{
name: "executable",
image: "golang:1.11",
pull: "always",
name: 'executable',
image: 'golang:1.11',
pull: 'always',
commands: [
"./release/" + os + "/" + arch + "/" + name + " --help",
'./release/' + os + '/' + arch + '/' + name + ' --help',
],
},
{
name: "dryrun",
image: "plugins/docker:" + os + "-" + arch,
pull: "always",
name: 'dryrun',
image: 'plugins/docker:' + os + '-' + arch,
pull: 'always',
settings: {
daemon_off: false,
dry_run: true,
tags: os + "-" + arch,
dockerfile: "docker/Dockerfile." + os + "." + arch,
repo: "appleboy/" + name,
username: { "from_secret": "docker_username" },
password: { "from_secret": "docker_password" },
tags: os + '-' + arch,
dockerfile: 'docker/Dockerfile.' + os + '.' + arch,
repo: 'appleboy/' + name,
username: { 'from_secret': 'docker_username' },
password: { 'from_secret': 'docker_password' },
},
when: {
event: [ "pull_request" ],
event: [ 'pull_request' ],
},
},
{
name: "publish",
image: "plugins/docker:" + os + "-" + arch,
pull: "always",
name: 'publish',
image: 'plugins/docker:' + os + '-' + arch,
pull: 'always',
settings: {
daemon_off: "false",
daemon_off: 'false',
auto_tag: true,
auto_tag_suffix: os + "-" + arch,
dockerfile: "docker/Dockerfile." + os + "." + arch,
repo: "appleboy/" + name,
username: { "from_secret": "docker_username" },
password: { "from_secret": "docker_password" },
auto_tag_suffix: os + '-' + arch,
dockerfile: 'docker/Dockerfile.' + os + '.' + arch,
repo: 'appleboy/' + name,
username: { 'from_secret': 'docker_username' },
password: { 'from_secret': 'docker_password' },
},
when: {
event: {
exclude: [ "pull_request" ],
exclude: [ 'pull_request' ],
},
},
},
],
depends_on: [
"testing",
'testing',
],
trigger: {
ref: [
"refs/heads/master",
"refs/pulls/**",
"refs/tags/**",
'refs/heads/master',
'refs/pulls/**',
'refs/tags/**',
],
},
};
local PipelineNotifications(os='linux', arch='amd64', depends_on=[]) = {
kind: "pipeline",
name: "notifications",
kind: 'pipeline',
name: 'notifications',
platform: {
os: os,
arch: arch,
@@ -205,29 +205,29 @@ local PipelineNotifications(os='linux', arch='amd64', depends_on=[]) = {
},
steps: [
{
name: "microbadger",
image: "plugins/webhook:1",
pull: "always",
name: 'microbadger',
image: 'plugins/webhook:1',
pull: 'always',
settings: {
url: { "from_secret": "microbadger_url" },
url: { 'from_secret': 'microbadger_url' },
},
},
],
depends_on: depends_on,
trigger: {
branch: [ "master" ],
event: [ "push", "tag" ],
branch: [ 'master' ],
event: [ 'push', 'tag' ],
},
};
[
PipelineTesting,
PipelineBuild(name, "linux", "amd64"),
PipelineBuild(name, "linux", "arm64"),
PipelineBuild(name, "linux", "arm"),
PipelineBuild(name, 'linux', 'amd64'),
PipelineBuild(name, 'linux', 'arm64'),
PipelineBuild(name, 'linux', 'arm'),
PipelineNotifications(depends_on=[
"linux-amd64",
"linux-arm64",
"linux-arm",
'linux-amd64',
'linux-arm64',
'linux-arm',
]),
]
+6 -6
View File
@@ -80,7 +80,7 @@ steps:
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/amd64/drone-discord"
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-discord"
environment:
CGO_ENABLED: 0
GO111MODULE: on
@@ -93,7 +93,7 @@ steps:
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/amd64/drone-discord"
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-discord"
environment:
CGO_ENABLED: 0
GO111MODULE: on
@@ -163,7 +163,7 @@ steps:
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/arm64/drone-discord"
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-discord"
environment:
CGO_ENABLED: 0
GO111MODULE: on
@@ -176,7 +176,7 @@ steps:
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/arm64/drone-discord"
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-discord"
environment:
CGO_ENABLED: 0
GO111MODULE: on
@@ -246,7 +246,7 @@ steps:
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/arm/drone-discord"
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-discord"
environment:
CGO_ENABLED: 0
GO111MODULE: on
@@ -259,7 +259,7 @@ steps:
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/arm/drone-discord"
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-discord"
environment:
CGO_ENABLED: 0
GO111MODULE: on