ktomk / pipelines

Pipelines - Run Bitbucket Pipelines Wherever They Dock
https://ktomk.github.io/pipelines/
GNU Affero General Public License v3.0
109 stars 10 forks source link

Validator fails on pipes in steps #5

Closed vincenzoromeo closed 4 years ago

vincenzoromeo commented 4 years ago

Background

I'm trying to validate my pipelines with pipelines --show bitbucket-pipeline.yaml.

Using latest .phar release as of time of writing.

bitbucket-pipelines.yml:

pipelines:

  branches:
    develop:
    - step:
        name: Deploy to staging
        deployment: staging
        script:
          - pipe: atlassian/rsync-deploy:0.4.2
            variables:
              USER: 'ec2-user'
              SERVER: '${SERVER_HOST}'
              REMOTE_PATH: '/home/ec2-user/app'
              LOCAL_PATH: '$PWD'
              EXTRA_ARGS: '--exclude=".git*"'
          - 'echo "Hello, World!"' 

Expected Results

Expected this file to pass with flying colours - verified its correctness with the official online validator.

Actual Results

pipelines --show bitbucket-pipelines.yml 
PIPELINE ID         IMAGES    STEPS                                                         
branches/develop    ERROR     'script' requires a list of commands, step #0 is not a command
ktomk commented 4 years ago

Yes, this is clearly an issue, thanks for your report.

I made a new release with a fix for showing the file:

$ pipelines --file tests/data/yml/pipe.yml --show
PIPELINE ID         IMAGES                     STEPS                  
branches/develop    ktomk/pipelines:busybox    1 ("Deploy to staging")

It might be limited b/c for pipelines the pipe feature is not yet available in full.

Based on your report I made a fake run at least possible:

$ pipelines --file tests/data/yml/pipe.yml --trigger branch:develop  
+++ step #1

    name...........: "Deploy to staging"
    effective-image: ktomk/pipelines:busybox
    container......: pipelines-1.Deploy-to-staging.branches-develop.pipelines
    container-id...: 7c3d65595141

+++ copying files into container...

+ echo "pipe: atlassian/rsync-deploy:0.4.2 (pending feature)" # pipe feature is pending
echo '  USER (ec2-user):' ec2-user
echo '  SERVER (${SERVER_HOST}):' ${SERVER_HOST}
echo '  REMOTE_PATH (/home/ec2-user/app):' /home/ec2-user/app
echo '  LOCAL_PATH ($PWD):' $PWD
echo '  EXTRA_ARGS (--exclude=".git*"):' --exclude=".git*"

pipe: atlassian/rsync-deploy:0.4.2 (pending feature)
  USER (ec2-user): ec2-user
  SERVER (${SERVER_HOST}):
  REMOTE_PATH (/home/ec2-user/app): /home/ec2-user/app
  LOCAL_PATH ($PWD): /app
  EXTRA_ARGS (--exclude=".git*"): --exclude=.git*

+ echo "Hello, World!"
Hello, World!

The pipelines version with the fix is 0.0.34. Does this already solve the issue for you?

vincenzoromeo commented 4 years ago

Yep, that solves it indeed. Thanks!

And kudos to you for making and maintaining this project. These days, I spend so much time in lengthy write->deploy->test loops on various cloud applications. So when a project like yours comes along and takes so much of the pain out of remote debugging/testing it is very much appreciated :pray:

ktomk commented 4 years ago

Yes, there is no better build than the local build. Thanks for your report it was a pleasure.