Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .kokoro/Generate-Configs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# A powershell script for inspecting the source tree and generating test configs.

# Given something like 'a\b\c', return ['a', 'b', 'c']
function Explode-Path([string] $Path) {
return $Path.Replace('\', '/').Split('/')
}

# Given a list of files, converts their paths into names of config files.
# Example: foo/bar/package.json => foo-bar.cfg.
function Collect-Names {
# Use a dictionary to de-duplicate the directories.
$names = @{}
foreach ($item in $input) {
$relPath = [string] (Resolve-Path -Relative (Split-Path -Parent $item))
# Remove the '.\' at the beginning of the string.
$dir = $relPath.Substring(2)
# replace slashes with hyphenes.
$name = $dir.Replace('/', '-').Replace('\', '-')
$names[$name] = Explode-Path($dir)
}
return $names
}

Push-Location
try {
Set-Location ..
$packageJsons = Get-ChildItem -Recurse package.json
$testDirs = Get-ChildItem -Recurse *test | Where-Object { Test-Path -Path $_ -PathType Container}
$names = ($packageJsons + $testDirs | Collect-Names)
} finally {
Pop-Location
}

# Replace cloudtasks with "foo/bar"
$template = @'
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "cloudtasks"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
'@

foreach ($name in $names.Keys) {
$pathFragments = $names[$name]
if (-not $pathFragments[0]) { continue }
# For some directories like appengine and functions, we put the configs
# in subdirectories. For others, we do not.
$pathFragments -join '/'
$configPath = if (Test-Path $pathFragments[0]) {
$dir = $pathFragments[0]
$n = $pathFragments.Count - 1
$name = $pathFragments[1..$n] -join '-'
"$dir/$name.cfg"
} else {
"$name.cfg"
}
$srcDir = $pathFragments -join '/'
$template.Replace('cloudtasks', $srcDir) `
| Out-File -FilePath $configPath -Encoding utf8
}
20 changes: 13 additions & 7 deletions .kokoro/appengine/analytics.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/analytics"
}
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/analytics"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/building-an-app-build.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/building-an-app/build"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/building-an-app-update.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/building-an-app/update"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
18 changes: 12 additions & 6 deletions .kokoro/appengine/cloudsql.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/cloudsql"
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/cloudsql"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/cloudsql_postgresql.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/cloudsql_postgresql"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/cloudtasks.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/cloudtasks"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
20 changes: 13 additions & 7 deletions .kokoro/appengine/datastore.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/datastore"
}
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/datastore"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
18 changes: 12 additions & 6 deletions .kokoro/appengine/endpoints.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/endpoints"
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/endpoints"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
18 changes: 12 additions & 6 deletions .kokoro/appengine/errorreporting.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/errorreporting"
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/errorreporting"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/grunt.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/grunt"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/headless-chrome.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/headless-chrome"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/hello-world-flexible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/hello-world/flexible"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/hello-world-standard.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/hello-world/standard"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/loopback.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/loopback"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
20 changes: 13 additions & 7 deletions .kokoro/appengine/mailjet.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/mailjet"
}
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/mailjet"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/memcached.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/memcached"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/metadata-flexible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/metadata/flexible"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/metadata-standard.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/metadata/standard"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/mongodb.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/mongodb"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/appengine/parse-server.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Set the folder in which the tests are run
env_vars: {
key: "PROJECT"
value: "appengine/parse-server"
}

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/build.sh"
}
Loading