From 49d0cfcd9e7848c4ed3a19decc05afa584cca21c Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Fri, 23 Oct 2020 10:33:43 +0200 Subject: [PATCH 1/2] Add files: to campaign spec steps --- schema/campaign_spec.schema.json | 10 ++++++++++ schema/campaign_spec_stringdata.go | 10 ++++++++++ schema/schema.go | 5 +++++ 3 files changed, 25 insertions(+) diff --git a/schema/campaign_spec.schema.json b/schema/campaign_spec.schema.json index d1d33ae8adf3..ba93b8d694c8 100644 --- a/schema/campaign_spec.schema.json +++ b/schema/campaign_spec.schema.json @@ -81,6 +81,16 @@ "additionalProperties": { "type": "string" } + }, + "files": { + "type": "object", + "description": "Files that should be mounted into or be created inside the Docker container.", + "additionalProperties": { + "oneOf": [ + {"type": "string"}, + {"type":"object", "additionalProperties": false, "properties": {"fromFile": {"type":"string"}}} + ] + } } } } diff --git a/schema/campaign_spec_stringdata.go b/schema/campaign_spec_stringdata.go index 39e563d2f414..5b792609632e 100644 --- a/schema/campaign_spec_stringdata.go +++ b/schema/campaign_spec_stringdata.go @@ -86,6 +86,16 @@ const CampaignSpecSchemaJSON = `{ "additionalProperties": { "type": "string" } + }, + "files": { + "type": "object", + "description": "Files that should be mounted into or be created inside the Docker container.", + "additionalProperties": { + "oneOf": [ + {"type": "string"}, + {"type":"object", "additionalProperties": false, "properties": {"fromFile": {"type":"string"}}} + ] + } } } } diff --git a/schema/schema.go b/schema/schema.go index 4faca8c05468..fc5e9963d776 100644 --- a/schema/schema.go +++ b/schema/schema.go @@ -45,6 +45,9 @@ type AWSCodeCommitGitCredentials struct { // Username description: The Git username Username string `json:"username"` } +type AdditionalProperties struct { + FromFile string `json:"fromFile,omitempty"` +} // AuthAccessTokens description: Settings for access tokens, which enable external tools to access the Sourcegraph API with the privileges of the user. type AuthAccessTokens struct { @@ -1249,6 +1252,8 @@ type Step struct { Container string `json:"container"` // Env description: Environment variables to set in the environment when running this command. Env map[string]string `json:"env,omitempty"` + // Files description: Files that should be mounted into or be created inside the Docker container. + Files map[string]interface{} `json:"files,omitempty"` // Run description: The shell command to run in the container. It can also be a multi-line shell script. The working directory is the root directory of the repository checkout. Run string `json:"run"` } From daa205fefb77cf3c7cc879cf6e6c846dab43e6c1 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Mon, 26 Oct 2020 15:21:18 +0100 Subject: [PATCH 2/2] Remove fromFile: from campaignSpec --- schema/campaign_spec.schema.json | 5 +---- schema/campaign_spec_stringdata.go | 5 +---- schema/schema.go | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/schema/campaign_spec.schema.json b/schema/campaign_spec.schema.json index ba93b8d694c8..deacad369c52 100644 --- a/schema/campaign_spec.schema.json +++ b/schema/campaign_spec.schema.json @@ -86,10 +86,7 @@ "type": "object", "description": "Files that should be mounted into or be created inside the Docker container.", "additionalProperties": { - "oneOf": [ - {"type": "string"}, - {"type":"object", "additionalProperties": false, "properties": {"fromFile": {"type":"string"}}} - ] + "type": "string" } } } diff --git a/schema/campaign_spec_stringdata.go b/schema/campaign_spec_stringdata.go index 5b792609632e..df497571ea6f 100644 --- a/schema/campaign_spec_stringdata.go +++ b/schema/campaign_spec_stringdata.go @@ -91,10 +91,7 @@ const CampaignSpecSchemaJSON = `{ "type": "object", "description": "Files that should be mounted into or be created inside the Docker container.", "additionalProperties": { - "oneOf": [ - {"type": "string"}, - {"type":"object", "additionalProperties": false, "properties": {"fromFile": {"type":"string"}}} - ] + "type": "string" } } } diff --git a/schema/schema.go b/schema/schema.go index fc5e9963d776..8b0f8da63563 100644 --- a/schema/schema.go +++ b/schema/schema.go @@ -45,9 +45,6 @@ type AWSCodeCommitGitCredentials struct { // Username description: The Git username Username string `json:"username"` } -type AdditionalProperties struct { - FromFile string `json:"fromFile,omitempty"` -} // AuthAccessTokens description: Settings for access tokens, which enable external tools to access the Sourcegraph API with the privileges of the user. type AuthAccessTokens struct { @@ -1253,7 +1250,7 @@ type Step struct { // Env description: Environment variables to set in the environment when running this command. Env map[string]string `json:"env,omitempty"` // Files description: Files that should be mounted into or be created inside the Docker container. - Files map[string]interface{} `json:"files,omitempty"` + Files map[string]string `json:"files,omitempty"` // Run description: The shell command to run in the container. It can also be a multi-line shell script. The working directory is the root directory of the repository checkout. Run string `json:"run"` }