Make the stage block behave more consistently like other blocks
None of the other blocks have parenthesis and take arguments the way the stage(name) does. To make all blocks behave a bit more in line with one another, this commit changes the behavior of naming stages to look more like a generalized block settings. This presages some macro work that's coming in the following commits.
This commit is contained in:
parent
9307068785
commit
ff919ce892
6
Otto.g4
6
Otto.g4
|
@ -121,12 +121,12 @@ stages_block
|
|||
: STAGES BEGIN stages+ END
|
||||
;
|
||||
stages
|
||||
: STAGE OPEN StringLiteral CLOSE BEGIN stageStatements* END
|
||||
: STAGE BEGIN stageStatements* END
|
||||
;
|
||||
|
||||
|
||||
stageStatements
|
||||
: steps
|
||||
: settings
|
||||
| steps
|
||||
| runtime
|
||||
| cache
|
||||
| gates
|
||||
|
|
|
@ -45,7 +45,9 @@ environments {
|
|||
|
||||
pipeline {
|
||||
stages {
|
||||
stage('Build') {
|
||||
stage {
|
||||
name = 'Build'
|
||||
|
||||
runtime {
|
||||
docker {
|
||||
image = 'ruby'
|
||||
|
@ -64,7 +66,9 @@ pipeline {
|
|||
}
|
||||
}
|
||||
|
||||
stage('Test') {
|
||||
stage {
|
||||
name = 'Test'
|
||||
|
||||
runtime {
|
||||
from 'Build'
|
||||
}
|
||||
|
@ -78,8 +82,11 @@ pipeline {
|
|||
}
|
||||
}
|
||||
|
||||
stage('Deploy') {
|
||||
stage('Pre-production') {
|
||||
stage {
|
||||
name = 'Deploy'
|
||||
|
||||
stage {
|
||||
name = 'Pre-production'
|
||||
/*
|
||||
* Indicate that the stage is going to interact with the preprod stage
|
||||
* and the preprod environment settings must be made available to steps
|
||||
|
@ -129,7 +136,10 @@ pipeline {
|
|||
}
|
||||
}
|
||||
|
||||
stage('Production') {
|
||||
stage {
|
||||
name = 'Production'
|
||||
environment -> production
|
||||
|
||||
gates {
|
||||
from 'Pre-production'
|
||||
|
||||
|
@ -149,7 +159,6 @@ pipeline {
|
|||
}
|
||||
|
||||
}
|
||||
environment -> production
|
||||
|
||||
runtime {
|
||||
from 'Build'
|
||||
|
|
|
@ -40,7 +40,8 @@ configure {
|
|||
|
||||
pipeline {
|
||||
stages {
|
||||
stage('Build') {
|
||||
stage {
|
||||
name = 'Build'
|
||||
runtime {
|
||||
docker {
|
||||
image = 'ruby:latest'
|
||||
|
@ -56,7 +57,8 @@ pipeline {
|
|||
}
|
||||
}
|
||||
|
||||
stage('Test') {
|
||||
stage {
|
||||
name = 'Test'
|
||||
runtime {
|
||||
from 'Build'
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue