Skip to content

Add coder_script parameter for script_args #454

@djarbz

Description

@djarbz

I recently pushed the copyparty module to the registry and while creating it, I found that I had to template some CLI args that I really just needed to pass onto a final binary process.

In my case, I was populating an array of arguments, and actually created a bug in my module based on how they were being passed and parsed.

It would be nice to add an arguments parameter for things that just need to be passed on to the next process similar to defining the CMD parameter for a container.

resource "coder_script" "code-server" {
  agent_id           = coder_agent.dev.id
  display_name       = "code-server"
  icon               = "/icon/code.svg"
  run_on_start       = true
  start_blocks_login = true
  script = templatefile("./install-code-server.sh", {
    LOG_PATH : "/tmp/code-server.log"
  })
  script_arguments = [
    "Arg1",
    "Arg2",
    "Arg3",
  ]
}

Then in my script I could have the following:

mybin "${@}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions