Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,373
Community Members
 
Community Events
165
Community Groups

Local Bitbucket Windows run script

I wrote a basic python script for testing bitbucket-pipelines.yml files locally:

bitbucket_pipelines_test.py 

This allows you to test a bitbucket-pipelines.yml file locally without pushing it to a repository.

The 'script' blocks in each step run as a powershell script.

Example usage:

python bitbucket_pipelines_test.py "Pipeline step 1" --env env.json

 

1 comment

Hi @Mark Blackburn ,

 

The windows runner, runs the powershell scripts in non-interactive mode. Anything that needs interaction with the user is blocked.


For the above script that you are running what sort of error do you see in the logs of the runner? 

I need more information to help on this issue.

Can you please check :

1. If the script that you are running is not an interactive script.

2. If you can get the runner logs and share it with us.

 

Regards,

Jayant

This is not an issue report. I was sharing a script I use for local testing of pipelines. I posted this to share with other users. I guess my description was lacking.

I find it difficult to test a powershell script before putting it into the script block of the bitbucket_pipelines.yml file since you often have to put quotes around some lines and it's never as simple as just putting the '-' in front of all your script lines.

The point of my powershell script is to read the script blocks from the yml file and let you execute them for testing without having to push your working copy and wait for the pipeline to get to the script block you are working on. And catching the .yml parse errors when you copying from a powershell script into the .yml file.

Comment

Log in or Sign up to comment
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you