From 063d0bb32abd37374ae9a85b80151cf12bfdf176 Mon Sep 17 00:00:00 2001 From: Anbraten Date: Thu, 25 Nov 2021 20:43:31 +0100 Subject: [PATCH] Replace DRONE_ with CI_ variables in pipeline steps (#427) Dropped support for `DRONE_*` environment variables in pipeline steps. Pipeline meta-data can be accessed with `CI_*` variables. - `CI_*` prefix replaces `DRONE_*` - `CI` value is now `woodpecker` - `DRONE=true` has been removed --- .woodpecker/docs.yml | 2 +- .woodpecker/helm.yml | 2 +- .woodpecker/main.yml | 14 +- Makefile | 6 +- agent/runner.go | 15 +- cli/exec/exec.go | 3 - cli/exec/flags.go | 92 ++++---- docs/docs/20-usage/50-environment.md | 130 +++++++---- docs/docs/91-migrations.md | 25 +- pipeline/frontend/metadata.go | 213 ++++++++---------- pipeline/frontend/yaml/compiler/convert.go | 2 - pipeline/frontend/yaml/compiler/option.go | 11 - .../frontend/yaml/compiler/option_test.go | 4 +- .../frontend/yaml/compiler/script_posix.go | 4 - .../yaml/compiler/script_posix_test.go | 2 - pipeline/frontend/yaml/compiler/script_win.go | 2 - pipeline/pipeline.go | 8 + pipeline/samples/sample_1/.env | 1 - pipeline/samples/sample_1/pipeline.json | 61 +---- pipeline/samples/sample_10_windows/.env | 1 - .../samples/sample_10_windows/pipeline.json | 78 ++----- pipeline/samples/sample_2/.env | 1 - pipeline/samples/sample_2/pipeline.json | 94 +------- pipeline/samples/sample_3/.env | 2 - pipeline/samples/sample_3/pipeline.json | 95 +------- pipeline/samples/sample_4/.env | 1 - pipeline/samples/sample_4/pipeline.json | 95 +------- pipeline/samples/sample_5/.env | 1 - pipeline/samples/sample_5/pipeline.json | 197 ++-------------- pipeline/samples/sample_6/.env | 1 - pipeline/samples/sample_6/pipeline.json | 118 +++------- pipeline/samples/sample_7_redis/pipeline.json | 46 ++-- .../sample_8_network_mode/pipeline.json | 43 ++-- pipeline/samples/sample_9_cache/.env | 2 - pipeline/samples/sample_9_cache/pipeline.json | 163 ++++---------- server/shared/procBuilder.go | 3 - server/shared/procBuilder_test.go | 4 +- 37 files changed, 437 insertions(+), 1105 deletions(-) diff --git a/.woodpecker/docs.yml b/.woodpecker/docs.yml index 6e3555108..8db168ee2 100644 --- a/.woodpecker/docs.yml +++ b/.woodpecker/docs.yml @@ -32,7 +32,7 @@ pipeline: - git add . # exit successfully if nothing changed - test -n "$(git status --porcelain)" || exit 0 - - git commit -m "Deploy website - based on ${DRONE_COMMIT_SHA}" + - git commit -m "Deploy website - based on ${CI_COMMIT_SHA}" - git push when: event: push diff --git a/.woodpecker/helm.yml b/.woodpecker/helm.yml index dd3d37097..ce5aff1ca 100644 --- a/.woodpecker/helm.yml +++ b/.woodpecker/helm.yml @@ -7,7 +7,7 @@ pipeline: image: alpine/helm:3.5.3 commands: # use tag name or 0.0.0 if not running on a tag - - export CHART_VERSION="${DRONE_TAG##v}" + - export CHART_VERSION="${CI_COMMIT_TAG##v}" - export CHART_VERSION=$${CHART_VERSION:=0.0.0} - echo "Version $CHART_VERSION" - sed -i "s//$CHART_VERSION/g" charts/woodpecker-agent/Chart.yaml diff --git a/.woodpecker/main.yml b/.woodpecker/main.yml index ba893292b..797535c9a 100644 --- a/.woodpecker/main.yml +++ b/.woodpecker/main.yml @@ -192,7 +192,7 @@ pipeline: repo: woodpeckerci/woodpecker-server dockerfile: docker/Dockerfile.server secrets: [docker_username, docker_password] - tag: [latest, "${DRONE_TAG}"] + tag: [latest, "${CI_COMMIT_TAG}"] when: event: tag @@ -202,7 +202,7 @@ pipeline: repo: woodpeckerci/woodpecker-server dockerfile: docker/Dockerfile.server.alpine secrets: [ docker_username, docker_password ] - tag: [latest-alpine, "${DRONE_TAG}-alpine"] + tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"] when: event: tag @@ -212,7 +212,7 @@ pipeline: repo: woodpeckerci/woodpecker-agent dockerfile: docker/Dockerfile.agent secrets: [docker_username, docker_password] - tag: [latest, "${DRONE_TAG}"] + tag: [latest, "${CI_COMMIT_TAG}"] when: event: tag @@ -222,7 +222,7 @@ pipeline: repo: woodpeckerci/woodpecker-agent dockerfile: docker/Dockerfile.agent.alpine secrets: [ docker_username, docker_password ] - tag: [latest-alpine, "${DRONE_TAG}-alpine"] + tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"] when: event: tag @@ -232,7 +232,7 @@ pipeline: repo: woodpeckerci/woodpecker-cli dockerfile: docker/Dockerfile.cli secrets: [docker_username, docker_password] - tag: [latest, "${DRONE_TAG}"] + tag: [latest, "${CI_COMMIT_TAG}"] when: event: tag @@ -242,7 +242,7 @@ pipeline: repo: woodpeckerci/woodpecker-cli dockerfile: docker/Dockerfile.cli.alpine secrets: [ docker_username, docker_password ] - tag: [latest-alpine, "${DRONE_TAG}-alpine"] + tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"] when: event: tag @@ -262,7 +262,7 @@ pipeline: - dist/*.deb - dist/*.rpm - dist/checksums.txt - title: ${DRONE_TAG##v} + title: ${CI_COMMIT_TAG##v} secrets: - source: github_token target: github_release_api_key diff --git a/Makefile b/Makefile index 2aeb048d9..d1a3584dd 100644 --- a/Makefile +++ b/Makefile @@ -3,14 +3,14 @@ GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" - GO_PACKAGES ?= $(shell go list ./... | grep -v /vendor/) VERSION ?= next -ifneq ($(DRONE_TAG),) - VERSION := $(DRONE_TAG:v%=%) +ifneq ($(CI_COMMIT_TAG),) + VERSION := $(CI_COMMIT_TAG:v%=%) endif # append commit-sha to next version BUILD_VERSION := $(VERSION) ifeq ($(BUILD_VERSION),next) - BUILD_VERSION := $(shell echo "next-$(shell echo ${DRONE_COMMIT_SHA} | head -c 8)") + BUILD_VERSION := $(shell echo "next-$(shell echo ${CI_COMMIT_SHA} | head -c 8)") endif LDFLAGS := -s -w -extldflags "-static" -X github.com/woodpecker-ci/woodpecker/version.Version=${BUILD_VERSION} diff --git a/agent/runner.go b/agent/runner.go index 72a1f7086..5eae87e9a 100644 --- a/agent/runner.go +++ b/agent/runner.go @@ -270,26 +270,19 @@ func (r *Runner) Run(ctx context.Context) error { state.Pipeline.Step.Environment = map[string]string{} } - state.Pipeline.Step.Environment["DRONE_MACHINE"] = r.hostname + // TODO: find better way to update this state + state.Pipeline.Step.Environment["CI_MACHINE"] = r.hostname state.Pipeline.Step.Environment["CI_BUILD_STATUS"] = "success" state.Pipeline.Step.Environment["CI_BUILD_STARTED"] = strconv.FormatInt(state.Pipeline.Time, 10) state.Pipeline.Step.Environment["CI_BUILD_FINISHED"] = strconv.FormatInt(time.Now().Unix(), 10) - state.Pipeline.Step.Environment["DRONE_BUILD_STATUS"] = "success" - state.Pipeline.Step.Environment["DRONE_BUILD_STARTED"] = strconv.FormatInt(state.Pipeline.Time, 10) - state.Pipeline.Step.Environment["DRONE_BUILD_FINISHED"] = strconv.FormatInt(time.Now().Unix(), 10) state.Pipeline.Step.Environment["CI_JOB_STATUS"] = "success" state.Pipeline.Step.Environment["CI_JOB_STARTED"] = strconv.FormatInt(state.Pipeline.Time, 10) state.Pipeline.Step.Environment["CI_JOB_FINISHED"] = strconv.FormatInt(time.Now().Unix(), 10) - state.Pipeline.Step.Environment["DRONE_JOB_STATUS"] = "success" - state.Pipeline.Step.Environment["DRONE_JOB_STARTED"] = strconv.FormatInt(state.Pipeline.Time, 10) - state.Pipeline.Step.Environment["DRONE_JOB_FINISHED"] = strconv.FormatInt(time.Now().Unix(), 10) if state.Pipeline.Error != nil { state.Pipeline.Step.Environment["CI_BUILD_STATUS"] = "failure" state.Pipeline.Step.Environment["CI_JOB_STATUS"] = "failure" - state.Pipeline.Step.Environment["DRONE_BUILD_STATUS"] = "failure" - state.Pipeline.Step.Environment["DRONE_JOB_STATUS"] = "failure" } return nil }) @@ -344,10 +337,10 @@ func (r *Runner) Run(ctx context.Context) error { // extract repository name from the configuration func extractRepositoryName(config *backend.Config) string { - return config.Stages[0].Steps[0].Environment["DRONE_REPO"] + return config.Stages[0].Steps[0].Environment["CI_REPO"] } // extract build number from the configuration func extractBuildNumber(config *backend.Config) string { - return config.Stages[0].Steps[0].Environment["DRONE_BUILD_NUMBER"] + return config.Stages[0].Steps[0].Environment["CI_BUILD_NUMBER"] } diff --git a/cli/exec/exec.go b/cli/exec/exec.go index 685ab5349..e0e5f45ca 100644 --- a/cli/exec/exec.go +++ b/cli/exec/exec.go @@ -72,9 +72,6 @@ func execWithAxis(c *cli.Context, axis matrix.Axis) error { metadata := metadataFromContext(c, axis) environ := metadata.Environ() var secrets []compiler.Secret - for k, v := range metadata.EnvironDrone() { - environ[k] = v - } for key, val := range metadata.Job.Matrix { environ[key] = val secrets = append(secrets, compiler.Secret{ diff --git a/cli/exec/flags.go b/cli/exec/flags.go index e670b5b2f..03dca7042 100644 --- a/cli/exec/flags.go +++ b/cli/exec/flags.go @@ -69,12 +69,12 @@ var flags = []cli.Flag{ // workspace default // &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_WORKSPACE_BASE"}, + EnvVars: []string{"CI_WORKSPACE_BASE"}, Name: "workspace-base", Value: "/woodpecker", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_WORKSPACE_PATH"}, + EnvVars: []string{"CI_WORKSPACE_PATH"}, Name: "workspace-path", Value: "src", }, @@ -82,185 +82,185 @@ var flags = []cli.Flag{ // netrc parameters // &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_NETRC_USERNAME"}, + EnvVars: []string{"CI_NETRC_USERNAME"}, Name: "netrc-username", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_NETRC_PASSWORD"}, + EnvVars: []string{"CI_NETRC_PASSWORD"}, Name: "netrc-password", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_NETRC_MACHINE"}, + EnvVars: []string{"CI_NETRC_MACHINE"}, Name: "netrc-machine", }, // // metadata parameters // &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_SYSTEM_ARCH"}, + EnvVars: []string{"CI_SYSTEM_ARCH"}, Name: "system-arch", Value: "linux/amd64", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_SYSTEM_NAME"}, + EnvVars: []string{"CI_SYSTEM_NAME"}, Name: "system-name", Value: "pipec", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_SYSTEM_LINK"}, + EnvVars: []string{"CI_SYSTEM_LINK"}, Name: "system-link", Value: "https://github.com/cncd/pipec", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_REPO_NAME"}, + EnvVars: []string{"CI_REPO_NAME"}, Name: "repo-name", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_REPO_LINK"}, + EnvVars: []string{"CI_REPO_LINK"}, Name: "repo-link", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_REPO_REMOTE"}, + EnvVars: []string{"CI_REPO_REMOTE"}, Name: "repo-remote-url", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_REPO_PRIVATE"}, + EnvVars: []string{"CI_REPO_PRIVATE"}, Name: "repo-private", }, &cli.IntFlag{ - EnvVars: []string{"WOODPECKER_BUILD_NUMBER"}, + EnvVars: []string{"CI_BUILD_NUMBER"}, Name: "build-number", }, &cli.IntFlag{ - EnvVars: []string{"WOODPECKER_PARENT_BUILD_NUMBER"}, + EnvVars: []string{"CI_PARENT_BUILD_NUMBER"}, Name: "parent-build-number", }, &cli.Int64Flag{ - EnvVars: []string{"WOODPECKER_BUILD_CREATED"}, + EnvVars: []string{"CI_BUILD_CREATED"}, Name: "build-created", }, &cli.Int64Flag{ - EnvVars: []string{"WOODPECKER_BUILD_STARTED"}, + EnvVars: []string{"CI_BUILD_STARTED"}, Name: "build-started", }, &cli.Int64Flag{ - EnvVars: []string{"WOODPECKER_BUILD_FINISHED"}, + EnvVars: []string{"CI_BUILD_FINISHED"}, Name: "build-finished", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_BUILD_STATUS"}, + EnvVars: []string{"CI_BUILD_STATUS"}, Name: "build-status", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_BUILD_EVENT"}, + EnvVars: []string{"CI_BUILD_EVENT"}, Name: "build-event", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_BUILD_LINK"}, + EnvVars: []string{"CI_BUILD_LINK"}, Name: "build-link", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_BUILD_TARGET"}, + EnvVars: []string{"CI_BUILD_TARGET"}, Name: "build-target", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_COMMIT_SHA"}, + EnvVars: []string{"CI_COMMIT_SHA"}, Name: "commit-sha", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_COMMIT_REF"}, + EnvVars: []string{"CI_COMMIT_REF"}, Name: "commit-ref", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_COMMIT_REFSPEC"}, + EnvVars: []string{"CI_COMMIT_REFSPEC"}, Name: "commit-refspec", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_COMMIT_BRANCH"}, + EnvVars: []string{"CI_COMMIT_BRANCH"}, Name: "commit-branch", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_COMMIT_MESSAGE"}, + EnvVars: []string{"CI_COMMIT_MESSAGE"}, Name: "commit-message", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_COMMIT_AUTHOR_NAME"}, + EnvVars: []string{"CI_COMMIT_AUTHOR_NAME"}, Name: "commit-author-name", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_COMMIT_AUTHOR_AVATAR"}, + EnvVars: []string{"CI_COMMIT_AUTHOR_AVATAR"}, Name: "commit-author-avatar", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_COMMIT_AUTHOR_EMAIL"}, + EnvVars: []string{"CI_COMMIT_AUTHOR_EMAIL"}, Name: "commit-author-email", }, &cli.IntFlag{ - EnvVars: []string{"WOODPECKER_PREV_BUILD_NUMBER"}, + EnvVars: []string{"CI_PREV_BUILD_NUMBER"}, Name: "prev-build-number", }, &cli.Int64Flag{ - EnvVars: []string{"WOODPECKER_PREV_BUILD_CREATED"}, + EnvVars: []string{"CI_PREV_BUILD_CREATED"}, Name: "prev-build-created", }, &cli.Int64Flag{ - EnvVars: []string{"WOODPECKER_PREV_BUILD_STARTED"}, + EnvVars: []string{"CI_PREV_BUILD_STARTED"}, Name: "prev-build-started", }, &cli.Int64Flag{ - EnvVars: []string{"WOODPECKER_PREV_BUILD_FINISHED"}, + EnvVars: []string{"CI_PREV_BUILD_FINISHED"}, Name: "prev-build-finished", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_PREV_BUILD_STATUS"}, + EnvVars: []string{"CI_PREV_BUILD_STATUS"}, Name: "prev-build-status", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_PREV_BUILD_EVENT"}, + EnvVars: []string{"CI_PREV_BUILD_EVENT"}, Name: "prev-build-event", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_PREV_BUILD_LINK"}, + EnvVars: []string{"CI_PREV_BUILD_LINK"}, Name: "prev-build-link", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_PREV_COMMIT_SHA"}, + EnvVars: []string{"CI_PREV_COMMIT_SHA"}, Name: "prev-commit-sha", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_PREV_COMMIT_REF"}, + EnvVars: []string{"CI_PREV_COMMIT_REF"}, Name: "prev-commit-ref", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_PREV_COMMIT_REFSPEC"}, + EnvVars: []string{"CI_PREV_COMMIT_REFSPEC"}, Name: "prev-commit-refspec", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_PREV_COMMIT_BRANCH"}, + EnvVars: []string{"CI_PREV_COMMIT_BRANCH"}, Name: "prev-commit-branch", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_PREV_COMMIT_MESSAGE"}, + EnvVars: []string{"CI_PREV_COMMIT_MESSAGE"}, Name: "prev-commit-message", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_PREV_COMMIT_AUTHOR_NAME"}, + EnvVars: []string{"CI_PREV_COMMIT_AUTHOR_NAME"}, Name: "prev-commit-author-name", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_PREV_COMMIT_AUTHOR_AVATAR"}, + EnvVars: []string{"CI_PREV_COMMIT_AUTHOR_AVATAR"}, Name: "prev-commit-author-avatar", }, &cli.StringFlag{ - EnvVars: []string{"WOODPECKER_PREV_COMMIT_AUTHOR_EMAIL"}, + EnvVars: []string{"CI_PREV_COMMIT_AUTHOR_EMAIL"}, Name: "prev-commit-author-email", }, &cli.IntFlag{ - EnvVars: []string{"WOODPECKER_JOB_NUMBER"}, + EnvVars: []string{"CI_JOB_NUMBER"}, Name: "job-number", }, &cli.StringSliceFlag{ - EnvVars: []string{"WOODPECKER_ENV"}, + EnvVars: []string{"CI_ENV"}, Name: "env", }, } diff --git a/docs/docs/20-usage/50-environment.md b/docs/docs/20-usage/50-environment.md index b17bfaed9..8b287e1a2 100644 --- a/docs/docs/20-usage/50-environment.md +++ b/docs/docs/20-usage/50-environment.md @@ -44,52 +44,84 @@ pipeline: ## Built-in environment variables -This is the reference list of all environment variables available to your build environment. These are injected into your build and plugins containers, at runtime. +This is the reference list of all environment variables available to your pipeline containers. These are injected into your pipeline step and plugins containers, at runtime. -| NAME | DESC | -| ---------------------------- | -------------------------------------- | -| `CI=drone` | environment is drone | -| `DRONE=true` | environment is drone | -| `DRONE_ARCH` | environment architecture (linux/amd64) | -| `DRONE_REPO` | repository full name | -| `DRONE_REPO_OWNER` | repository owner | -| `DRONE_REPO_NAME` | repository name | -| `DRONE_REPO_SCM` | repository scm (git) | -| `DRONE_REPO_LINK` | repository link | -| `DRONE_REPO_AVATAR` | repository avatar | -| `DRONE_REPO_BRANCH` | repository default branch (master) | -| `DRONE_REPO_PRIVATE` | repository is private | -| `DRONE_REPO_TRUSTED` | repository is trusted | -| `DRONE_REMOTE_URL` | repository clone url | -| `DRONE_COMMIT_SHA` | commit sha | -| `DRONE_COMMIT_REF` | commit ref | -| `DRONE_COMMIT_BRANCH` | commit branch | -| `DRONE_COMMIT_LINK` | commit link in remote | -| `DRONE_COMMIT_MESSAGE` | commit message | -| `DRONE_COMMIT_AUTHOR` | commit author username | -| `DRONE_COMMIT_AUTHOR_EMAIL` | commit author email address | -| `DRONE_COMMIT_AUTHOR_AVATAR` | commit author avatar | -| `DRONE_BUILD_NUMBER` | build number | -| `DRONE_BUILD_EVENT` | build event (push, pull_request, tag) | -| `DRONE_BUILD_STATUS` | build status (success, failure) | -| `DRONE_BUILD_LINK` | build result link | -| `DRONE_BUILD_CREATED` | build created unix timestamp | -| `DRONE_BUILD_STARTED` | build started unix timestamp | -| `DRONE_BUILD_FINISHED` | build finished unix timestamp | -| `DRONE_PREV_BUILD_STATUS` | prior build status | -| `DRONE_PREV_BUILD_NUMBER` | prior build number | -| `DRONE_PREV_COMMIT_SHA` | prior build commit sha | -| `DRONE_JOB_NUMBER` | job number | -| `DRONE_JOB_STATUS` | job status | -| `DRONE_JOB_STARTED` | job started | -| `DRONE_JOB_FINISHED` | job finished | -| `DRONE_BRANCH` | commit branch | -| `DRONE_TARGET_BRANCH` | The target branch of a Pull Request | -| `DRONE_SOURCE_BRANCH` | The source branch of a Pull Request | -| `DRONE_COMMIT` | commit sha | -| `DRONE_TAG` | commit tag | -| `DRONE_PULL_REQUEST` | pull request number | -| `DRONE_DEPLOY_TO` | deployment target (ie production) | +| NAME | Description | +| ------------------------------ | -------------------------------------------------------------------------------------------- | +| `CI=woodpecker` | environment is woodpecker | +| | **Repository** | +| `CI_REPO` | repository full name `/` | +| `CI_REPO_OWNER` | repository owner | +| `CI_REPO_NAME` | repository name | +| `CI_REPO_SCM` | repository scm (git) | +| `CI_REPO_LINK` | repository link | +| `CI_REPO_REMOTE` | repository clone url | +| `CI_REPO_DEFAULT_BRANCH` | repository default branch (master) | +| `CI_REPO_PRIVATE` | repository is private | +| `CI_REPO_TRUSTED` | repository is trusted | +| | **Current Commit** | +| `CI_COMMIT_SHA` | commit sha | +| `CI_COMMIT_REF` | commit ref | +| `CI_COMMIT_REFSPEC` | commit ref spec | +| `CI_COMMIT_BRANCH` | commit branch | +| `CI_COMMIT_SOURCE_BRANCH` | commit source branch | +| `CI_COMMIT_TARGET_BRANCH` | commit target branch | +| `CI_COMMIT_TAG` | commit tag name (empty if event is not `tag`) | +| `CI_COMMIT_PULL_REQUEST` | commit pull request number (empty if event is not `pull_request`) | +| `CI_COMMIT_LINK` | commit link in remote | +| `CI_COMMIT_MESSAGE` | commit message | +| `CI_COMMIT_AUTHOR` | commit author username | +| `CI_COMMIT_AUTHOR_EMAIL` | commit author email address | +| `CI_COMMIT_AUTHOR_AVATAR` | commit author avatar | +| | **Current build** | +| `CI_BUILD_NUMBER` | build number | +| `CI_BUILD_PARENT` | build number of parent build | +| `CI_BUILD_EVENT` | build event (push, pull_request, tag, deployment) | +| `CI_BUILD_LINK` | build link in ci | +| `CI_BUILD_DEPLOY_TARGET` | build deploy target for `deployment` events (ie production) | +| `CI_BUILD_STATUS` | build status (success, failure) | +| `CI_BUILD_CREATED` | build created unix timestamp | +| `CI_BUILD_STARTED` | build started unix timestamp | +| `CI_BUILD_FINISHED` | build finished unix timestamp | +| | **Current job** | +| `CI_JOB_NUMBER` | job number | +| `CI_JOB_STATUS` | job status (success, failure) | +| `CI_JOB_STARTED` | job started unix timestamp | +| `CI_JOB_FINISHED` | job finished unix timestamp | +| | **Previous commit** | +| `CI_PREV_COMMIT_SHA` | previous commit sha | +| `CI_PREV_COMMIT_REF` | previous commit ref | +| `CI_PREV_COMMIT_REFSPEC` | previous commit ref spec | +| `CI_PREV_COMMIT_BRANCH` | previous commit branch | +| `CI_PREV_COMMIT_SOURCE_BRANCH` | previous commit source branch | +| `CI_PREV_COMMIT_TARGET_BRANCH` | previous commit target branch | +| `CI_PREV_COMMIT_LINK` | previous commit link in remote | +| `CI_PREV_COMMIT_MESSAGE` | previous commit message | +| `CI_PREV_COMMIT_AUTHOR` | previous commit author username | +| `CI_PREV_COMMIT_AUTHOR_EMAIL` | previous commit author email address | +| `CI_PREV_COMMIT_AUTHOR_AVATAR` | previous commit author avatar | +| | **Previous build** | +| `CI_PREV_BUILD_NUMBER` | previous build number | +| `CI_PREV_BUILD_PARENT` | previous build number of parent build | +| `CI_PREV_BUILD_EVENT` | previous build event (push, pull_request, tag, deployment) | +| `CI_PREV_BUILD_LINK` | previous build link in ci | +| `CI_PREV_BUILD_DEPLOY_TARGET` | previous build deploy target for `deployment` events (ie production) | +| `CI_PREV_BUILD_STATUS` | previous build status (success, failure) | +| `CI_PREV_BUILD_CREATED` | previous build created unix timestamp | +| `CI_PREV_BUILD_STARTED` | previous build started unix timestamp | +| `CI_PREV_BUILD_FINISHED` | previous build finished unix timestamp | +| |   | +| `CI_WORKSPACE` | Path of the workspace where source code gets cloned to | +| | **System** | +| `CI_SYSTEM_NAME` | name of the ci system: `woodpecker` | +| `CI_SYSTEM_LINK` | link to ci system | +| `CI_SYSTEM_HOST` | hostname of ci server | +| `CI_SYSTEM_VERSION` | version of the server | +| | **Internal** - Please don't use! | +| `CI_SCRIPT` | Internal script path. Used to call pipeline step commands. | +| `CI_NETRC_USERNAME` | Credentials for private repos to be able to clone data. (Only available for specific images) | +| `CI_NETRC_PASSWORD` | Credentials for private repos to be able to clone data. (Only available for specific images) | +| `CI_NETRC_MACHINE` | Credentials for private repos to be able to clone data. (Only available for specific images) | ## Global environment variables @@ -114,7 +146,7 @@ Example commit substitution: pipeline: docker: image: plugins/docker -+ tags: ${DRONE_COMMIT_SHA} ++ tags: ${CI_COMMIT_SHA} ``` Example tag substitution: @@ -123,7 +155,7 @@ Example tag substitution: pipeline: docker: image: plugins/docker -+ tags: ${DRONE_TAG} ++ tags: ${CI_COMMIT_TAG} ``` ## String Operations @@ -150,7 +182,7 @@ Example variable substitution with substring: pipeline: docker: image: plugins/docker -+ tags: ${DRONE_COMMIT_SHA:0:8} ++ tags: ${CI_COMMIT_SHA:0:8} ``` Example variable substitution strips `v` prefix from `v.1.0.0`: @@ -159,5 +191,5 @@ Example variable substitution strips `v` prefix from `v.1.0.0`: pipeline: docker: image: plugins/docker -+ tags: ${DRONE_TAG##v} ++ tags: ${CI_COMMIT_TAG##v} ``` diff --git a/docs/docs/91-migrations.md b/docs/docs/91-migrations.md index 78c5c3321..783d87b8c 100644 --- a/docs/docs/91-migrations.md +++ b/docs/docs/91-migrations.md @@ -12,6 +12,9 @@ Some versions need some changes to the server configuration or the pipeline conf Read more about it at the [Project Settings](/docs/usage/project-settings#pipeline-path) +- From version `0.15.0` ongoing there will be three types of docker images: `latest`, `next` and `x.x.x` with an alpine variant for each type like `latest-alpine`. + If you used `latest` before to try pre-release features you should switch to `next` after this release. + - Dropped support for `DRONE_*` environment variables. The according `WOODPECKER_*` variables must be used instead. Additionally some alternative namings have been removed to simplify maintenance: - `WOODPECKER_AGENT_SECRET` replaces `WOODPECKER_SECRET`, `DRONE_SECRET`, `WOODPECKER_PASSWORD`, `DRONE_PASSWORD` and `DRONE_AGENT_SECRET`. @@ -19,8 +22,26 @@ Some versions need some changes to the server configuration or the pipeline conf - `WOODPECKER_DATABASE_DRIVER` replaces `DRONE_DATABASE_DRIVER` and `DATABASE_DRIVER`. - `WOODPECKER_DATABASE_DATASOURCE` replaces `DRONE_DATABASE_DATASOURCE` and `DATABASE_CONFIG`. -- From version `0.15.0` ongoing there will be three types of docker images: `latest`, `next` and `x.x.x` with an alpine variant for each type like `latest-alpine`. - If you used `latest` before to try pre-release features you should switch to `next` after this release. +- Dropped support for `DRONE_*` environment variables in pipeline steps. Pipeline meta-data can be accessed with `CI_*` variables. + - `CI_*` prefix replaces `DRONE_*` + - `CI` value is now `woodpecker` + - `DRONE=true` has been removed + - Some variables got deprecated and will be removed in future versions. Please migrate to the new names. Same applies for `DRONE_` of them. + - CI_ARCH => use CI_SYSTEM_ARCH + - CI_COMMIT => CI_COMMIT_SHA + - CI_REMOTE_URL => use CI_REPO_REMOTE + - CI_REPO_BRANCH => use CI_REPO_DEFAULT_BRANCH + - CI_PARENT_BUILD_NUMBER => use CI_BUILD_PARENT + - CI_BUILD_TARGET => use CI_BUILD_DEPLOY_TARGET + - CI_DEPLOY_TO => use CI_BUILD_DEPLOY_TARGET + - CI_COMMIT_AUTHOR_NAME => use CI_COMMIT_AUTHOR + - CI_PREV_COMMIT_AUTHOR_NAME => use CI_PREV_COMMIT_AUTHOR + - CI_SYSTEM => use CI_SYSTEM_NAME + - CI_BRANCH => use CI_COMMIT_BRANCH + - CI_SOURCE_BRANCH => use CI_COMMIT_SOURCE_BRANCH + - CI_TARGET_BRANCH => use CI_COMMIT_TARGET_BRANCH + + For all available variables and their descriptions have a look at [built-in-environment-variables](/docs/usage/environment#built-in-environment-variables). - Prometheus metrics have been changed from `drone_*` to `woodpecker_*` diff --git a/pipeline/frontend/metadata.go b/pipeline/frontend/metadata.go index 17a5179c6..6d57c1079 100644 --- a/pipeline/frontend/metadata.go +++ b/pipeline/frontend/metadata.go @@ -1,10 +1,11 @@ package frontend import ( - "fmt" "regexp" "strconv" "strings" + + "github.com/woodpecker-ci/woodpecker/version" ) // Event types corresponding to scm hooks. @@ -96,55 +97,108 @@ type ( // Environ returns the metadata as a map of environment variables. func (m *Metadata) Environ() map[string]string { + var ( + repoOwner string + repoName string + sourceBranch string + targetBranch string + ) + + repoParts := strings.Split(m.Repo.Name, "/") + if len(repoParts) == 2 { + repoOwner = repoParts[0] + repoName = repoParts[1] + } else { + repoName = m.Repo.Name + } + + branchParts := strings.Split(m.Curr.Commit.Refspec, ":") + if len(branchParts) == 2 { + sourceBranch = branchParts[0] + targetBranch = branchParts[1] + } + params := map[string]string{ - "CI_REPO": m.Repo.Name, - "CI_REPO_NAME": m.Repo.Name, - "CI_REPO_LINK": m.Repo.Link, - "CI_REPO_REMOTE": m.Repo.Remote, - "CI_REMOTE_URL": m.Repo.Remote, - "CI_REPO_PRIVATE": strconv.FormatBool(m.Repo.Private), - "CI_BUILD_NUMBER": strconv.FormatInt(m.Curr.Number, 10), - "CI_PARENT_BUILD_NUMBER": strconv.FormatInt(m.Curr.Parent, 10), - "CI_BUILD_CREATED": strconv.FormatInt(m.Curr.Created, 10), - "CI_BUILD_STARTED": strconv.FormatInt(m.Curr.Started, 10), - "CI_BUILD_FINISHED": strconv.FormatInt(m.Curr.Finished, 10), - "CI_BUILD_STATUS": m.Curr.Status, - "CI_BUILD_EVENT": m.Curr.Event, - "CI_BUILD_LINK": m.Curr.Link, - "CI_BUILD_TARGET": m.Curr.Target, - "CI_COMMIT_SHA": m.Curr.Commit.Sha, - "CI_COMMIT_REF": m.Curr.Commit.Ref, - "CI_COMMIT_REFSPEC": m.Curr.Commit.Refspec, - "CI_COMMIT_BRANCH": m.Curr.Commit.Branch, - "CI_COMMIT_MESSAGE": m.Curr.Commit.Message, - "CI_COMMIT_AUTHOR": m.Curr.Commit.Author.Name, - "CI_COMMIT_AUTHOR_NAME": m.Curr.Commit.Author.Name, - "CI_COMMIT_AUTHOR_EMAIL": m.Curr.Commit.Author.Email, - "CI_COMMIT_AUTHOR_AVATAR": m.Curr.Commit.Author.Avatar, - "CI_PREV_BUILD_NUMBER": strconv.FormatInt(m.Prev.Number, 10), - "CI_PREV_BUILD_CREATED": strconv.FormatInt(m.Prev.Created, 10), - "CI_PREV_BUILD_STARTED": strconv.FormatInt(m.Prev.Started, 10), - "CI_PREV_BUILD_FINISHED": strconv.FormatInt(m.Prev.Finished, 10), - "CI_PREV_BUILD_STATUS": m.Prev.Status, - "CI_PREV_BUILD_EVENT": m.Prev.Event, - "CI_PREV_BUILD_LINK": m.Prev.Link, + "CI": m.Sys.Name, + "CI_REPO": m.Repo.Name, + "CI_REPO_OWNER": repoOwner, + "CI_REPO_NAME": repoName, + "CI_REPO_SCM": "git", + "CI_REPO_LINK": m.Repo.Link, + "CI_REPO_REMOTE": m.Repo.Remote, + "CI_REPO_DEFAULT_BRANCH": m.Repo.Branch, + "CI_REPO_PRIVATE": strconv.FormatBool(m.Repo.Private), + "CI_REPO_TRUSTED": "false", // TODO should this be added? + + "CI_COMMIT_SHA": m.Curr.Commit.Sha, + "CI_COMMIT_REF": m.Curr.Commit.Ref, + "CI_COMMIT_REFSPEC": m.Curr.Commit.Refspec, + "CI_COMMIT_BRANCH": m.Curr.Commit.Branch, + "CI_COMMIT_SOURCE_BRANCH": sourceBranch, + "CI_COMMIT_TARGET_BRANCH": targetBranch, + "CI_COMMIT_LINK": m.Curr.Link, + "CI_COMMIT_MESSAGE": m.Curr.Commit.Message, + "CI_COMMIT_AUTHOR": m.Curr.Commit.Author.Name, + "CI_COMMIT_AUTHOR_EMAIL": m.Curr.Commit.Author.Email, + "CI_COMMIT_AUTHOR_AVATAR": m.Curr.Commit.Author.Avatar, + "CI_TAG": "", // will be set if event is tag + "CI_PULL_REQUEST": "", // will be set if event is pr + + "CI_BUILD_NUMBER": strconv.FormatInt(m.Curr.Number, 10), + "CI_BUILD_PARENT": strconv.FormatInt(m.Curr.Parent, 10), + "CI_BUILD_EVENT": m.Curr.Event, + "CI_BUILD_LINK": m.Curr.Link, + "CI_BUILD_DEPLOY_TARGET": m.Curr.Target, + "CI_BUILD_STATUS": m.Curr.Status, + "CI_BUILD_CREATED": strconv.FormatInt(m.Curr.Created, 10), + "CI_BUILD_STARTED": strconv.FormatInt(m.Curr.Started, 10), + "CI_BUILD_FINISHED": strconv.FormatInt(m.Curr.Finished, 10), + + "CI_JOB_NUMBER": strconv.Itoa(m.Job.Number), + "CI_JOB_STATUS": "", // will be set by agent + "CI_JOB_STARTED": "", // will be set by agent + "CI_JOB_FINISHED": "", // will be set by agent + "CI_PREV_COMMIT_SHA": m.Prev.Commit.Sha, "CI_PREV_COMMIT_REF": m.Prev.Commit.Ref, "CI_PREV_COMMIT_REFSPEC": m.Prev.Commit.Refspec, "CI_PREV_COMMIT_BRANCH": m.Prev.Commit.Branch, + "CI_PREV_COMMIT_LINK": m.Prev.Link, "CI_PREV_COMMIT_MESSAGE": m.Prev.Commit.Message, "CI_PREV_COMMIT_AUTHOR": m.Prev.Commit.Author.Name, - "CI_PREV_COMMIT_AUTHOR_NAME": m.Prev.Commit.Author.Name, "CI_PREV_COMMIT_AUTHOR_EMAIL": m.Prev.Commit.Author.Email, "CI_PREV_COMMIT_AUTHOR_AVATAR": m.Prev.Commit.Author.Avatar, - "CI_JOB_NUMBER": strconv.Itoa(m.Job.Number), - "CI_SYSTEM": m.Sys.Name, - "CI_SYSTEM_NAME": m.Sys.Name, - "CI_SYSTEM_LINK": m.Sys.Link, - "CI_SYSTEM_HOST": m.Sys.Host, - "CI_SYSTEM_ARCH": m.Sys.Arch, - "CI_SYSTEM_VERSION": m.Sys.Version, - "CI": m.Sys.Name, + + "CI_PREV_BUILD_NUMBER": strconv.FormatInt(m.Prev.Number, 10), + "CI_PREV_BUILD_PARENT": strconv.FormatInt(m.Prev.Parent, 10), + "CI_PREV_BUILD_EVENT": m.Prev.Event, + "CI_PREV_BUILD_LINK": m.Prev.Link, + "CI_PREV_BUILD_DEPLOY_TARGET": m.Prev.Target, + "CI_PREV_BUILD_STATUS": m.Prev.Status, + "CI_PREV_BUILD_CREATED": strconv.FormatInt(m.Prev.Created, 10), + "CI_PREV_BUILD_STARTED": strconv.FormatInt(m.Prev.Started, 10), + "CI_PREV_BUILD_FINISHED": strconv.FormatInt(m.Prev.Finished, 10), + + "CI_SYSTEM_NAME": m.Sys.Name, + "CI_SYSTEM_LINK": m.Sys.Link, + "CI_SYSTEM_HOST": m.Sys.Host, + "CI_SYSTEM_ARCH": m.Sys.Arch, + "CI_SYSTEM_VERSION": version.Version, + + // DEPRECATED + "CI_ARCH": m.Sys.Arch, // use CI_SYSTEM_ARCH + "CI_COMMIT": m.Curr.Commit.Sha, // use CI_COMMIT_SHA + "CI_REMOTE_URL": m.Repo.Remote, // use CI_REPO_REMOTE + "CI_REPO_BRANCH": m.Repo.Branch, // use CI_REPO_DEFAULT_BRANCH + "CI_PARENT_BUILD_NUMBER": strconv.FormatInt(m.Curr.Parent, 10), // use CI_BUILD_PARENT + "CI_BUILD_TARGET": m.Curr.Target, // use CI_BUILD_DEPLOY_TARGET + "CI_DEPLOY_TO": m.Curr.Target, // use CI_BUILD_DEPLOY_TARGET + "CI_COMMIT_AUTHOR_NAME": m.Curr.Commit.Author.Name, // use CI_COMMIT_AUTHOR + "CI_PREV_COMMIT_AUTHOR_NAME": m.Prev.Commit.Author.Name, // use CI_PREV_COMMIT_AUTHOR + "CI_SYSTEM": m.Sys.Name, // use CI_SYSTEM_NAME + "CI_BRANCH": m.Curr.Commit.Branch, // use CI_COMMIT_BRANCH + "CI_SOURCE_BRANCH": sourceBranch, // use CI_COMMIT_SOURCE_BRANCH + "CI_TARGET_BRANCH": targetBranch, // use CI_COMMIT_TARGET_BRANCH } if m.Curr.Event == EventTag { params["CI_TAG"] = strings.TrimPrefix(m.Curr.Commit.Ref, "refs/tags/") @@ -152,84 +206,7 @@ func (m *Metadata) Environ() map[string]string { if m.Curr.Event == EventPull { params["CI_PULL_REQUEST"] = pullRegexp.FindString(m.Curr.Commit.Ref) } - return params -} -// EnvironDrone returns metadata as a map of DRONE_ environment variables. -// TODO: This is here for backward compatibility and will eventually be removed. -func (m *Metadata) EnvironDrone() map[string]string { - // MISSING PARAMETERS - // * DRONE_REPO_TRUSTED - // * DRONE_YAML_VERIFIED - // * DRONE_YAML_VERIFIED - var ( - owner string - name string - sourceBranch string - targetBranch string - - repoParts = strings.Split(m.Repo.Name, "/") - branchParts = strings.Split(m.Curr.Commit.Refspec, ":") - ) - if len(repoParts) == 2 { - owner = repoParts[0] - name = repoParts[1] - } else { - name = m.Repo.Name - } - - if len(branchParts) == 2 { - sourceBranch = branchParts[0] - targetBranch = branchParts[1] - } - - params := map[string]string{ - "CI": "drone", - "DRONE": "true", - "DRONE_ARCH": m.Sys.Arch, - "DRONE_REPO": m.Repo.Name, - "DRONE_REPO_SCM": "git", - "DRONE_REPO_OWNER": owner, - "DRONE_REPO_NAME": name, - "DRONE_REPO_LINK": m.Repo.Link, - "DRONE_REPO_BRANCH": m.Repo.Branch, - "DRONE_REPO_PRIVATE": fmt.Sprintf("%v", m.Repo.Private), - "DRONE_REPO_TRUSTED": "false", // TODO should this be added? - "DRONE_REMOTE_URL": m.Repo.Remote, - "DRONE_COMMIT_SHA": m.Curr.Commit.Sha, - "DRONE_COMMIT_REF": m.Curr.Commit.Ref, - "DRONE_COMMIT_REFSPEC": m.Curr.Commit.Refspec, - "DRONE_COMMIT_BRANCH": m.Curr.Commit.Branch, - "DRONE_COMMIT_LINK": m.Curr.Link, - "DRONE_COMMIT_MESSAGE": m.Curr.Commit.Message, - "DRONE_COMMIT_AUTHOR": m.Curr.Commit.Author.Name, - "DRONE_COMMIT_AUTHOR_EMAIL": m.Curr.Commit.Author.Email, - "DRONE_COMMIT_AUTHOR_AVATAR": m.Curr.Commit.Author.Avatar, - "DRONE_BUILD_NUMBER": fmt.Sprintf("%d", m.Curr.Number), - "DRONE_PARENT_BUILD_NUMBER": fmt.Sprintf("%d", m.Curr.Parent), - "DRONE_BUILD_EVENT": m.Curr.Event, - "DRONE_BUILD_LINK": fmt.Sprintf("%s/%s/%d", m.Sys.Link, m.Repo.Name, m.Curr.Number), - "DRONE_BUILD_CREATED": fmt.Sprintf("%d", m.Curr.Created), - "DRONE_BUILD_STARTED": fmt.Sprintf("%d", m.Curr.Started), - "DRONE_BUILD_FINISHED": fmt.Sprintf("%d", m.Curr.Finished), - "DRONE_JOB_NUMBER": fmt.Sprintf("%d", m.Job.Number), - "DRONE_JOB_STARTED": fmt.Sprintf("%d", m.Curr.Started), // ISSUE: no job started - "DRONE_BRANCH": m.Curr.Commit.Branch, - "DRONE_SOURCE_BRANCH": sourceBranch, - "DRONE_TARGET_BRANCH": targetBranch, - "DRONE_COMMIT": m.Curr.Commit.Sha, - "DRONE_VERSION": m.Sys.Version, - "DRONE_DEPLOY_TO": m.Curr.Target, - "DRONE_PREV_BUILD_STATUS": m.Prev.Status, - "DRONE_PREV_BUILD_NUMBER": fmt.Sprintf("%v", m.Prev.Number), - "DRONE_PREV_COMMIT_SHA": m.Prev.Commit.Sha, - } - if m.Curr.Event == EventTag || strings.HasPrefix(m.Curr.Commit.Ref, "refs/tags/") { - params["DRONE_TAG"] = strings.TrimPrefix(m.Curr.Commit.Ref, "refs/tags/") - } - if m.Curr.Event == EventPull { - params["DRONE_PULL_REQUEST"] = pullRegexp.FindString(m.Curr.Commit.Ref) - } return params } diff --git a/pipeline/frontend/yaml/compiler/convert.go b/pipeline/frontend/yaml/compiler/convert.go index 9832ca4aa..413682426 100644 --- a/pipeline/frontend/yaml/compiler/convert.go +++ b/pipeline/frontend/yaml/compiler/convert.go @@ -62,8 +62,6 @@ func (c *Compiler) createProcess(name string, container *yaml.Container, section } environment["CI_WORKSPACE"] = path.Join(c.base, c.path) - // TODO: This is here for backward compatibility and will eventually be removed. - environment["DRONE_WORKSPACE"] = path.Join(c.base, c.path) if section == "services" || container.Detached { detached = true diff --git a/pipeline/frontend/yaml/compiler/option.go b/pipeline/frontend/yaml/compiler/option.go index 119fb78f3..adcc31c46 100644 --- a/pipeline/frontend/yaml/compiler/option.go +++ b/pipeline/frontend/yaml/compiler/option.go @@ -60,11 +60,6 @@ func WithMetadata(metadata frontend.Metadata) Option { for k, v := range metadata.Environ() { compiler.env[k] = v } - // TODO this is present for backward compatibility and should - // be removed in a future version. - for k, v := range metadata.EnvironDrone() { - compiler.env[k] = v - } } } @@ -76,12 +71,6 @@ func WithNetrc(username, password, machine string) Option { "CI_NETRC_USERNAME": username, "CI_NETRC_PASSWORD": password, "CI_NETRC_MACHINE": machine, - - // TODO: This is present for backward compatibility and should - // be removed in a future version. - "DRONE_NETRC_USERNAME": username, - "DRONE_NETRC_PASSWORD": password, - "DRONE_NETRC_MACHINE": machine, }, ) } diff --git a/pipeline/frontend/yaml/compiler/option_test.go b/pipeline/frontend/yaml/compiler/option_test.go index a2f5254e3..663312ed4 100644 --- a/pipeline/frontend/yaml/compiler/option_test.go +++ b/pipeline/frontend/yaml/compiler/option_test.go @@ -3,6 +3,7 @@ package compiler import ( "os" "reflect" + "strings" "testing" "github.com/woodpecker-ci/woodpecker/pipeline/frontend" @@ -111,7 +112,8 @@ func TestWithMetadata(t *testing.T) { if !reflect.DeepEqual(compiler.metadata, metadata) { t.Errorf("WithMetadata must set compiler the metadata") } - if compiler.env["CI_REPO_NAME"] != metadata.Repo.Name { + + if compiler.env["CI_REPO_NAME"] != strings.Split(metadata.Repo.Name, "/")[1] { t.Errorf("WithMetadata must set CI_REPO_NAME") } if compiler.env["CI_REPO_LINK"] != metadata.Repo.Link { diff --git a/pipeline/frontend/yaml/compiler/script_posix.go b/pipeline/frontend/yaml/compiler/script_posix.go index 7db43f33b..a4c6574a1 100644 --- a/pipeline/frontend/yaml/compiler/script_posix.go +++ b/pipeline/frontend/yaml/compiler/script_posix.go @@ -29,8 +29,6 @@ func generateScriptPosix(commands []string) string { // setupScript is a helper script this is added to the build to ensure // a minimum set of environment variables are set correctly. -// TODO: Unsetting DRONE_* is present for backward compatibility and should -// be removed in a future version. const setupScript = ` if [ -n "$CI_NETRC_MACHINE" ]; then cat < $HOME/.netrc @@ -43,8 +41,6 @@ fi unset CI_NETRC_USERNAME unset CI_NETRC_PASSWORD unset CI_SCRIPT -unset DRONE_NETRC_USERNAME -unset DRONE_NETRC_PASSWORD %s ` diff --git a/pipeline/frontend/yaml/compiler/script_posix_test.go b/pipeline/frontend/yaml/compiler/script_posix_test.go index 82753f878..4e5e7ae04 100644 --- a/pipeline/frontend/yaml/compiler/script_posix_test.go +++ b/pipeline/frontend/yaml/compiler/script_posix_test.go @@ -26,8 +26,6 @@ fi unset CI_NETRC_USERNAME unset CI_NETRC_PASSWORD unset CI_SCRIPT -unset DRONE_NETRC_USERNAME -unset DRONE_NETRC_PASSWORD echo + "echo \${PATH}" echo ${PATH} diff --git a/pipeline/frontend/yaml/compiler/script_win.go b/pipeline/frontend/yaml/compiler/script_win.go index 6d1201001..b9e021a24 100644 --- a/pipeline/frontend/yaml/compiler/script_win.go +++ b/pipeline/frontend/yaml/compiler/script_win.go @@ -36,8 +36,6 @@ $netrc=[string]::Format("{0}\_netrc",$Env:HOME); }; [Environment]::SetEnvironmentVariable("CI_NETRC_PASSWORD",$null); [Environment]::SetEnvironmentVariable("CI_SCRIPT",$null); -[Environment]::SetEnvironmentVariable("DRONE_NETRC_USERNAME",$null); -[Environment]::SetEnvironmentVariable("DRONE_NETRC_PASSWORD",$null); %s ` diff --git a/pipeline/pipeline.go b/pipeline/pipeline.go index 2b1e5dadb..2a814bd24 100644 --- a/pipeline/pipeline.go +++ b/pipeline/pipeline.go @@ -2,6 +2,7 @@ package pipeline import ( "context" + "strings" "time" "github.com/rs/zerolog/log" @@ -127,6 +128,13 @@ func (r *Runtime) exec(proc *backend.Step) error { } } + // TODO: using DRONE_ will be deprecated with 0.15.0. remove fallback with following release + for key, value := range proc.Environment { + if strings.HasPrefix(key, "CI_") { + proc.Environment[strings.Replace(key, "CI_", "DRONE_", 1)] = value + } + } + if err := r.engine.Exec(r.ctx, proc); err != nil { return err } diff --git a/pipeline/samples/sample_1/.env b/pipeline/samples/sample_1/.env index 50dfaf1b8..c6c64ae69 100644 --- a/pipeline/samples/sample_1/.env +++ b/pipeline/samples/sample_1/.env @@ -14,4 +14,3 @@ CI_COMMIT_REFSPEC= CI_COMMIT_BRANCH=master CI_COMMIT_MESSAGE="added a few more test cases for escaping behavior" CI_COMMIT_AUTHOR=bradrydzewski -CI_COMMIT_AUTHOR_NAME=bradrydzewski diff --git a/pipeline/samples/sample_1/pipeline.json b/pipeline/samples/sample_1/pipeline.json index 9897cf5fc..a74e3e00f 100644 --- a/pipeline/samples/sample_1/pipeline.json +++ b/pipeline/samples/sample_1/pipeline.json @@ -16,7 +16,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -31,31 +30,9 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "PLUGIN_DEPTH": "50" }, - "volumes": [ - "pipeline_default:/go" - ], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -83,7 +60,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -99,39 +75,12 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/go" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -156,4 +105,4 @@ "driver": "local" } ] -} \ No newline at end of file +} diff --git a/pipeline/samples/sample_10_windows/.env b/pipeline/samples/sample_10_windows/.env index 50dfaf1b8..c6c64ae69 100644 --- a/pipeline/samples/sample_10_windows/.env +++ b/pipeline/samples/sample_10_windows/.env @@ -14,4 +14,3 @@ CI_COMMIT_REFSPEC= CI_COMMIT_BRANCH=master CI_COMMIT_MESSAGE="added a few more test cases for escaping behavior" CI_COMMIT_AUTHOR=bradrydzewski -CI_COMMIT_AUTHOR_NAME=bradrydzewski diff --git a/pipeline/samples/sample_10_windows/pipeline.json b/pipeline/samples/sample_10_windows/pipeline.json index fa7f57382..956179c45 100644 --- a/pipeline/samples/sample_10_windows/pipeline.json +++ b/pipeline/samples/sample_10_windows/pipeline.json @@ -16,7 +16,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -31,39 +30,20 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "c:\\gopath/src\\github.com\\drone\\envsubst", - "DRONE": "true", - "DRONE_ARCH": "windows/amd64", - "DRONE_BRANCH": "master", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_JOB_STARTED": "1486119585", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "envsubst", - "DRONE_REPO_OWNER": "drone", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "c:\\gopath/src\\github.com\\drone\\envsubst", + "CI_ARCH": "windows/amd64", + "CI_BRANCH": "master", + "CI_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", + "CI_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", + "CI_JOB_STARTED": "1486119585", + "CI_REPO_OWNER": "drone", + "CI_REPO_SCM": "git", "PLUGIN_DEPTH": "50" }, - "volumes": [ - "pipeline_default:c:\\gopath" - ], + "volumes": ["pipeline_default:c:\\gopath"], "networks": [ { "name": "pipeline_default", - "aliases": [ - "git" - ] + "aliases": ["git"] } ], "on_success": true, @@ -87,7 +67,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -103,28 +82,13 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "c:\\gopath/src\\github.com\\drone\\envsubst", - "DRONE": "true", - "DRONE_ARCH": "windows/amd64", - "DRONE_BRANCH": "master", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_JOB_STARTED": "1486119585", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "envsubst", - "DRONE_REPO_OWNER": "drone", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "c:\\gopath/src\\github.com\\drone\\envsubst", + "CI_ARCH": "windows/amd64", + "CI_BRANCH": "master", + "CI_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", + "CI_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", + "CI_JOB_STARTED": "1486119585", + "CI_REPO_OWNER": "drone", + "CI_REPO_SCM": "git", "HOME": "c:\\root", "SHELL": "powershell.exe" }, @@ -137,15 +101,11 @@ "command": [ "[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($Env:CI_SCRIPT)) | iex" ], - "volumes": [ - "pipeline_default:c:\\gopath" - ], + "volumes": ["pipeline_default:c:\\gopath"], "networks": [ { "name": "pipeline_default", - "aliases": [ - "build" - ] + "aliases": ["build"] } ], "on_success": true, @@ -167,4 +127,4 @@ } ], "secrets": null -} \ No newline at end of file +} diff --git a/pipeline/samples/sample_2/.env b/pipeline/samples/sample_2/.env index b4799f93f..41db77b71 100644 --- a/pipeline/samples/sample_2/.env +++ b/pipeline/samples/sample_2/.env @@ -14,4 +14,3 @@ CI_COMMIT_REFSPEC= CI_COMMIT_BRANCH=master CI_COMMIT_MESSAGE="Fix many urls" CI_COMMIT_AUTHOR=egorsmkv -CI_COMMIT_AUTHOR_NAME=egorsmkv diff --git a/pipeline/samples/sample_2/pipeline.json b/pipeline/samples/sample_2/pipeline.json index cf931d3ae..6a20e6319 100644 --- a/pipeline/samples/sample_2/pipeline.json +++ b/pipeline/samples/sample_2/pipeline.json @@ -15,7 +15,6 @@ "CI_BUILD_NUMBER": "530", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "egorsmkv", - "CI_COMMIT_AUTHOR_NAME": "egorsmkv", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "Fix many urls", "CI_COMMIT_REF": "refs/heads/master", @@ -30,31 +29,9 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/go-sql-driver/mysql", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "530", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "egorsmkv", - "DRONE_COMMIT_AUTHOR_NAME": "egorsmkv", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "Fix many urls", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "2e00b5cd70399450106cec6431c2e2ce3cae5034", - "DRONE_REMOTE_URL": "https://github.com/go-sql-driver/mysql.git", - "DRONE_REPO": "go-sql-driver/mysql", - "DRONE_REPO_LINK": "https://github.com/go-sql-driver/mysql", - "DRONE_REPO_NAME": "go-sql-driver/mysql", - "DRONE_REPO_REMOTE": "https://github.com/go-sql-driver/mysql.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/go-sql-driver/mysql", "PLUGIN_DEPTH": "0" }, - "volumes": [ - "pipeline_default:/go" - ], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -82,7 +59,6 @@ "CI_BUILD_NUMBER": "530", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "egorsmkv", - "CI_COMMIT_AUTHOR_NAME": "egorsmkv", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "Fix many urls", "CI_COMMIT_REF": "refs/heads/master", @@ -97,38 +73,14 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/go-sql-driver/mysql", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "530", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "egorsmkv", - "DRONE_COMMIT_AUTHOR_NAME": "egorsmkv", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "Fix many urls", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "2e00b5cd70399450106cec6431c2e2ce3cae5034", - "DRONE_REMOTE_URL": "https://github.com/go-sql-driver/mysql.git", - "DRONE_REPO": "go-sql-driver/mysql", - "DRONE_REPO_LINK": "https://github.com/go-sql-driver/mysql", - "DRONE_REPO_NAME": "go-sql-driver/mysql", - "DRONE_REPO_REMOTE": "https://github.com/go-sql-driver/mysql.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/go-sql-driver/mysql", "MYSQL_ALLOW_EMPTY_PASSWORD": "yes", "MYSQL_DATABASE": "gotest" }, - "volumes": [ - "pipeline_default:/go" - ], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", - "aliases": [ - "database" - ] + "aliases": ["database"] } ], "on_success": true, @@ -152,7 +104,6 @@ "CI_BUILD_NUMBER": "530", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "egorsmkv", - "CI_COMMIT_AUTHOR_NAME": "egorsmkv", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "Fix many urls", "CI_COMMIT_REF": "refs/heads/master", @@ -168,46 +119,17 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/go-sql-driver/mysql", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "530", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "egorsmkv", - "DRONE_COMMIT_AUTHOR_NAME": "egorsmkv", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "Fix many urls", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "2e00b5cd70399450106cec6431c2e2ce3cae5034", - "DRONE_REMOTE_URL": "https://github.com/go-sql-driver/mysql.git", - "DRONE_REPO": "go-sql-driver/mysql", - "DRONE_REPO_LINK": "https://github.com/go-sql-driver/mysql", - "DRONE_REPO_NAME": "go-sql-driver/mysql", - "DRONE_REPO_REMOTE": "https://github.com/go-sql-driver/mysql.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/go-sql-driver/mysql", "HOME": "/root", "MYSQL_TEST_ADDR": "database:3306", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/go" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", - "aliases": [ - "database" - ] + "aliases": ["database"] } ], "on_success": true, @@ -228,4 +150,4 @@ "driver": "local" } ] -} \ No newline at end of file +} diff --git a/pipeline/samples/sample_3/.env b/pipeline/samples/sample_3/.env index 4c1e6ca4b..c6c64ae69 100644 --- a/pipeline/samples/sample_3/.env +++ b/pipeline/samples/sample_3/.env @@ -14,5 +14,3 @@ CI_COMMIT_REFSPEC= CI_COMMIT_BRANCH=master CI_COMMIT_MESSAGE="added a few more test cases for escaping behavior" CI_COMMIT_AUTHOR=bradrydzewski -CI_COMMIT_AUTHOR_NAME=bradrydzewski - diff --git a/pipeline/samples/sample_3/pipeline.json b/pipeline/samples/sample_3/pipeline.json index 910dc9542..5643deaa8 100644 --- a/pipeline/samples/sample_3/pipeline.json +++ b/pipeline/samples/sample_3/pipeline.json @@ -16,7 +16,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -31,31 +30,9 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "PLUGIN_DEPTH": "50" }, - "volumes": [ - "pipeline_default:/go" - ], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -83,7 +60,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -99,39 +75,12 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/go" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -159,7 +108,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -175,39 +123,12 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/go" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -232,4 +153,4 @@ "driver": "local" } ] -} \ No newline at end of file +} diff --git a/pipeline/samples/sample_4/.env b/pipeline/samples/sample_4/.env index 50dfaf1b8..c6c64ae69 100644 --- a/pipeline/samples/sample_4/.env +++ b/pipeline/samples/sample_4/.env @@ -14,4 +14,3 @@ CI_COMMIT_REFSPEC= CI_COMMIT_BRANCH=master CI_COMMIT_MESSAGE="added a few more test cases for escaping behavior" CI_COMMIT_AUTHOR=bradrydzewski -CI_COMMIT_AUTHOR_NAME=bradrydzewski diff --git a/pipeline/samples/sample_4/pipeline.json b/pipeline/samples/sample_4/pipeline.json index 5c50b1c88..a1a81b5af 100644 --- a/pipeline/samples/sample_4/pipeline.json +++ b/pipeline/samples/sample_4/pipeline.json @@ -16,7 +16,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -31,31 +30,9 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "PLUGIN_DEPTH": "50" }, - "volumes": [ - "pipeline_default:/go" - ], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -83,7 +60,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -99,39 +75,12 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/go" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -159,7 +108,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -175,39 +123,12 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/go" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -232,4 +153,4 @@ "driver": "local" } ] -} \ No newline at end of file +} diff --git a/pipeline/samples/sample_5/.env b/pipeline/samples/sample_5/.env index 50dfaf1b8..c6c64ae69 100644 --- a/pipeline/samples/sample_5/.env +++ b/pipeline/samples/sample_5/.env @@ -14,4 +14,3 @@ CI_COMMIT_REFSPEC= CI_COMMIT_BRANCH=master CI_COMMIT_MESSAGE="added a few more test cases for escaping behavior" CI_COMMIT_AUTHOR=bradrydzewski -CI_COMMIT_AUTHOR_NAME=bradrydzewski diff --git a/pipeline/samples/sample_5/pipeline.json b/pipeline/samples/sample_5/pipeline.json index b7b5b4b16..a27972879 100644 --- a/pipeline/samples/sample_5/pipeline.json +++ b/pipeline/samples/sample_5/pipeline.json @@ -16,7 +16,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -31,31 +30,9 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "PLUGIN_DEPTH": "50" }, - "volumes": [ - "pipeline_default:/go" - ], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -83,7 +60,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -99,39 +75,12 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/go" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -153,7 +102,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -169,39 +117,12 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/go" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -229,7 +150,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -245,39 +165,12 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/go" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -305,7 +198,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -321,39 +213,12 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/go" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -375,7 +240,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -391,39 +255,12 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_AUTHOR_NAME": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone/envsubst", - "DRONE_REPO_REMOTE": "https://github.com/drone/envsubst.git", - "DRONE_SYSTEM": "pipec", - "DRONE_SYSTEM_ARCH": "linux/amd64", - "DRONE_SYSTEM_LINK": "https://github.com/cncd/pipec", - "DRONE_SYSTEM_NAME": "pipec", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/go" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -448,4 +285,4 @@ "driver": "local" } ] -} \ No newline at end of file +} diff --git a/pipeline/samples/sample_6/.env b/pipeline/samples/sample_6/.env index 0ca9981bb..24093cb5b 100644 --- a/pipeline/samples/sample_6/.env +++ b/pipeline/samples/sample_6/.env @@ -14,7 +14,6 @@ CI_COMMIT_REFSPEC= CI_COMMIT_BRANCH=master CI_COMMIT_MESSAGE="added a few more test cases for escaping behavior" CI_COMMIT_AUTHOR=bradrydzewski -CI_COMMIT_AUTHOR_NAME=bradrydzewski # custom secrets SLACK_WEBHOOK=https://slack.com/hooks/xxxxxxxx/yyyyyyyyy diff --git a/pipeline/samples/sample_6/pipeline.json b/pipeline/samples/sample_6/pipeline.json index d33b23a15..fb970860f 100644 --- a/pipeline/samples/sample_6/pipeline.json +++ b/pipeline/samples/sample_6/pipeline.json @@ -16,7 +16,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -31,34 +30,17 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE": "true", - "DRONE_ARCH": "linux/amd64", - "DRONE_BRANCH": "master", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_JOB_STARTED": "1486119585", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_BRANCH": "master", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone", - "DRONE_REPO_OWNER": "drone", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", + "CI_ARCH": "linux/amd64", + "CI_BRANCH": "master", + "CI_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", + "CI_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", + "CI_JOB_STARTED": "1486119585", + "CI_REPO_BRANCH": "master", + "CI_REPO_OWNER": "drone", + "CI_REPO_SCM": "git", "PLUGIN_DEPTH": "50" }, - "volumes": [ - "pipeline_default:/go" - ], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -89,7 +71,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -105,42 +86,19 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE": "true", - "DRONE_ARCH": "linux/amd64", - "DRONE_BRANCH": "master", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_JOB_STARTED": "1486119585", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_BRANCH": "master", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone", - "DRONE_REPO_OWNER": "drone", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", + "CI_ARCH": "linux/amd64", + "CI_BRANCH": "master", + "CI_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", + "CI_JOB_STARTED": "1486119585", + "CI_REPO_BRANCH": "master", + "CI_REPO_OWNER": "drone", + "CI_REPO_SCM": "git", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/go" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -171,7 +129,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -186,36 +143,19 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE": "true", - "DRONE_ARCH": "linux/amd64", - "DRONE_BRANCH": "master", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_JOB_STARTED": "1486119585", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_BRANCH": "master", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "drone", - "DRONE_REPO_OWNER": "drone", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", + "CI_ARCH": "linux/amd64", + "CI_BRANCH": "master", + "CI_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", + "CI_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", + "CI_JOB_STARTED": "1486119585", + "CI_REPO_BRANCH": "master", + "CI_REPO_OWNER": "drone", + "CI_REPO_SCM": "git", "PLUGIN_CHANNEL": "builds", "PLUGIN_USERNAME": "drone", "SLACK_WEBHOOK": "https://slack.com/hooks/xxxxxxxx/yyyyyyyyy" }, - "volumes": [ - "pipeline_default:/go" - ], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", @@ -244,4 +184,4 @@ } ], "secrets": null -} \ No newline at end of file +} diff --git a/pipeline/samples/sample_7_redis/pipeline.json b/pipeline/samples/sample_7_redis/pipeline.json index 9d948580f..5be3552d5 100644 --- a/pipeline/samples/sample_7_redis/pipeline.json +++ b/pipeline/samples/sample_7_redis/pipeline.json @@ -16,11 +16,9 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE": "true", - "DRONE_ARCH": "linux/amd64", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec//0", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst" + "CI_ARCH": "linux/amd64", + "CI_BUILD_LINK": "https://github.com/cncd/pipec//0", + "CI_REPO_SCM": "git" }, "volumes": [ "/Users/bradrydzewski/code/src/github.com/woodpecker-ci/woodpecker/cncd/pipeline/samples/sample_7_redis:/go/src/github.com/drone/envsubst" @@ -28,9 +26,7 @@ "networks": [ { "name": "pipeline_default", - "aliases": [ - "redis1" - ] + "aliases": ["redis1"] } ], "on_success": true, @@ -48,11 +44,9 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE": "true", - "DRONE_ARCH": "linux/amd64", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec//0", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst" + "CI_ARCH": "linux/amd64", + "CI_BUILD_LINK": "https://github.com/cncd/pipec//0", + "CI_REPO_SCM": "git" }, "volumes": [ "/Users/bradrydzewski/code/src/github.com/woodpecker-ci/woodpecker/cncd/pipeline/samples/sample_7_redis:/go/src/github.com/drone/envsubst" @@ -60,9 +54,7 @@ "networks": [ { "name": "pipeline_default", - "aliases": [ - "redis2" - ] + "aliases": ["redis2"] } ], "on_success": true, @@ -88,29 +80,21 @@ "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", "DRONE": "true", - "DRONE_ARCH": "linux/amd64", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec//0", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", + "CI_ARCH": "linux/amd64", + "CI_BUILD_LINK": "https://github.com/cncd/pipec//0", + "CI_REPO_SCM": "git", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], "volumes": [ "/Users/bradrydzewski/code/src/github.com/woodpecker-ci/woodpecker/cncd/pipeline/samples/sample_7_redis:/go/src/github.com/drone/envsubst" ], "networks": [ { "name": "pipeline_default", - "aliases": [ - "build" - ] + "aliases": ["build"] } ], "on_success": true, @@ -132,4 +116,4 @@ } ], "secrets": null -} \ No newline at end of file +} diff --git a/pipeline/samples/sample_8_network_mode/pipeline.json b/pipeline/samples/sample_8_network_mode/pipeline.json index 86c4b895c..c5530e32f 100644 --- a/pipeline/samples/sample_8_network_mode/pipeline.json +++ b/pipeline/samples/sample_8_network_mode/pipeline.json @@ -16,22 +16,16 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE": "true", - "DRONE_ARCH": "linux/amd64", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec//0", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", + "CI_ARCH": "linux/amd64", + "CI_BUILD_LINK": "https://github.com/cncd/pipec//0", + "CI_REPO_SCM": "git", "PLUGIN_DEPTH": "50" }, - "volumes": [ - "pipeline_default:/go" - ], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", - "aliases": [ - "git" - ] + "aliases": ["git"] } ], "on_success": true, @@ -56,30 +50,19 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/go/src/github.com/drone/envsubst", - "DRONE": "true", - "DRONE_ARCH": "linux/amd64", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec//0", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "/go/src/github.com/drone/envsubst", + "CI_ARCH": "linux/amd64", + "CI_BUILD_LINK": "https://github.com/cncd/pipec//0", + "CI_REPO_SCM": "git", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/go" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/go"], "networks": [ { "name": "pipeline_default", - "aliases": [ - "build" - ] + "aliases": ["build"] } ], "on_success": true, @@ -102,4 +85,4 @@ } ], "secrets": null -} \ No newline at end of file +} diff --git a/pipeline/samples/sample_9_cache/.env b/pipeline/samples/sample_9_cache/.env index 0b18c3559..75b20778e 100644 --- a/pipeline/samples/sample_9_cache/.env +++ b/pipeline/samples/sample_9_cache/.env @@ -14,8 +14,6 @@ CI_COMMIT_REFSPEC= CI_COMMIT_BRANCH=master CI_COMMIT_MESSAGE="added a few more test cases for escaping behavior" CI_COMMIT_AUTHOR=bradrydzewski -CI_COMMIT_AUTHOR_NAME=bradrydzewski CI_VOLUME_CACHE=true CI_VOLUME_CACHE_BASE=/cache/drone - diff --git a/pipeline/samples/sample_9_cache/pipeline.json b/pipeline/samples/sample_9_cache/pipeline.json index a6f2fb3d7..1d7501794 100644 --- a/pipeline/samples/sample_9_cache/pipeline.json +++ b/pipeline/samples/sample_9_cache/pipeline.json @@ -16,7 +16,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -31,40 +30,21 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/pipeline/src", - "DRONE": "true", - "DRONE_ARCH": "linux/amd64", - "DRONE_BRANCH": "master", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_JOB_STARTED": "1486119585", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_BRANCH": "master", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "envsubst", - "DRONE_REPO_OWNER": "drone", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "/pipeline/src", + "CI_ARCH": "linux/amd64", + "CI_BRANCH": "master", + "CI_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", + "CI_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", + "CI_JOB_STARTED": "1486119585", + "CI_REPO_BRANCH": "master", + "CI_REPO_OWNER": "drone", + "CI_REPO_SCM": "git", "PLUGIN_DEPTH": "0" }, - "volumes": [ - "pipeline_default:/pipeline" - ], + "volumes": ["pipeline_default:/pipeline"], "networks": [ { "name": "pipeline_default", - "aliases": [ - "clone" - ] + "aliases": ["clone"] } ], "on_success": true, @@ -88,7 +68,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -103,29 +82,14 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/pipeline/src", - "DRONE": "true", - "DRONE_ARCH": "linux/amd64", - "DRONE_BRANCH": "master", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_JOB_STARTED": "1486119585", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_BRANCH": "master", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "envsubst", - "DRONE_REPO_OWNER": "drone", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "/pipeline/src", + "CI_ARCH": "linux/amd64", + "CI_BRANCH": "master", + "CI_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", + "CI_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", + "CI_JOB_STARTED": "1486119585", + "CI_REPO_BRANCH": "master", + "CI_REPO_OWNER": "drone", + "CI_REPO_SCM": "git", "PLUGIN_FALLBACK_TO": "master.tar", "PLUGIN_FILE": "master.tar", "PLUGIN_MOUNT": "node_modules", @@ -139,9 +103,7 @@ "networks": [ { "name": "pipeline_default", - "aliases": [ - "rebuild_cache" - ] + "aliases": ["rebuild_cache"] } ], "on_success": true, @@ -165,7 +127,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -181,48 +142,24 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/pipeline/src", - "DRONE": "true", - "DRONE_ARCH": "linux/amd64", - "DRONE_BRANCH": "master", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_JOB_STARTED": "1486119585", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_BRANCH": "master", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "envsubst", - "DRONE_REPO_OWNER": "drone", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "/pipeline/src", + "CI_ARCH": "linux/amd64", + "CI_BRANCH": "master", + "CI_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", + "CI_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", + "CI_JOB_STARTED": "1486119585", + "CI_REPO_BRANCH": "master", + "CI_REPO_OWNER": "drone", + "CI_REPO_SCM": "git", "HOME": "/root", "SHELL": "/bin/sh" }, - "entrypoint": [ - "/bin/sh", - "-c" - ], - "command": [ - "echo $CI_SCRIPT | base64 -d | /bin/sh -e" - ], - "volumes": [ - "pipeline_default:/pipeline" - ], + "entrypoint": ["/bin/sh", "-c"], + "command": ["echo $CI_SCRIPT | base64 -d | /bin/sh -e"], + "volumes": ["pipeline_default:/pipeline"], "networks": [ { "name": "pipeline_default", - "aliases": [ - "build" - ] + "aliases": ["build"] } ], "on_success": true, @@ -246,7 +183,6 @@ "CI_BUILD_NUMBER": "6", "CI_BUILD_STARTED": "1486119585", "CI_COMMIT_AUTHOR": "bradrydzewski", - "CI_COMMIT_AUTHOR_NAME": "bradrydzewski", "CI_COMMIT_BRANCH": "master", "CI_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", "CI_COMMIT_REF": "refs/heads/master", @@ -261,29 +197,14 @@ "CI_SYSTEM_LINK": "https://github.com/cncd/pipec", "CI_SYSTEM_NAME": "pipec", "CI_WORKSPACE": "/pipeline/src", - "DRONE": "true", - "DRONE_ARCH": "linux/amd64", - "DRONE_BRANCH": "master", - "DRONE_BUILD_CREATED": "1486119586", - "DRONE_BUILD_EVENT": "push", - "DRONE_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", - "DRONE_BUILD_NUMBER": "6", - "DRONE_BUILD_STARTED": "1486119585", - "DRONE_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_COMMIT_AUTHOR": "bradrydzewski", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_MESSAGE": "added a few more test cases for escaping behavior", - "DRONE_COMMIT_REF": "refs/heads/master", - "DRONE_COMMIT_SHA": "d0876d3176965f9552a611cbd56e24a9264355e6", - "DRONE_JOB_STARTED": "1486119585", - "DRONE_REMOTE_URL": "https://github.com/drone/envsubst.git", - "DRONE_REPO": "drone/envsubst", - "DRONE_REPO_BRANCH": "master", - "DRONE_REPO_LINK": "https://github.com/drone/envsubst", - "DRONE_REPO_NAME": "envsubst", - "DRONE_REPO_OWNER": "drone", - "DRONE_REPO_SCM": "git", - "DRONE_WORKSPACE": "/pipeline/src", + "CI_ARCH": "linux/amd64", + "CI_BRANCH": "master", + "CI_BUILD_LINK": "https://github.com/cncd/pipec/drone/envsubst/6", + "CI_COMMIT": "d0876d3176965f9552a611cbd56e24a9264355e6", + "CI_JOB_STARTED": "1486119585", + "CI_REPO_BRANCH": "master", + "CI_REPO_OWNER": "drone", + "CI_REPO_SCM": "git", "PLUGIN_FILE": "master.tar", "PLUGIN_FLUSH": "true", "PLUGIN_MOUNT": "node_modules", @@ -297,9 +218,7 @@ "networks": [ { "name": "pipeline_default", - "aliases": [ - "rebuild_cache" - ] + "aliases": ["rebuild_cache"] } ], "on_success": true, @@ -321,4 +240,4 @@ } ], "secrets": null -} \ No newline at end of file +} diff --git a/server/shared/procBuilder.go b/server/shared/procBuilder.go index c794e6233..4de92102a 100644 --- a/server/shared/procBuilder.go +++ b/server/shared/procBuilder.go @@ -187,9 +187,6 @@ func (b *ProcBuilder) envsubst_(y string, environ map[string]string) (string, er func (b *ProcBuilder) environmentVariables(metadata frontend.Metadata, axis matrix.Axis) map[string]string { environ := metadata.Environ() - for k, v := range metadata.EnvironDrone() { - environ[k] = v - } for k, v := range axis { environ[k] = v } diff --git a/server/shared/procBuilder_test.go b/server/shared/procBuilder_test.go index 7cd45f10f..b696c7588 100644 --- a/server/shared/procBuilder_test.go +++ b/server/shared/procBuilder_test.go @@ -41,13 +41,13 @@ bbb`, pipeline: xxx: image: scratch - yyy: ${DRONE_COMMIT_MESSAGE} + yyy: ${CI_COMMIT_MESSAGE} `)}, {Data: []byte(` pipeline: build: image: scratch - yyy: ${DRONE_COMMIT_MESSAGE} + yyy: ${CI_COMMIT_MESSAGE} `)}, }}