GoCD run bash script on Pipeline

I got a pipeline called Funcional_Test, I'm trying to run on that pipeline a script located in this path: /home/vagrant/VirtualMachines/software_test.sh

This is te configuration: enter image description here

When I run the pipeline I got these errors: enter image description here

Am I missing something? What can I do to fix the issue?

Upvotes: 1

Views: 3346

Answers (2)

nazeer saleem
nazeer saleem

Reputation: 11

I am using GoCD Version 24.2.0. In it, I use the following structure to run Linux commands on a Linux agent, which is a pipeline created as code in YAML.

            tasks:               
              - exec:
                  command: bash
                  arguments:
                    - -c
                    - |
                      cd "/var/lib/go-agent/pipelines/LinuxPipeline/backend" && npm i
                  run_if: passed 

              - exec:
                  command: bash
                  arguments:
                    - -c
                    - |
                      cd "/var/lib/go-agent/pipelines/LinuxPipeline/frontend" && npm i
                  run_if: passed

Upvotes: 1

Saranraj Gunabalan
Saranraj Gunabalan

Reputation: 73

enter image description here

Mention /bin/sh in Command (change it depends on the script type) Mention the script file in Arguments section in same line

Upvotes: 2

Related Questions