Scenario for Jenkins Pipeline

35 views
Skip to first unread message

addie k

unread,
Dec 4, 2017, 12:55:39 PM12/4/17
to Jenkins Users
Hey Group,

I am new to Jenkins. We are creating a CI/CD pipeline and I had some basic questions. Following is my scenario:

  1. Node project is cloned from Git repo and built.
  2. The test cases are run and unit test code coverage report is generated
  3. The artifacts are then to be used by SonarQube analysis task.
  4. With all the above steps successful, the built artifact will be pushed to cloud foundry.
  5. The artifacts here are basically the contents of the workspace directory - they are not zipped or anything. The total size is approx 200 MB.
My questions are:

  1. Will it be a good idea that task#1 and task#2 be a part of the same Jenkins project? I tried isolating them into two separate projects but since task#2 uses the artifacts in task#1, I find the copy-artifact between the two workspaces to be time-consuming.
  2. Task #3 uses the artifacts produced in Task #2 and Task #1. If I isolate Task#3 in a separate Jenkins project, I am facing the same problem of artifacts being copied and taking time. 
  3. I tried using the Jenkins "Pipeline" project. But I am confused - the tasks will use their workspace individually and create artifacts in their own job directories, so how will the pipeline bring them together? Is this even a good candidate for the pipeline? 
Sorry about this, as I am new to this, I have these questions. If you can help me understand this here, I will really appreciate! I will be happy to provide more information in case I am not clear anywhere.

Thanks,
addie
Message has been deleted

Bill Dennis

unread,
Dec 6, 2017, 4:06:41 AM12/6/17
to Jenkins Users
Did you consider using a single declarative pipeline for this with multiple stages? If you make the agent declaration at main pipeline level, the same workspace should be used for each stage so no need to copy the 200MB of files around - see this stack overflow https://stackoverflow.com/questions/43948248/jenkins-declarative-pipeline-what-workspace-is-associated-with-a-stage-when-the

I generally find Stack Overflow better for answers to Jenkins pipeline questions, as mostly someone has already asked my question there and got an answer.

Bill


On Tuesday, 5 December 2017 22:40:20 UTC, addie k wrote:
> After waiting for a response I thought it is best to figure these things out by myself by trial and error. 
>
>
> In the end I decided to go with using pipeline.
>
>
>
>
> Thanks a lot for the incredible help that I got here. Very helpful indeed.
>
>
>
>
>
> On Tuesday, December 5, 2017 at 4:55:39 AM UTC+11, addie k wrote:
> Hey Group,
>
>
> I am new to Jenkins. We are creating a CI/CD pipeline and I had some basic questions. Following is my scenario:
>
>
> Node project is cloned from Git repo and built.The test cases are run and unit test code coverage report is generatedThe artifacts are then to be used by SonarQube analysis task.With all the above steps successful, the built artifact will be pushed to cloud foundry.The artifacts here are basically the contents of the workspace directory - they are not zipped or anything. The total size is approx 200 MB.
> My questions are:
>
>
> Will it be a good idea that task#1 and task#2 be a part of the same Jenkins project? I tried isolating them into two separate projects but since task#2 uses the artifacts in task#1, I find the copy-artifact between the two workspaces to be time-consuming.Task #3 uses the artifacts produced in Task #2 and Task #1. If I isolate Task#3 in a separate Jenkins project, I am facing the same problem of artifacts being copied and taking time. I tried using the Jenkins "Pipeline" project. But I am confused - the tasks will use their workspace individually and create artifacts in their own job directories, so how will the pipeline bring them together? Is this even a good candidate for the pipeline? 
Reply all
Reply to author
Forward
0 new messages