Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bau/fix src path #10

Merged
merged 2 commits into from
Mar 14, 2024
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
240 changes: 120 additions & 120 deletions src/Pipeline.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -10,201 +10,201 @@ groups: Listing<Group>?
display: Display?

open class Resource {
name: Identifier
type: Identifier
source: Config
old_name: Identifier?
icon: String?
version: Version?
check_every: (ConcourseDuration | "never")?
check_timeout: Duration?
expose_build_created_by: Boolean?
tags: Listing<String>?
public: Boolean?
webhook_token: String?
name: Identifier
type: Identifier
source: Config
old_name: Identifier?
icon: String?
version: Version?
check_every: (ConcourseDuration|"never")?
check_timeout: Duration?
expose_build_created_by: Boolean?
tags: Listing<String>?
public: Boolean?
webhook_token: String?
}

open class ResourceType {
name: Identifier
type: Identifier
source: Config
privileged: Boolean?
params: Config?
check_every: ConcourseDuration?
tags: Listing<String>?
defaults: Config?
name: Identifier
type: Identifier
source: Config
privileged: Boolean?
params: Config?
check_every: ConcourseDuration?
tags: Listing<String>?
defaults: Config?
}

open class Group {
name: Identifier
jobs: Listing<Identifier>?
name: Identifier
jobs: Listing<Identifier>?
}

open class Display {
background_image: String?
background_image: String?
}

open class Job {
name: Identifier
plan: Listing<Step>
old_name: Identifier?
serial: Boolean?
serial_groups: Listing<Identifier>?
max_in_flight: Int?
build_log_retention: BuildLogRetentionPolicy?
build_logs_to_retain: Int?
public: Boolean?
disable_manual_trigger: Boolean?
interruptible: Boolean?
on_success: Step?
on_failure: Step?
on_error: Step?
on_abort: Step?
ensure: Step?
name: Identifier
plan: Listing<Step>
old_name: Identifier?
serial: Boolean?
serial_groups: Listing<Identifier>?
max_in_flight: Int?
build_log_retention: BuildLogRetentionPolicy?
build_logs_to_retain: Int?
public: Boolean?
disable_manual_trigger: Boolean?
interruptible: Boolean?
on_success: Step?
on_failure: Step?
on_error: Step?
on_abort: Step?
ensure: Step?
}

open class BuildLogRetentionPolicy {
days: Int?
builds: Int?
minimum_succeeded_builds: Int(builds > 0)?
days: Int?
builds: Int?
minimum_succeeded_builds: Int(builds > 0)?
}

abstract class Step {
timeout: ConcourseDuration?
attempts: Int?
tags: Listing<String>?
on_success: Step?
on_failure: Step?
on_abort: Step?
on_error: Step?
ensure: Step?
timeout: ConcourseDuration?
attempts: Int?
tags: Listing<String>?
on_success: Step?
on_failure: Step?
on_abort: Step?
on_error: Step?
ensure: Step?
}

abstract class AcrossCapableStep extends Step {
across: Listing<AcrossVar>?
across: Listing<AcrossVar>?
}

open class AcrossVar {
var: Identifier
values: Listing<Value>
max_in_flight: (Int | "all")?
fail_fast: Boolean?
var: Identifier
values: Listing<Value>
max_in_flight: (Int|"all")?
fail_fast: Boolean?
}

open class GetStep extends Step {
get: Identifier
resource: Identifier?
passed: Listing<Identifier>?
params: Config?
trigger: Boolean?
version: (Version | "every" | "latest")?
get: Identifier
resource: Identifier?
passed: Listing<Identifier>?
params: Config?
trigger: Boolean?
version: (Version|"every"|"latest")?
}

open class PutStep extends Step {
put: Identifier?
resource: Identifier?
inputs: (Listing<Identifier> | "all" | "detect")?
params: Config?
get_params: Config?
no_get: Boolean?
put: Identifier?
resource: Identifier?
inputs: (Listing<Identifier>|"all"|"detect")?
params: Config?
get_params: Config?
no_get: Boolean?
}

open class TaskStep extends AcrossCapableStep {
task: Identifier
config: TaskConfig?
file: FilePath?
image: Identifier?
privileged: Boolean?
vars: Vars?
container_limits: ContainerLimits?
params: EnvVars?
input_mapping: Mapping<Identifier, Identifier>?
output_mapping: Mapping<Identifier, Identifier>?
task: Identifier
config: TaskConfig?
file: FilePath?
image: Identifier?
privileged: Boolean?
vars: Vars?
container_limits: ContainerLimits?
params: EnvVars?
input_mapping: Mapping<Identifier, Identifier>?
output_mapping: Mapping<Identifier, Identifier>?
}

open class SetPipelineStep extends AcrossCapableStep {
set_pipeline: Identifier | "self"
file: FilePath
instance_vars: Vars?
vars: Vars?
var_files: Listing<FilePath>?
team: Identifier?
set_pipeline: Identifier|"self"
file: FilePath
instance_vars: Vars?
vars: Vars?
var_files: Listing<FilePath>?
team: Identifier?
}

open class LoadVarStep extends AcrossCapableStep {
load_var: Identifier
file: FilePath
format: ("json" | "yaml" | "yml" | "trim" | "raw")?
reveal: Boolean?
load_var: Identifier
file: FilePath
format: ("json"|"yaml"|"yml"|"trim"|"raw")?
reveal: Boolean?
}

open class InParallelStep extends AcrossCapableStep {
in_parallel: InParallelConfig | Listing<Step>
in_parallel: InParallelConfig|Listing<Step>
}

open class DoStep extends AcrossCapableStep {
do: Listing<Step>
do: Listing<Step>
}

open class TryStep extends AcrossCapableStep {
try: Step
try: Step
}

open class ContainerLimits {
cpu: Int?
memory: Int?
cpu: Int?
memory: Int?
}

open class InParallelConfig {
steps: Listing<Step>
limit: Int?
fail_fast: Boolean?
steps: Listing<Step>
limit: Int?
fail_fast: Boolean?
}

abstract class VarSource {
name: Identifier
name: Identifier
}

open class VaultVarSource extends VarSource {
type: "vault"
config: VaultConfig
type: "vault"
config: VaultConfig
}

open class VaultConfig {
url: String
ca_cert: String?
path_prefix: String?
lookup_templates: Listing<String>?
shared_path: String?
namespace: String?
client_cert: String?
client_key: String?
server_name: String?
insecure_skip_verify: Boolean?
client_token: String?
auth_backend: String?
auth_params: Mapping<String, String>?
auth_max_ttl: ConcourseDuration?
auth_retry_max: ConcourseDuration?
auth_retry_initial: ConcourseDuration?
url: String
ca_cert: String?
path_prefix: String?
lookup_templates: Listing<String>?
shared_path: String?
namespace: String?
client_cert: String?
client_key: String?
server_name: String?
insecure_skip_verify: Boolean?
client_token: String?
auth_backend: String?
auth_params: Mapping<String, String>?
auth_max_ttl: ConcourseDuration?
auth_retry_max: ConcourseDuration?
auth_retry_initial: ConcourseDuration?
}

open class SSMVarSource extends VarSource {
type: "ssm"
config: SSMConfig
type: "ssm"
config: SSMConfig
}

open class SSMConfig {
region: String
region: String
}

open class DummyVarSource extends VarSource {
type: "dummy"
config: DummyConfig
type: "dummy"
config: DummyConfig
}

open class DummyConfig {
vars: Vars
vars: Vars
}

typealias Config = Mapping<String, Any>
Expand Down
4 changes: 2 additions & 2 deletions src/PklProject
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ amends "pkl:Project"

package {
name = "pkl-concourse-pipeline"
version = "0.0.1"
version = "0.0.2"
license = "MIT"
baseUri = "package://pkg.pkl-lang.org/github.com/alphagov/pkl-concourse-pipeline"
sourceCode = "https://github.com/alphagov/pkl-concourse-pipeline"
sourceCodeUrlScheme = "\(sourceCode)/blob/\(name)@\(version)%{path}#L%{line}-L%{endLine}"
sourceCodeUrlScheme = "\(sourceCode)/blob/\(name)@\(version)/src%{path}#L%{line}-L%{endLine}"
packageZipUrl = "https://github.com/alphagov/pkl-concourse-pipeline/releases/download/\(name)@\(version)/\(name)@\(version).zip"
description = """
Pkl Modules for concourse pipelines.
Expand Down
32 changes: 16 additions & 16 deletions src/TaskConfig.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module concourse_pipeline.TaskConfig

import "./Pipeline.pkl"

platform: "linux" | "darwin" | "windows"
platform: "linux"|"darwin"|"windows"
image_resource: AnonymousResource
inputs: Listing<Input>?
outputs: Listing<Output>?
Expand All @@ -13,34 +13,34 @@ rootfs_uri: String?
container_limits: Pipeline.ContainerLimits?

open class AnonymousResource {
type: Pipeline.Identifier
source: Pipeline.Config
params: Pipeline.Config?
version: Pipeline.Version?
type: Pipeline.Identifier
source: Pipeline.Config
params: Pipeline.Config?
version: Pipeline.Version?
}

open class Run {
path: Pipeline.FilePath
args: Listing<String>?
dir: Pipeline.DirPath?
user: String?
path: Pipeline.FilePath
args: Listing<String>?
dir: Pipeline.DirPath?
user: String?
}

open class Input {
name: Pipeline.Identifier
path: Pipeline.DirPath?
optional: Boolean?
name: Pipeline.Identifier
path: Pipeline.DirPath?
optional: Boolean?
}

open class Output {
name: Pipeline.Identifier
path: Pipeline.DirPath?
name: Pipeline.Identifier
path: Pipeline.DirPath?
}

open class Cache {
path: Pipeline.DirPath
path: Pipeline.DirPath
}

output {
renderer = new YamlRenderer {}
renderer = new YamlRenderer {}
}
Loading