0

I am working on creating a freestyle CICD job that will build a GitHub project and deploy it on an environment.

We have an inventory that lists the branch name it should match and the QAEnvironment it needs to be deployed to.

We have two jobs, Job A builds and passed the branch name successfully but we need job A to also read the environment in the inventory file on Git and pass the QAEnvironment onto Job B. Job B should pick up the QAEnvironment that Job A had read from the inventory file and use it to deploy onto the appropriate environment.

I'm aware that the shell script environment is wiped out once the shell stops running, is there a workaround to this issue?

Thanks!

Lgalan90
  • 595
  • 2
  • 12
  • 31

1 Answers1

1

This link worked for me: Passing variable from shell script to jenkins

I ended up passing the variable into a .prop file and in Job B you need to check Inject environment variables to the build process and point it to the .prop file that was created

Lgalan90
  • 595
  • 2
  • 12
  • 31