Brigade: brig project create templates

Created on 22 Feb 2019  路  6Comments  路  Source: brigadecore/brigade

It would be really helpful if brig project create would have a template for a Git vs non-Git projects at creation time. When selecting the non-Git option, the following would happen:

  • repository information would not be configurable
  • clone URL information would not be configurable
  • the custom VCS sidecar would be automatically set to NONE
  • Git submodules inforrmation would not be configurable
  • a Brigade.js file would be mandatory (either config map, or local)
  • a secret for the generic gateway would be required
good first issue help wanted

Most helpful comment

@AlverezYari -- yeah, not passing tasks should execute the default entrypoint of the container.

@dgkanatsios -- no, nothing Cobra-related, I used _template_ as a way to differentiate between the VCS vs. non-VCS scenarios.

All 6 comments

I'd love that. Currently, the second prompt of brig project create asks for a repo, which, to the eyes of a new user, makes Brigade appear as a VCS-centric utility. We should align this with the docs enhancement on #806 (i.e. provide more non-Git samples).

Do you think that a simple prompt Do you want Brigade to pull files from a Git repo on every Build? after naming the project would suffice?

Can confirm.. new user trying it out for the first time today and that was the impression I got. Also curious if you actually have to have a job.task = ["somethinghere?"] command in your brigade.js file. The containers we'll be using already have entry points defined, we really just want Brigade to run them to completion in a set order.

The containers we'll be using already have entry points defined, we really just want Brigade to run them to completion in a set order.

Have you checked the scripting guide here on how to write the brigade.js file? Jobs run asynchronously but you can chain them together using JS Promises:

const { events, Job } = require("brigadier")

events.on("exec", () => {
  var hello = new Job("hello", "alpine:3.4")
  hello.tasks = [
    "echo Hello",
    "echo World"
  ]

  var goodbye = new Job("goodbye", "alpine:3.4")
  goodbye.tasks = [
    "echo Goodbye",
    "echo World"
  ]

  hello.run().then(() => {
    goodbye.run()
  })
})

@radu-matei
question: on the new brig project create, if you do want to create a VCS Project, would you be able to configure Generic Gateway secret? I guess not, since if you use a VCS you wouldn't need another Gateway. WDYT?

btw, when you mention template, is this a reference to anything cobra related or this switch from VCS to non-VCS questions should be manually created?

@dgkanatsios Yep, working through it now. I was just curious if you had to have to actually have anything within task brackets, or if you left it blank it would still run the container with its default set entry point which appears to appears to work fine.

@AlverezYari -- yeah, not passing tasks should execute the default entrypoint of the container.

@dgkanatsios -- no, nothing Cobra-related, I used _template_ as a way to differentiate between the VCS vs. non-VCS scenarios.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mattfarina picture mattfarina  路  4Comments

blimmer picture blimmer  路  6Comments

radu-matei picture radu-matei  路  5Comments

Strandedpirate picture Strandedpirate  路  8Comments

carolynvs picture carolynvs  路  5Comments