travis-ci / beta-features

The perfect place to leave feedback and comments on newly released Beta Features.
56 stars 68 forks source link

build stage: configuration not intuitive #35

Closed bchenSyd closed 6 years ago

bchenSyd commented 6 years ago

I can understand how build stage is current designed. It's just not intuitive. the structure suggests that one stage can only contain one script, and if you want more than one scripts in one stage, you need to define a new script following current stage, whilst it should be defined within the stage, isn't it?

would below configuration makes more sense?

job:
  stage:
  - name: stage1
    jobs:
    - script 1
    - script 2
  - name: stage2
    jobs:
    - script 3
    - script 4
maticzav commented 6 years ago

Actually, as far as I understand this, you can specify multiple jobs, just by inserting them without stage property.

# From the examples
jobs:
  include:
    - stage: test
      script: ./test 1
    - # stage name not required, will continue to use `test`
      script: ./test 2
    - stage: deploy
      script: ./deploy

So the equivalent of your code, should, I suppose, be:

jobs:
  include:
    - stage: stage1
       script: script1
       script: script2
    - stage: stage2
       script: script3
       script: script4

I do agree though, that it could be done better. I love how circleci implemented this using deployment property instead of jobs and assigning specifics there.

deployment:
  production:
    branch: production
    commands:
      - cmd1
      - cmd2
bchenSyd commented 6 years ago

I dont thinks its a valid ymal file

jobs:
  include:
    - stage: stage1
       script: script1
       script: script2
    - stage: stage2
       script: script3
       script: script4
maticzav commented 6 years ago

sorry, correct yaml file:

jobs:
  include:
    - stage: stage1
      script: script1
      script: script2
    - stage: stage2
      script: script3
      script: script4
cytopia commented 6 years ago

Valid, but script: script2 will overwrite script: script1 and script: script4 will overwrite script: script3

joshk commented 6 years ago

As Stages is now released and GA, I'm going to close this issue.

If you have any feedback on improvements we should consider, please feel free to add a discussion in our new Community forum: https://travis-ci.community/c/product

Happy building

Josh