Hi,
Given the following pipeline configuration, the Pipeline Validator claims it is good but the pipeline gives an error:
There is an error in your bitbucket-pipelines.yml at [pipelines > default > 3 > parallel > 0]. The step section is empty or null.
Thanks your answer.
My pipeline:
image: gradle:8.10.1-jdk21definitions:steps: - step: &deploy-step-template name: Deploy to Environmenttrigger: manualscript: - apt-get update && apt-get install -y jq - export MAJOR=$(jq -r '.major' version.json) - export MINOR=$(jq -r '.minor' version.json) - export PATCH=$(jq -r '.patch' version.json) - export DATE=$(date +%Y%m%d) - export VERSION="$MAJOR.$MINOR.$PATCH-$DATE-$BITBUCKET_BUILD_NUMBER" - apt-get update && apt-get install -y sed - sed -i "s|{{environment}}|$ENVIRONMENT_NAMESPACE|g" k8s/deployment.yaml - sed -i "s|{{version}}|$VERSION|g" k8s/deployment.yaml - pipe: atlassian/kubectl-run:3.11.0variables:KUBE_CONFIG: $KUBE_CONFIGKUBECTL_COMMAND: 'apply' RESOURCE_PATH: 'k8s/deployment.yaml' - sed -i "s|{{environment}}|$ENVIRONMENT_NAMESPACE|g" k8s/service.yaml - pipe: atlassian/kubectl-run:3.11.0variables:KUBE_CONFIG: $KUBE_CONFIGKUBECTL_COMMAND: 'apply' RESOURCE_PATH: 'k8s/service.yaml' services:postgres:image: postgres:latestenvironment:POSTGRES_DB: torep_dbPOSTGRES_USER: torepservicePOSTGRES_PASSWORD: admin123pipelines:default: - step:name: Build and Testcaches: - gradleservices: - postgresscript: - gradle buildartifacts: - build/libs/**/*.jarafter-script: - pipe: atlassian/checkstyle-report:0.3.0 - step:name: Security Scanscript:# Run a security scan for sensitive data. # See more security tools at https://bitbucket.org/product/features/pipelines/integrations?&category=security - pipe: atlassian/git-secrets-scan:0.5.1 - step:name: Generate and push Docker imagetrigger: manualservices: - dockercaches: - dockerscript: - apt-get update && apt-get install -y jq - export MAJOR=$(jq -r '.major' version.json) - export MINOR=$(jq -r '.minor' version.json) - export PATCH=$(jq -r '.patch' version.json) - export DATE=$(date +%Y%m%d) - export VERSION="$MAJOR.$MINOR.$PATCH-$DATE-$BITBUCKET_BUILD_NUMBER" - echo $DOCKER_HUB_TOKEN | docker login -u $DOCKER_HUB_USERNAME --password-stdin - docker build -t bsce/2repservice:$VERSION . - docker push xxx/xxxservice:$VERSION - parallel: - steps: - step:<<: *deploy-step-template name: Deploy to Test1deployment: Test1 - step:<<: *deploy-step-template name: Deploy to Test2deployment: Test2 - step:<<: *deploy-step-template name: Deploy to RC1deployment: RC1 - step:<<: *deploy-step-template name: Deploy to RC2deployment: RC2
G'day, @Zsolt Szabó
Welcome to the community!
The steps key under parallel seems to be misplaced. The steps keyword should be at the same indentation level as - parallel, and the list under steps should contain the individual step entries. The correct structure should be:
steps
parallel
- parallel
step
- parallel: steps: - step: <<: *deploy-step-template name: Deploy to Test1 deployment: Test1 - step: <<: *deploy-step-template name: Deploy to Test2 deployment: Test2 - step: <<: *deploy-step-template name: Deploy to RC1 deployment: RC1 - step: <<: *deploy-step-template name: Deploy to RC2 deployment: RC
I hope this helps.
Regards,Syahrul
Thanks
It looks like you're new here. Sign in or register to get started.