From 5dc0de0e14f99caebd841d0f5c3e814eac0353a8 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 23 Oct 2019 10:51:04 -0700 Subject: [PATCH] add image to compiler tests --- engine/compiler/compiler_test.go | 1 - engine/compiler/testdata/graph.json | 305 +------------------ engine/compiler/testdata/graph.yml | 9 +- engine/compiler/testdata/match.json | 216 +------------ engine/compiler/testdata/match.yml | 9 +- engine/compiler/testdata/noclone_graph.json | 216 +------------ engine/compiler/testdata/noclone_graph.yml | 9 +- engine/compiler/testdata/noclone_serial.json | 125 +------- engine/compiler/testdata/noclone_serial.yml | 8 +- engine/compiler/testdata/run_always.json | 1 + engine/compiler/testdata/run_always.yml | 8 +- engine/compiler/testdata/run_failure.json | 1 + engine/compiler/testdata/run_failure.yml | 8 +- engine/compiler/testdata/secret.yml | 8 - engine/compiler/testdata/serial.json | 305 +------------------ engine/compiler/testdata/serial.yml | 9 +- 16 files changed, 54 insertions(+), 1184 deletions(-) diff --git a/engine/compiler/compiler_test.go b/engine/compiler/compiler_test.go index 22f8900..2519f35 100644 --- a/engine/compiler/compiler_test.go +++ b/engine/compiler/compiler_test.go @@ -197,7 +197,6 @@ func testCompile(t *testing.T, source, golden string) *engine.Spec { } if diff := cmp.Diff(got, want, opts...); len(diff) != 0 { t.Errorf(diff) - dump(got) } return got diff --git a/engine/compiler/testdata/graph.json b/engine/compiler/testdata/graph.json index 9590279..3862fd4 100644 --- a/engine/compiler/testdata/graph.json +++ b/engine/compiler/testdata/graph.json @@ -3,94 +3,9 @@ "steps": [ { "id": "random", - "environment": { - "CI": "true", - "DRONE": "true", - "DRONE_BRANCH": "master", - "DRONE_BUILD_ACTION": "", - "DRONE_BUILD_CREATED": "0", - "DRONE_BUILD_EVENT": "", - "DRONE_BUILD_FINISHED": "1571810984", - "DRONE_BUILD_LINK": ":////0", - "DRONE_BUILD_NUMBER": "0", - "DRONE_BUILD_PARENT": "0", - "DRONE_BUILD_STARTED": "1571810984", - "DRONE_BUILD_STATUS": "success", - "DRONE_COMMIT": "", - "DRONE_COMMIT_AFTER": "", - "DRONE_COMMIT_AUTHOR": "", - "DRONE_COMMIT_AUTHOR_AVATAR": "", - "DRONE_COMMIT_AUTHOR_EMAIL": "", - "DRONE_COMMIT_AUTHOR_NAME": "", - "DRONE_COMMIT_BEFORE": "", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_LINK": "", - "DRONE_COMMIT_MESSAGE": "", - "DRONE_COMMIT_REF": "", - "DRONE_COMMIT_SHA": "", - "DRONE_DEPLOY_TO": "", - "DRONE_DOCKER_NETWORK_ID": "random", - "DRONE_DOCKER_VOLUME_ID": "random", - "DRONE_GIT_HTTP_URL": "", - "DRONE_GIT_SSH_URL": "", - "DRONE_NETRC_FILE": "machine github.com login octocat password correct-horse-battery-staple", - "DRONE_NETRC_MACHINE": "github.com", - "DRONE_NETRC_PASSWORD": "correct-horse-battery-staple", - "DRONE_NETRC_USERNAME": "octocat", - "DRONE_REMOTE_URL": "", - "DRONE_REPO": "", - "DRONE_REPO_BRANCH": "", - "DRONE_REPO_LINK": "", - "DRONE_REPO_NAME": "", - "DRONE_REPO_NAMESPACE": "", - "DRONE_REPO_OWNER": "", - "DRONE_REPO_PRIVATE": "false", - "DRONE_REPO_SCM": "", - "DRONE_REPO_VISIBILITY": "", - "DRONE_SOURCE_BRANCH": "", - "DRONE_STAGE_ARCH": "", - "DRONE_STAGE_DEPENDS_ON": "", - "DRONE_STAGE_FINISHED": "1571810984", - "DRONE_STAGE_KIND": "", - "DRONE_STAGE_MACHINE": "", - "DRONE_STAGE_NAME": "", - "DRONE_STAGE_NUMBER": "0", - "DRONE_STAGE_OS": "", - "DRONE_STAGE_STARTED": "1571810984", - "DRONE_STAGE_STATUS": "success", - "DRONE_STAGE_TYPE": "", - "DRONE_STAGE_VARIANT": "", - "DRONE_SYSTEM_HOST": "", - "DRONE_SYSTEM_HOSTNAME": "", - "DRONE_SYSTEM_PROTO": "", - "DRONE_SYSTEM_VERSION": "", - "DRONE_TARGET_BRANCH": "master", - "DRONE_WORKSPACE": "/drone/src", - "DRONE_WORKSPACE_BASE": "/drone/src", - "DRONE_WORKSPACE_PATH": "", - "GIT_AUTHOR_EMAIL": "noreply@drone", - "GIT_AUTHOR_NAME": "drone", - "GIT_COMMITTER_EMAIL": "noreply@drone", - "GIT_COMMITTER_NAME": "drone", - "GIT_TERMINAL_PROMPT": "0" - }, + "environment": {}, "image": "drone/git:1", - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571810984", - "io.drone.expires": "1571814584", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - }, + "labels": {}, "name": "clone", "run_policy": "always", "volumes": [ @@ -113,95 +28,10 @@ "/bin/sh", "-c" ], - "environment": { - "CI": "true", - "DRONE": "true", - "DRONE_BRANCH": "master", - "DRONE_BUILD_ACTION": "", - "DRONE_BUILD_CREATED": "0", - "DRONE_BUILD_EVENT": "", - "DRONE_BUILD_FINISHED": "1571810984", - "DRONE_BUILD_LINK": ":////0", - "DRONE_BUILD_NUMBER": "0", - "DRONE_BUILD_PARENT": "0", - "DRONE_BUILD_STARTED": "1571810984", - "DRONE_BUILD_STATUS": "success", - "DRONE_COMMIT": "", - "DRONE_COMMIT_AFTER": "", - "DRONE_COMMIT_AUTHOR": "", - "DRONE_COMMIT_AUTHOR_AVATAR": "", - "DRONE_COMMIT_AUTHOR_EMAIL": "", - "DRONE_COMMIT_AUTHOR_NAME": "", - "DRONE_COMMIT_BEFORE": "", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_LINK": "", - "DRONE_COMMIT_MESSAGE": "", - "DRONE_COMMIT_REF": "", - "DRONE_COMMIT_SHA": "", - "DRONE_DEPLOY_TO": "", - "DRONE_DOCKER_NETWORK_ID": "random", - "DRONE_DOCKER_VOLUME_ID": "random", - "DRONE_GIT_HTTP_URL": "", - "DRONE_GIT_SSH_URL": "", - "DRONE_NETRC_FILE": "machine github.com login octocat password correct-horse-battery-staple", - "DRONE_NETRC_MACHINE": "github.com", - "DRONE_NETRC_PASSWORD": "correct-horse-battery-staple", - "DRONE_NETRC_USERNAME": "octocat", - "DRONE_REMOTE_URL": "", - "DRONE_REPO": "", - "DRONE_REPO_BRANCH": "", - "DRONE_REPO_LINK": "", - "DRONE_REPO_NAME": "", - "DRONE_REPO_NAMESPACE": "", - "DRONE_REPO_OWNER": "", - "DRONE_REPO_PRIVATE": "false", - "DRONE_REPO_SCM": "", - "DRONE_REPO_VISIBILITY": "", - "DRONE_SCRIPT": "\n\nif [ ! -z \"${DRONE_NETRC_FILE}\" ]; then\n\techo $DRONE_NETRC_FILE \u003e $HOME/.netrc\nfi\n\nunset DRONE_SCRIPT\nunset DRONE_NETRC_MACHINE\nunset DRONE_NETRC_USERNAME\nunset DRONE_NETRC_PASSWORD\nunset DRONE_NETRC_FILE\n\nset -e\n\n\necho + \"go build\"\ngo build\n", - "DRONE_SOURCE_BRANCH": "", - "DRONE_STAGE_ARCH": "", - "DRONE_STAGE_DEPENDS_ON": "", - "DRONE_STAGE_FINISHED": "1571810984", - "DRONE_STAGE_KIND": "", - "DRONE_STAGE_MACHINE": "", - "DRONE_STAGE_NAME": "", - "DRONE_STAGE_NUMBER": "0", - "DRONE_STAGE_OS": "", - "DRONE_STAGE_STARTED": "1571810984", - "DRONE_STAGE_STATUS": "success", - "DRONE_STAGE_TYPE": "", - "DRONE_STAGE_VARIANT": "", - "DRONE_SYSTEM_HOST": "", - "DRONE_SYSTEM_HOSTNAME": "", - "DRONE_SYSTEM_PROTO": "", - "DRONE_SYSTEM_VERSION": "", - "DRONE_TARGET_BRANCH": "master", - "DRONE_WORKSPACE": "/drone/src", - "DRONE_WORKSPACE_BASE": "/drone/src", - "DRONE_WORKSPACE_PATH": "", - "GIT_AUTHOR_EMAIL": "noreply@drone", - "GIT_AUTHOR_NAME": "drone", - "GIT_COMMITTER_EMAIL": "noreply@drone", - "GIT_COMMITTER_NAME": "drone", - "GIT_TERMINAL_PROMPT": "0" - }, - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571810984", - "io.drone.expires": "1571814584", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - }, + "environment": {}, + "labels": {}, "name": "build", + "image": "docker.io/library/golang:latest", "volumes": [ { "name": "_workspace", @@ -222,95 +52,10 @@ "/bin/sh", "-c" ], - "environment": { - "CI": "true", - "DRONE": "true", - "DRONE_BRANCH": "master", - "DRONE_BUILD_ACTION": "", - "DRONE_BUILD_CREATED": "0", - "DRONE_BUILD_EVENT": "", - "DRONE_BUILD_FINISHED": "1571810984", - "DRONE_BUILD_LINK": ":////0", - "DRONE_BUILD_NUMBER": "0", - "DRONE_BUILD_PARENT": "0", - "DRONE_BUILD_STARTED": "1571810984", - "DRONE_BUILD_STATUS": "success", - "DRONE_COMMIT": "", - "DRONE_COMMIT_AFTER": "", - "DRONE_COMMIT_AUTHOR": "", - "DRONE_COMMIT_AUTHOR_AVATAR": "", - "DRONE_COMMIT_AUTHOR_EMAIL": "", - "DRONE_COMMIT_AUTHOR_NAME": "", - "DRONE_COMMIT_BEFORE": "", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_LINK": "", - "DRONE_COMMIT_MESSAGE": "", - "DRONE_COMMIT_REF": "", - "DRONE_COMMIT_SHA": "", - "DRONE_DEPLOY_TO": "", - "DRONE_DOCKER_NETWORK_ID": "random", - "DRONE_DOCKER_VOLUME_ID": "random", - "DRONE_GIT_HTTP_URL": "", - "DRONE_GIT_SSH_URL": "", - "DRONE_NETRC_FILE": "machine github.com login octocat password correct-horse-battery-staple", - "DRONE_NETRC_MACHINE": "github.com", - "DRONE_NETRC_PASSWORD": "correct-horse-battery-staple", - "DRONE_NETRC_USERNAME": "octocat", - "DRONE_REMOTE_URL": "", - "DRONE_REPO": "", - "DRONE_REPO_BRANCH": "", - "DRONE_REPO_LINK": "", - "DRONE_REPO_NAME": "", - "DRONE_REPO_NAMESPACE": "", - "DRONE_REPO_OWNER": "", - "DRONE_REPO_PRIVATE": "false", - "DRONE_REPO_SCM": "", - "DRONE_REPO_VISIBILITY": "", - "DRONE_SCRIPT": "\n\nif [ ! -z \"${DRONE_NETRC_FILE}\" ]; then\n\techo $DRONE_NETRC_FILE \u003e $HOME/.netrc\nfi\n\nunset DRONE_SCRIPT\nunset DRONE_NETRC_MACHINE\nunset DRONE_NETRC_USERNAME\nunset DRONE_NETRC_PASSWORD\nunset DRONE_NETRC_FILE\n\nset -e\n\n\necho + \"go test\"\ngo test\n", - "DRONE_SOURCE_BRANCH": "", - "DRONE_STAGE_ARCH": "", - "DRONE_STAGE_DEPENDS_ON": "", - "DRONE_STAGE_FINISHED": "1571810984", - "DRONE_STAGE_KIND": "", - "DRONE_STAGE_MACHINE": "", - "DRONE_STAGE_NAME": "", - "DRONE_STAGE_NUMBER": "0", - "DRONE_STAGE_OS": "", - "DRONE_STAGE_STARTED": "1571810984", - "DRONE_STAGE_STATUS": "success", - "DRONE_STAGE_TYPE": "", - "DRONE_STAGE_VARIANT": "", - "DRONE_SYSTEM_HOST": "", - "DRONE_SYSTEM_HOSTNAME": "", - "DRONE_SYSTEM_PROTO": "", - "DRONE_SYSTEM_VERSION": "", - "DRONE_TARGET_BRANCH": "master", - "DRONE_WORKSPACE": "/drone/src", - "DRONE_WORKSPACE_BASE": "/drone/src", - "DRONE_WORKSPACE_PATH": "", - "GIT_AUTHOR_EMAIL": "noreply@drone", - "GIT_AUTHOR_NAME": "drone", - "GIT_COMMITTER_EMAIL": "noreply@drone", - "GIT_COMMITTER_NAME": "drone", - "GIT_TERMINAL_PROMPT": "0" - }, - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571810984", - "io.drone.expires": "1571814584", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - }, + "environment": {}, + "labels": {}, "name": "test", + "image": "docker.io/library/golang:latest", "volumes": [ { "name": "_workspace", @@ -325,42 +70,12 @@ "temp": { "id": "random", "name": "_workspace", - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571810984", - "io.drone.expires": "1571814584", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - } + "labels": {} } } ], "network": { "id": "random", - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571810984", - "io.drone.expires": "1571814584", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - } + "labels": {} } } \ No newline at end of file diff --git a/engine/compiler/testdata/graph.yml b/engine/compiler/testdata/graph.yml index dcf7775..71d2e84 100644 --- a/engine/compiler/testdata/graph.yml +++ b/engine/compiler/testdata/graph.yml @@ -2,19 +2,14 @@ kind: pipeline type: docker name: default -server: - image: docker-18-04 - region: nyc1 - size: s-1vcpu-1gb - -token: 3DA541559918A808C2402BBA5012F6C60B27661C - steps: - name: build + image: golang commands: - go build - name: test + image: golang commands: - go test depends_on: [ build ] diff --git a/engine/compiler/testdata/match.json b/engine/compiler/testdata/match.json index ba7fa35..cb96dc2 100644 --- a/engine/compiler/testdata/match.json +++ b/engine/compiler/testdata/match.json @@ -10,95 +10,10 @@ "/bin/sh", "-c" ], - "environment": { - "CI": "true", - "DRONE": "true", - "DRONE_BRANCH": "master", - "DRONE_BUILD_ACTION": "", - "DRONE_BUILD_CREATED": "0", - "DRONE_BUILD_EVENT": "", - "DRONE_BUILD_FINISHED": "1571811065", - "DRONE_BUILD_LINK": ":////0", - "DRONE_BUILD_NUMBER": "0", - "DRONE_BUILD_PARENT": "0", - "DRONE_BUILD_STARTED": "1571811065", - "DRONE_BUILD_STATUS": "success", - "DRONE_COMMIT": "", - "DRONE_COMMIT_AFTER": "", - "DRONE_COMMIT_AUTHOR": "", - "DRONE_COMMIT_AUTHOR_AVATAR": "", - "DRONE_COMMIT_AUTHOR_EMAIL": "", - "DRONE_COMMIT_AUTHOR_NAME": "", - "DRONE_COMMIT_BEFORE": "", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_LINK": "", - "DRONE_COMMIT_MESSAGE": "", - "DRONE_COMMIT_REF": "", - "DRONE_COMMIT_SHA": "", - "DRONE_DEPLOY_TO": "", - "DRONE_DOCKER_NETWORK_ID": "random", - "DRONE_DOCKER_VOLUME_ID": "random", - "DRONE_GIT_HTTP_URL": "", - "DRONE_GIT_SSH_URL": "", - "DRONE_NETRC_FILE": "machine github.com login octocat password correct-horse-battery-staple", - "DRONE_NETRC_MACHINE": "github.com", - "DRONE_NETRC_PASSWORD": "correct-horse-battery-staple", - "DRONE_NETRC_USERNAME": "octocat", - "DRONE_REMOTE_URL": "", - "DRONE_REPO": "", - "DRONE_REPO_BRANCH": "", - "DRONE_REPO_LINK": "", - "DRONE_REPO_NAME": "", - "DRONE_REPO_NAMESPACE": "", - "DRONE_REPO_OWNER": "", - "DRONE_REPO_PRIVATE": "false", - "DRONE_REPO_SCM": "", - "DRONE_REPO_VISIBILITY": "", - "DRONE_SCRIPT": "\n\nif [ ! -z \"${DRONE_NETRC_FILE}\" ]; then\n\techo $DRONE_NETRC_FILE \u003e $HOME/.netrc\nfi\n\nunset DRONE_SCRIPT\nunset DRONE_NETRC_MACHINE\nunset DRONE_NETRC_USERNAME\nunset DRONE_NETRC_PASSWORD\nunset DRONE_NETRC_FILE\n\nset -e\n\n\necho + \"go build\"\ngo build\n", - "DRONE_SOURCE_BRANCH": "", - "DRONE_STAGE_ARCH": "", - "DRONE_STAGE_DEPENDS_ON": "", - "DRONE_STAGE_FINISHED": "1571811065", - "DRONE_STAGE_KIND": "", - "DRONE_STAGE_MACHINE": "", - "DRONE_STAGE_NAME": "", - "DRONE_STAGE_NUMBER": "0", - "DRONE_STAGE_OS": "", - "DRONE_STAGE_STARTED": "1571811065", - "DRONE_STAGE_STATUS": "success", - "DRONE_STAGE_TYPE": "", - "DRONE_STAGE_VARIANT": "", - "DRONE_SYSTEM_HOST": "", - "DRONE_SYSTEM_HOSTNAME": "", - "DRONE_SYSTEM_PROTO": "", - "DRONE_SYSTEM_VERSION": "", - "DRONE_TARGET_BRANCH": "master", - "DRONE_WORKSPACE": "/drone/src", - "DRONE_WORKSPACE_BASE": "/drone/src", - "DRONE_WORKSPACE_PATH": "", - "GIT_AUTHOR_EMAIL": "noreply@drone", - "GIT_AUTHOR_NAME": "drone", - "GIT_COMMITTER_EMAIL": "noreply@drone", - "GIT_COMMITTER_NAME": "drone", - "GIT_TERMINAL_PROMPT": "0" - }, - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571811065", - "io.drone.expires": "1571814665", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - }, + "environment": {}, + "labels": {}, "name": "build", + "image": "docker.io/library/golang:latest", "volumes": [ { "name": "_workspace", @@ -119,95 +34,10 @@ "/bin/sh", "-c" ], - "environment": { - "CI": "true", - "DRONE": "true", - "DRONE_BRANCH": "master", - "DRONE_BUILD_ACTION": "", - "DRONE_BUILD_CREATED": "0", - "DRONE_BUILD_EVENT": "", - "DRONE_BUILD_FINISHED": "1571811065", - "DRONE_BUILD_LINK": ":////0", - "DRONE_BUILD_NUMBER": "0", - "DRONE_BUILD_PARENT": "0", - "DRONE_BUILD_STARTED": "1571811065", - "DRONE_BUILD_STATUS": "success", - "DRONE_COMMIT": "", - "DRONE_COMMIT_AFTER": "", - "DRONE_COMMIT_AUTHOR": "", - "DRONE_COMMIT_AUTHOR_AVATAR": "", - "DRONE_COMMIT_AUTHOR_EMAIL": "", - "DRONE_COMMIT_AUTHOR_NAME": "", - "DRONE_COMMIT_BEFORE": "", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_LINK": "", - "DRONE_COMMIT_MESSAGE": "", - "DRONE_COMMIT_REF": "", - "DRONE_COMMIT_SHA": "", - "DRONE_DEPLOY_TO": "", - "DRONE_DOCKER_NETWORK_ID": "random", - "DRONE_DOCKER_VOLUME_ID": "random", - "DRONE_GIT_HTTP_URL": "", - "DRONE_GIT_SSH_URL": "", - "DRONE_NETRC_FILE": "machine github.com login octocat password correct-horse-battery-staple", - "DRONE_NETRC_MACHINE": "github.com", - "DRONE_NETRC_PASSWORD": "correct-horse-battery-staple", - "DRONE_NETRC_USERNAME": "octocat", - "DRONE_REMOTE_URL": "", - "DRONE_REPO": "", - "DRONE_REPO_BRANCH": "", - "DRONE_REPO_LINK": "", - "DRONE_REPO_NAME": "", - "DRONE_REPO_NAMESPACE": "", - "DRONE_REPO_OWNER": "", - "DRONE_REPO_PRIVATE": "false", - "DRONE_REPO_SCM": "", - "DRONE_REPO_VISIBILITY": "", - "DRONE_SCRIPT": "\n\nif [ ! -z \"${DRONE_NETRC_FILE}\" ]; then\n\techo $DRONE_NETRC_FILE \u003e $HOME/.netrc\nfi\n\nunset DRONE_SCRIPT\nunset DRONE_NETRC_MACHINE\nunset DRONE_NETRC_USERNAME\nunset DRONE_NETRC_PASSWORD\nunset DRONE_NETRC_FILE\n\nset -e\n\n\necho + \"go test\"\ngo test\n", - "DRONE_SOURCE_BRANCH": "", - "DRONE_STAGE_ARCH": "", - "DRONE_STAGE_DEPENDS_ON": "", - "DRONE_STAGE_FINISHED": "1571811065", - "DRONE_STAGE_KIND": "", - "DRONE_STAGE_MACHINE": "", - "DRONE_STAGE_NAME": "", - "DRONE_STAGE_NUMBER": "0", - "DRONE_STAGE_OS": "", - "DRONE_STAGE_STARTED": "1571811065", - "DRONE_STAGE_STATUS": "success", - "DRONE_STAGE_TYPE": "", - "DRONE_STAGE_VARIANT": "", - "DRONE_SYSTEM_HOST": "", - "DRONE_SYSTEM_HOSTNAME": "", - "DRONE_SYSTEM_PROTO": "", - "DRONE_SYSTEM_VERSION": "", - "DRONE_TARGET_BRANCH": "master", - "DRONE_WORKSPACE": "/drone/src", - "DRONE_WORKSPACE_BASE": "/drone/src", - "DRONE_WORKSPACE_PATH": "", - "GIT_AUTHOR_EMAIL": "noreply@drone", - "GIT_AUTHOR_NAME": "drone", - "GIT_COMMITTER_EMAIL": "noreply@drone", - "GIT_COMMITTER_NAME": "drone", - "GIT_TERMINAL_PROMPT": "0" - }, - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571811065", - "io.drone.expires": "1571814665", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - }, + "environment": {}, + "labels": {}, "name": "test", + "image": "docker.io/library/golang:latest", "run_policy": "never", "volumes": [ { @@ -223,42 +53,12 @@ "temp": { "id": "random", "name": "_workspace", - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571811065", - "io.drone.expires": "1571814665", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - } + "labels": {} } } ], "network": { "id": "random", - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571811065", - "io.drone.expires": "1571814665", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - } + "labels": {} } } \ No newline at end of file diff --git a/engine/compiler/testdata/match.yml b/engine/compiler/testdata/match.yml index ec3a34a..6a9dd30 100644 --- a/engine/compiler/testdata/match.yml +++ b/engine/compiler/testdata/match.yml @@ -5,21 +5,16 @@ name: default clone: disable: true -server: - image: docker-18-04 - region: nyc1 - size: s-1vcpu-1gb - -token: 3DA541559918A808C2402BBA5012F6C60B27661C - steps: - name: build + image: golang commands: - go build when: branch: [ master ] - name: test + image: golang commands: - go test when: diff --git a/engine/compiler/testdata/noclone_graph.json b/engine/compiler/testdata/noclone_graph.json index 1f7df27..10c1261 100644 --- a/engine/compiler/testdata/noclone_graph.json +++ b/engine/compiler/testdata/noclone_graph.json @@ -10,95 +10,10 @@ "/bin/sh", "-c" ], - "environment": { - "CI": "true", - "DRONE": "true", - "DRONE_BRANCH": "master", - "DRONE_BUILD_ACTION": "", - "DRONE_BUILD_CREATED": "0", - "DRONE_BUILD_EVENT": "", - "DRONE_BUILD_FINISHED": "1571811036", - "DRONE_BUILD_LINK": ":////0", - "DRONE_BUILD_NUMBER": "0", - "DRONE_BUILD_PARENT": "0", - "DRONE_BUILD_STARTED": "1571811036", - "DRONE_BUILD_STATUS": "success", - "DRONE_COMMIT": "", - "DRONE_COMMIT_AFTER": "", - "DRONE_COMMIT_AUTHOR": "", - "DRONE_COMMIT_AUTHOR_AVATAR": "", - "DRONE_COMMIT_AUTHOR_EMAIL": "", - "DRONE_COMMIT_AUTHOR_NAME": "", - "DRONE_COMMIT_BEFORE": "", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_LINK": "", - "DRONE_COMMIT_MESSAGE": "", - "DRONE_COMMIT_REF": "", - "DRONE_COMMIT_SHA": "", - "DRONE_DEPLOY_TO": "", - "DRONE_DOCKER_NETWORK_ID": "random", - "DRONE_DOCKER_VOLUME_ID": "random", - "DRONE_GIT_HTTP_URL": "", - "DRONE_GIT_SSH_URL": "", - "DRONE_NETRC_FILE": "machine github.com login octocat password correct-horse-battery-staple", - "DRONE_NETRC_MACHINE": "github.com", - "DRONE_NETRC_PASSWORD": "correct-horse-battery-staple", - "DRONE_NETRC_USERNAME": "octocat", - "DRONE_REMOTE_URL": "", - "DRONE_REPO": "", - "DRONE_REPO_BRANCH": "", - "DRONE_REPO_LINK": "", - "DRONE_REPO_NAME": "", - "DRONE_REPO_NAMESPACE": "", - "DRONE_REPO_OWNER": "", - "DRONE_REPO_PRIVATE": "false", - "DRONE_REPO_SCM": "", - "DRONE_REPO_VISIBILITY": "", - "DRONE_SCRIPT": "\n\nif [ ! -z \"${DRONE_NETRC_FILE}\" ]; then\n\techo $DRONE_NETRC_FILE \u003e $HOME/.netrc\nfi\n\nunset DRONE_SCRIPT\nunset DRONE_NETRC_MACHINE\nunset DRONE_NETRC_USERNAME\nunset DRONE_NETRC_PASSWORD\nunset DRONE_NETRC_FILE\n\nset -e\n\n\necho + \"go build\"\ngo build\n", - "DRONE_SOURCE_BRANCH": "", - "DRONE_STAGE_ARCH": "", - "DRONE_STAGE_DEPENDS_ON": "", - "DRONE_STAGE_FINISHED": "1571811036", - "DRONE_STAGE_KIND": "", - "DRONE_STAGE_MACHINE": "", - "DRONE_STAGE_NAME": "", - "DRONE_STAGE_NUMBER": "0", - "DRONE_STAGE_OS": "", - "DRONE_STAGE_STARTED": "1571811036", - "DRONE_STAGE_STATUS": "success", - "DRONE_STAGE_TYPE": "", - "DRONE_STAGE_VARIANT": "", - "DRONE_SYSTEM_HOST": "", - "DRONE_SYSTEM_HOSTNAME": "", - "DRONE_SYSTEM_PROTO": "", - "DRONE_SYSTEM_VERSION": "", - "DRONE_TARGET_BRANCH": "master", - "DRONE_WORKSPACE": "/drone/src", - "DRONE_WORKSPACE_BASE": "/drone/src", - "DRONE_WORKSPACE_PATH": "", - "GIT_AUTHOR_EMAIL": "noreply@drone", - "GIT_AUTHOR_NAME": "drone", - "GIT_COMMITTER_EMAIL": "noreply@drone", - "GIT_COMMITTER_NAME": "drone", - "GIT_TERMINAL_PROMPT": "0" - }, - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571811036", - "io.drone.expires": "1571814636", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - }, + "environment": {}, + "labels": {}, "name": "build", + "image": "docker.io/library/golang:latest", "volumes": [ { "name": "_workspace", @@ -119,95 +34,10 @@ "/bin/sh", "-c" ], - "environment": { - "CI": "true", - "DRONE": "true", - "DRONE_BRANCH": "master", - "DRONE_BUILD_ACTION": "", - "DRONE_BUILD_CREATED": "0", - "DRONE_BUILD_EVENT": "", - "DRONE_BUILD_FINISHED": "1571811036", - "DRONE_BUILD_LINK": ":////0", - "DRONE_BUILD_NUMBER": "0", - "DRONE_BUILD_PARENT": "0", - "DRONE_BUILD_STARTED": "1571811036", - "DRONE_BUILD_STATUS": "success", - "DRONE_COMMIT": "", - "DRONE_COMMIT_AFTER": "", - "DRONE_COMMIT_AUTHOR": "", - "DRONE_COMMIT_AUTHOR_AVATAR": "", - "DRONE_COMMIT_AUTHOR_EMAIL": "", - "DRONE_COMMIT_AUTHOR_NAME": "", - "DRONE_COMMIT_BEFORE": "", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_LINK": "", - "DRONE_COMMIT_MESSAGE": "", - "DRONE_COMMIT_REF": "", - "DRONE_COMMIT_SHA": "", - "DRONE_DEPLOY_TO": "", - "DRONE_DOCKER_NETWORK_ID": "random", - "DRONE_DOCKER_VOLUME_ID": "random", - "DRONE_GIT_HTTP_URL": "", - "DRONE_GIT_SSH_URL": "", - "DRONE_NETRC_FILE": "machine github.com login octocat password correct-horse-battery-staple", - "DRONE_NETRC_MACHINE": "github.com", - "DRONE_NETRC_PASSWORD": "correct-horse-battery-staple", - "DRONE_NETRC_USERNAME": "octocat", - "DRONE_REMOTE_URL": "", - "DRONE_REPO": "", - "DRONE_REPO_BRANCH": "", - "DRONE_REPO_LINK": "", - "DRONE_REPO_NAME": "", - "DRONE_REPO_NAMESPACE": "", - "DRONE_REPO_OWNER": "", - "DRONE_REPO_PRIVATE": "false", - "DRONE_REPO_SCM": "", - "DRONE_REPO_VISIBILITY": "", - "DRONE_SCRIPT": "\n\nif [ ! -z \"${DRONE_NETRC_FILE}\" ]; then\n\techo $DRONE_NETRC_FILE \u003e $HOME/.netrc\nfi\n\nunset DRONE_SCRIPT\nunset DRONE_NETRC_MACHINE\nunset DRONE_NETRC_USERNAME\nunset DRONE_NETRC_PASSWORD\nunset DRONE_NETRC_FILE\n\nset -e\n\n\necho + \"go test\"\ngo test\n", - "DRONE_SOURCE_BRANCH": "", - "DRONE_STAGE_ARCH": "", - "DRONE_STAGE_DEPENDS_ON": "", - "DRONE_STAGE_FINISHED": "1571811036", - "DRONE_STAGE_KIND": "", - "DRONE_STAGE_MACHINE": "", - "DRONE_STAGE_NAME": "", - "DRONE_STAGE_NUMBER": "0", - "DRONE_STAGE_OS": "", - "DRONE_STAGE_STARTED": "1571811036", - "DRONE_STAGE_STATUS": "success", - "DRONE_STAGE_TYPE": "", - "DRONE_STAGE_VARIANT": "", - "DRONE_SYSTEM_HOST": "", - "DRONE_SYSTEM_HOSTNAME": "", - "DRONE_SYSTEM_PROTO": "", - "DRONE_SYSTEM_VERSION": "", - "DRONE_TARGET_BRANCH": "master", - "DRONE_WORKSPACE": "/drone/src", - "DRONE_WORKSPACE_BASE": "/drone/src", - "DRONE_WORKSPACE_PATH": "", - "GIT_AUTHOR_EMAIL": "noreply@drone", - "GIT_AUTHOR_NAME": "drone", - "GIT_COMMITTER_EMAIL": "noreply@drone", - "GIT_COMMITTER_NAME": "drone", - "GIT_TERMINAL_PROMPT": "0" - }, - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571811036", - "io.drone.expires": "1571814636", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - }, + "environment": {}, + "labels": {}, "name": "test", + "image": "docker.io/library/golang:latest", "volumes": [ { "name": "_workspace", @@ -222,42 +52,12 @@ "temp": { "id": "random", "name": "_workspace", - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571811036", - "io.drone.expires": "1571814636", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - } + "labels": {} } } ], "network": { "id": "random", - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571811036", - "io.drone.expires": "1571814636", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - } + "labels": {} } } \ No newline at end of file diff --git a/engine/compiler/testdata/noclone_graph.yml b/engine/compiler/testdata/noclone_graph.yml index f3c5072..94bc0b8 100644 --- a/engine/compiler/testdata/noclone_graph.yml +++ b/engine/compiler/testdata/noclone_graph.yml @@ -5,19 +5,14 @@ name: default clone: disable: true -server: - image: docker-18-04 - region: nyc1 - size: s-1vcpu-1gb - -token: 3DA541559918A808C2402BBA5012F6C60B27661C - steps: - name: build + image: golang commands: - go build - name: test + image: golang commands: - go test depends_on: [ build ] \ No newline at end of file diff --git a/engine/compiler/testdata/noclone_serial.json b/engine/compiler/testdata/noclone_serial.json index fc3ab49..21e8202 100644 --- a/engine/compiler/testdata/noclone_serial.json +++ b/engine/compiler/testdata/noclone_serial.json @@ -10,95 +10,10 @@ "/bin/sh", "-c" ], - "environment": { - "CI": "true", - "DRONE": "true", - "DRONE_BRANCH": "master", - "DRONE_BUILD_ACTION": "", - "DRONE_BUILD_CREATED": "0", - "DRONE_BUILD_EVENT": "", - "DRONE_BUILD_FINISHED": "1571811007", - "DRONE_BUILD_LINK": ":////0", - "DRONE_BUILD_NUMBER": "0", - "DRONE_BUILD_PARENT": "0", - "DRONE_BUILD_STARTED": "1571811007", - "DRONE_BUILD_STATUS": "success", - "DRONE_COMMIT": "", - "DRONE_COMMIT_AFTER": "", - "DRONE_COMMIT_AUTHOR": "", - "DRONE_COMMIT_AUTHOR_AVATAR": "", - "DRONE_COMMIT_AUTHOR_EMAIL": "", - "DRONE_COMMIT_AUTHOR_NAME": "", - "DRONE_COMMIT_BEFORE": "", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_LINK": "", - "DRONE_COMMIT_MESSAGE": "", - "DRONE_COMMIT_REF": "", - "DRONE_COMMIT_SHA": "", - "DRONE_DEPLOY_TO": "", - "DRONE_DOCKER_NETWORK_ID": "random", - "DRONE_DOCKER_VOLUME_ID": "random", - "DRONE_GIT_HTTP_URL": "", - "DRONE_GIT_SSH_URL": "", - "DRONE_NETRC_FILE": "machine github.com login octocat password correct-horse-battery-staple", - "DRONE_NETRC_MACHINE": "github.com", - "DRONE_NETRC_PASSWORD": "correct-horse-battery-staple", - "DRONE_NETRC_USERNAME": "octocat", - "DRONE_REMOTE_URL": "", - "DRONE_REPO": "", - "DRONE_REPO_BRANCH": "", - "DRONE_REPO_LINK": "", - "DRONE_REPO_NAME": "", - "DRONE_REPO_NAMESPACE": "", - "DRONE_REPO_OWNER": "", - "DRONE_REPO_PRIVATE": "false", - "DRONE_REPO_SCM": "", - "DRONE_REPO_VISIBILITY": "", - "DRONE_SCRIPT": "\n\nif [ ! -z \"${DRONE_NETRC_FILE}\" ]; then\n\techo $DRONE_NETRC_FILE \u003e $HOME/.netrc\nfi\n\nunset DRONE_SCRIPT\nunset DRONE_NETRC_MACHINE\nunset DRONE_NETRC_USERNAME\nunset DRONE_NETRC_PASSWORD\nunset DRONE_NETRC_FILE\n\nset -e\n\n\necho + \"go build\"\ngo build\n\necho + \"go test\"\ngo test\n", - "DRONE_SOURCE_BRANCH": "", - "DRONE_STAGE_ARCH": "", - "DRONE_STAGE_DEPENDS_ON": "", - "DRONE_STAGE_FINISHED": "1571811007", - "DRONE_STAGE_KIND": "", - "DRONE_STAGE_MACHINE": "", - "DRONE_STAGE_NAME": "", - "DRONE_STAGE_NUMBER": "0", - "DRONE_STAGE_OS": "", - "DRONE_STAGE_STARTED": "1571811007", - "DRONE_STAGE_STATUS": "success", - "DRONE_STAGE_TYPE": "", - "DRONE_STAGE_VARIANT": "", - "DRONE_SYSTEM_HOST": "", - "DRONE_SYSTEM_HOSTNAME": "", - "DRONE_SYSTEM_PROTO": "", - "DRONE_SYSTEM_VERSION": "", - "DRONE_TARGET_BRANCH": "master", - "DRONE_WORKSPACE": "/drone/src", - "DRONE_WORKSPACE_BASE": "/drone/src", - "DRONE_WORKSPACE_PATH": "", - "GIT_AUTHOR_EMAIL": "noreply@drone", - "GIT_AUTHOR_NAME": "drone", - "GIT_COMMITTER_EMAIL": "noreply@drone", - "GIT_COMMITTER_NAME": "drone", - "GIT_TERMINAL_PROMPT": "0" - }, - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571811007", - "io.drone.expires": "1571814607", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - }, + "environment": {}, + "labels": {}, "name": "build", + "image": "docker.io/library/golang:latest", "volumes": [ { "name": "_workspace", @@ -113,42 +28,12 @@ "temp": { "id": "random", "name": "_workspace", - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571811007", - "io.drone.expires": "1571814607", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - } + "labels": {} } } ], "network": { "id": "random", - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571811007", - "io.drone.expires": "1571814607", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - } + "labels": {} } } \ No newline at end of file diff --git a/engine/compiler/testdata/noclone_serial.yml b/engine/compiler/testdata/noclone_serial.yml index 48535ab..55226c3 100644 --- a/engine/compiler/testdata/noclone_serial.yml +++ b/engine/compiler/testdata/noclone_serial.yml @@ -5,15 +5,9 @@ name: default clone: disable: true -server: - image: docker-18-04 - region: nyc1 - size: s-1vcpu-1gb - -token: 3DA541559918A808C2402BBA5012F6C60B27661C - steps: - name: build + image: golang commands: - go build - go test diff --git a/engine/compiler/testdata/run_always.json b/engine/compiler/testdata/run_always.json index cb45bf7..257b090 100644 --- a/engine/compiler/testdata/run_always.json +++ b/engine/compiler/testdata/run_always.json @@ -13,6 +13,7 @@ "environment": {}, "labels": {}, "name": "build", + "image": "docker.io/library/golang:latest", "run_policy": "always", "volumes": [ { diff --git a/engine/compiler/testdata/run_always.yml b/engine/compiler/testdata/run_always.yml index c46b3da..8961e70 100644 --- a/engine/compiler/testdata/run_always.yml +++ b/engine/compiler/testdata/run_always.yml @@ -5,15 +5,9 @@ name: default clone: disable: true -server: - image: docker-18-04 - region: nyc1 - size: s-1vcpu-1gb - -token: 3DA541559918A808C2402BBA5012F6C60B27661C - steps: - name: build + image: golang commands: - go build when: diff --git a/engine/compiler/testdata/run_failure.json b/engine/compiler/testdata/run_failure.json index 24d8fc3..5cd454b 100644 --- a/engine/compiler/testdata/run_failure.json +++ b/engine/compiler/testdata/run_failure.json @@ -13,6 +13,7 @@ "environment": {}, "labels": {}, "name": "build", + "image": "docker.io/library/golang:latest", "run_policy": "on-failure", "volumes": [ { diff --git a/engine/compiler/testdata/run_failure.yml b/engine/compiler/testdata/run_failure.yml index c99198d..d26e4fd 100644 --- a/engine/compiler/testdata/run_failure.yml +++ b/engine/compiler/testdata/run_failure.yml @@ -5,15 +5,9 @@ name: default clone: disable: true -server: - image: docker-18-04 - region: nyc1 - size: s-1vcpu-1gb - -token: 3DA541559918A808C2402BBA5012F6C60B27661C - steps: - name: build + image: golang commands: - go build when: diff --git a/engine/compiler/testdata/secret.yml b/engine/compiler/testdata/secret.yml index 86b8ae2..9abc1f4 100644 --- a/engine/compiler/testdata/secret.yml +++ b/engine/compiler/testdata/secret.yml @@ -5,14 +5,6 @@ name: default clone: disable: true -server: - image: docker-18-04 - region: nyc1 - size: s-1vcpu-1gb - -token: - from_secret: token - steps: - name: build environment: diff --git a/engine/compiler/testdata/serial.json b/engine/compiler/testdata/serial.json index d422789..3862fd4 100644 --- a/engine/compiler/testdata/serial.json +++ b/engine/compiler/testdata/serial.json @@ -3,94 +3,9 @@ "steps": [ { "id": "random", - "environment": { - "CI": "true", - "DRONE": "true", - "DRONE_BRANCH": "master", - "DRONE_BUILD_ACTION": "", - "DRONE_BUILD_CREATED": "0", - "DRONE_BUILD_EVENT": "", - "DRONE_BUILD_FINISHED": "1571810939", - "DRONE_BUILD_LINK": ":////0", - "DRONE_BUILD_NUMBER": "0", - "DRONE_BUILD_PARENT": "0", - "DRONE_BUILD_STARTED": "1571810939", - "DRONE_BUILD_STATUS": "success", - "DRONE_COMMIT": "", - "DRONE_COMMIT_AFTER": "", - "DRONE_COMMIT_AUTHOR": "", - "DRONE_COMMIT_AUTHOR_AVATAR": "", - "DRONE_COMMIT_AUTHOR_EMAIL": "", - "DRONE_COMMIT_AUTHOR_NAME": "", - "DRONE_COMMIT_BEFORE": "", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_LINK": "", - "DRONE_COMMIT_MESSAGE": "", - "DRONE_COMMIT_REF": "", - "DRONE_COMMIT_SHA": "", - "DRONE_DEPLOY_TO": "", - "DRONE_DOCKER_NETWORK_ID": "random", - "DRONE_DOCKER_VOLUME_ID": "random", - "DRONE_GIT_HTTP_URL": "", - "DRONE_GIT_SSH_URL": "", - "DRONE_NETRC_FILE": "machine github.com login octocat password correct-horse-battery-staple", - "DRONE_NETRC_MACHINE": "github.com", - "DRONE_NETRC_PASSWORD": "correct-horse-battery-staple", - "DRONE_NETRC_USERNAME": "octocat", - "DRONE_REMOTE_URL": "", - "DRONE_REPO": "", - "DRONE_REPO_BRANCH": "", - "DRONE_REPO_LINK": "", - "DRONE_REPO_NAME": "", - "DRONE_REPO_NAMESPACE": "", - "DRONE_REPO_OWNER": "", - "DRONE_REPO_PRIVATE": "false", - "DRONE_REPO_SCM": "", - "DRONE_REPO_VISIBILITY": "", - "DRONE_SOURCE_BRANCH": "", - "DRONE_STAGE_ARCH": "", - "DRONE_STAGE_DEPENDS_ON": "", - "DRONE_STAGE_FINISHED": "1571810939", - "DRONE_STAGE_KIND": "", - "DRONE_STAGE_MACHINE": "", - "DRONE_STAGE_NAME": "", - "DRONE_STAGE_NUMBER": "0", - "DRONE_STAGE_OS": "", - "DRONE_STAGE_STARTED": "1571810939", - "DRONE_STAGE_STATUS": "success", - "DRONE_STAGE_TYPE": "", - "DRONE_STAGE_VARIANT": "", - "DRONE_SYSTEM_HOST": "", - "DRONE_SYSTEM_HOSTNAME": "", - "DRONE_SYSTEM_PROTO": "", - "DRONE_SYSTEM_VERSION": "", - "DRONE_TARGET_BRANCH": "master", - "DRONE_WORKSPACE": "/drone/src", - "DRONE_WORKSPACE_BASE": "/drone/src", - "DRONE_WORKSPACE_PATH": "", - "GIT_AUTHOR_EMAIL": "noreply@drone", - "GIT_AUTHOR_NAME": "drone", - "GIT_COMMITTER_EMAIL": "noreply@drone", - "GIT_COMMITTER_NAME": "drone", - "GIT_TERMINAL_PROMPT": "0" - }, + "environment": {}, "image": "drone/git:1", - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571810939", - "io.drone.expires": "1571814539", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - }, + "labels": {}, "name": "clone", "run_policy": "always", "volumes": [ @@ -113,95 +28,10 @@ "/bin/sh", "-c" ], - "environment": { - "CI": "true", - "DRONE": "true", - "DRONE_BRANCH": "master", - "DRONE_BUILD_ACTION": "", - "DRONE_BUILD_CREATED": "0", - "DRONE_BUILD_EVENT": "", - "DRONE_BUILD_FINISHED": "1571810939", - "DRONE_BUILD_LINK": ":////0", - "DRONE_BUILD_NUMBER": "0", - "DRONE_BUILD_PARENT": "0", - "DRONE_BUILD_STARTED": "1571810939", - "DRONE_BUILD_STATUS": "success", - "DRONE_COMMIT": "", - "DRONE_COMMIT_AFTER": "", - "DRONE_COMMIT_AUTHOR": "", - "DRONE_COMMIT_AUTHOR_AVATAR": "", - "DRONE_COMMIT_AUTHOR_EMAIL": "", - "DRONE_COMMIT_AUTHOR_NAME": "", - "DRONE_COMMIT_BEFORE": "", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_LINK": "", - "DRONE_COMMIT_MESSAGE": "", - "DRONE_COMMIT_REF": "", - "DRONE_COMMIT_SHA": "", - "DRONE_DEPLOY_TO": "", - "DRONE_DOCKER_NETWORK_ID": "random", - "DRONE_DOCKER_VOLUME_ID": "random", - "DRONE_GIT_HTTP_URL": "", - "DRONE_GIT_SSH_URL": "", - "DRONE_NETRC_FILE": "machine github.com login octocat password correct-horse-battery-staple", - "DRONE_NETRC_MACHINE": "github.com", - "DRONE_NETRC_PASSWORD": "correct-horse-battery-staple", - "DRONE_NETRC_USERNAME": "octocat", - "DRONE_REMOTE_URL": "", - "DRONE_REPO": "", - "DRONE_REPO_BRANCH": "", - "DRONE_REPO_LINK": "", - "DRONE_REPO_NAME": "", - "DRONE_REPO_NAMESPACE": "", - "DRONE_REPO_OWNER": "", - "DRONE_REPO_PRIVATE": "false", - "DRONE_REPO_SCM": "", - "DRONE_REPO_VISIBILITY": "", - "DRONE_SCRIPT": "\n\nif [ ! -z \"${DRONE_NETRC_FILE}\" ]; then\n\techo $DRONE_NETRC_FILE \u003e $HOME/.netrc\nfi\n\nunset DRONE_SCRIPT\nunset DRONE_NETRC_MACHINE\nunset DRONE_NETRC_USERNAME\nunset DRONE_NETRC_PASSWORD\nunset DRONE_NETRC_FILE\n\nset -e\n\n\necho + \"go build\"\ngo build\n", - "DRONE_SOURCE_BRANCH": "", - "DRONE_STAGE_ARCH": "", - "DRONE_STAGE_DEPENDS_ON": "", - "DRONE_STAGE_FINISHED": "1571810939", - "DRONE_STAGE_KIND": "", - "DRONE_STAGE_MACHINE": "", - "DRONE_STAGE_NAME": "", - "DRONE_STAGE_NUMBER": "0", - "DRONE_STAGE_OS": "", - "DRONE_STAGE_STARTED": "1571810939", - "DRONE_STAGE_STATUS": "success", - "DRONE_STAGE_TYPE": "", - "DRONE_STAGE_VARIANT": "", - "DRONE_SYSTEM_HOST": "", - "DRONE_SYSTEM_HOSTNAME": "", - "DRONE_SYSTEM_PROTO": "", - "DRONE_SYSTEM_VERSION": "", - "DRONE_TARGET_BRANCH": "master", - "DRONE_WORKSPACE": "/drone/src", - "DRONE_WORKSPACE_BASE": "/drone/src", - "DRONE_WORKSPACE_PATH": "", - "GIT_AUTHOR_EMAIL": "noreply@drone", - "GIT_AUTHOR_NAME": "drone", - "GIT_COMMITTER_EMAIL": "noreply@drone", - "GIT_COMMITTER_NAME": "drone", - "GIT_TERMINAL_PROMPT": "0" - }, - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571810939", - "io.drone.expires": "1571814539", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - }, + "environment": {}, + "labels": {}, "name": "build", + "image": "docker.io/library/golang:latest", "volumes": [ { "name": "_workspace", @@ -222,95 +52,10 @@ "/bin/sh", "-c" ], - "environment": { - "CI": "true", - "DRONE": "true", - "DRONE_BRANCH": "master", - "DRONE_BUILD_ACTION": "", - "DRONE_BUILD_CREATED": "0", - "DRONE_BUILD_EVENT": "", - "DRONE_BUILD_FINISHED": "1571810939", - "DRONE_BUILD_LINK": ":////0", - "DRONE_BUILD_NUMBER": "0", - "DRONE_BUILD_PARENT": "0", - "DRONE_BUILD_STARTED": "1571810939", - "DRONE_BUILD_STATUS": "success", - "DRONE_COMMIT": "", - "DRONE_COMMIT_AFTER": "", - "DRONE_COMMIT_AUTHOR": "", - "DRONE_COMMIT_AUTHOR_AVATAR": "", - "DRONE_COMMIT_AUTHOR_EMAIL": "", - "DRONE_COMMIT_AUTHOR_NAME": "", - "DRONE_COMMIT_BEFORE": "", - "DRONE_COMMIT_BRANCH": "master", - "DRONE_COMMIT_LINK": "", - "DRONE_COMMIT_MESSAGE": "", - "DRONE_COMMIT_REF": "", - "DRONE_COMMIT_SHA": "", - "DRONE_DEPLOY_TO": "", - "DRONE_DOCKER_NETWORK_ID": "random", - "DRONE_DOCKER_VOLUME_ID": "random", - "DRONE_GIT_HTTP_URL": "", - "DRONE_GIT_SSH_URL": "", - "DRONE_NETRC_FILE": "machine github.com login octocat password correct-horse-battery-staple", - "DRONE_NETRC_MACHINE": "github.com", - "DRONE_NETRC_PASSWORD": "correct-horse-battery-staple", - "DRONE_NETRC_USERNAME": "octocat", - "DRONE_REMOTE_URL": "", - "DRONE_REPO": "", - "DRONE_REPO_BRANCH": "", - "DRONE_REPO_LINK": "", - "DRONE_REPO_NAME": "", - "DRONE_REPO_NAMESPACE": "", - "DRONE_REPO_OWNER": "", - "DRONE_REPO_PRIVATE": "false", - "DRONE_REPO_SCM": "", - "DRONE_REPO_VISIBILITY": "", - "DRONE_SCRIPT": "\n\nif [ ! -z \"${DRONE_NETRC_FILE}\" ]; then\n\techo $DRONE_NETRC_FILE \u003e $HOME/.netrc\nfi\n\nunset DRONE_SCRIPT\nunset DRONE_NETRC_MACHINE\nunset DRONE_NETRC_USERNAME\nunset DRONE_NETRC_PASSWORD\nunset DRONE_NETRC_FILE\n\nset -e\n\n\necho + \"go test\"\ngo test\n", - "DRONE_SOURCE_BRANCH": "", - "DRONE_STAGE_ARCH": "", - "DRONE_STAGE_DEPENDS_ON": "", - "DRONE_STAGE_FINISHED": "1571810939", - "DRONE_STAGE_KIND": "", - "DRONE_STAGE_MACHINE": "", - "DRONE_STAGE_NAME": "", - "DRONE_STAGE_NUMBER": "0", - "DRONE_STAGE_OS": "", - "DRONE_STAGE_STARTED": "1571810939", - "DRONE_STAGE_STATUS": "success", - "DRONE_STAGE_TYPE": "", - "DRONE_STAGE_VARIANT": "", - "DRONE_SYSTEM_HOST": "", - "DRONE_SYSTEM_HOSTNAME": "", - "DRONE_SYSTEM_PROTO": "", - "DRONE_SYSTEM_VERSION": "", - "DRONE_TARGET_BRANCH": "master", - "DRONE_WORKSPACE": "/drone/src", - "DRONE_WORKSPACE_BASE": "/drone/src", - "DRONE_WORKSPACE_PATH": "", - "GIT_AUTHOR_EMAIL": "noreply@drone", - "GIT_AUTHOR_NAME": "drone", - "GIT_COMMITTER_EMAIL": "noreply@drone", - "GIT_COMMITTER_NAME": "drone", - "GIT_TERMINAL_PROMPT": "0" - }, - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571810939", - "io.drone.expires": "1571814539", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - }, + "environment": {}, + "labels": {}, "name": "test", + "image": "docker.io/library/golang:latest", "volumes": [ { "name": "_workspace", @@ -325,42 +70,12 @@ "temp": { "id": "random", "name": "_workspace", - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571810939", - "io.drone.expires": "1571814539", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - } + "labels": {} } } ], "network": { "id": "random", - "labels": { - "io.drone": "true", - "io.drone.build.number": "0", - "io.drone.created": "1571810939", - "io.drone.expires": "1571814539", - "io.drone.protected": "false", - "io.drone.repo.name": "", - "io.drone.repo.namespace": "", - "io.drone.repo.slug": "", - "io.drone.stage.name": "", - "io.drone.stage.number": "0", - "io.drone.system.host": "", - "io.drone.system.proto": "", - "io.drone.system.version": "", - "io.drone.ttl": "0s" - } + "labels": {} } } \ No newline at end of file diff --git a/engine/compiler/testdata/serial.yml b/engine/compiler/testdata/serial.yml index 9bf3010..925cdc0 100644 --- a/engine/compiler/testdata/serial.yml +++ b/engine/compiler/testdata/serial.yml @@ -2,18 +2,13 @@ kind: pipeline type: docker name: default -server: - image: docker-18-04 - region: nyc1 - size: s-1vcpu-1gb - -token: 3DA541559918A808C2402BBA5012F6C60B27661C - steps: - name: build + image: golang commands: - go build - name: test + image: golang commands: - go test