Deployment Using Jenkins task failed

Hi all,

I am putting this here instead of submitting a review because the reviewers won’t be able to see Jenkins config in UI.

Please have a look and let me know what is the problem. The latest update on Git was deployed successfully on all app servers.

@player001 @Inderpreet can you have a look please?

Hi @player001 @Inderpreet,
This task also failed for me today. Everything was working as expected and I think that I made everything as description asked for. Please take a look. Thanks.

Hello @aeldemerdash, @ralimardanov,
The validation script deploy a new file to verify the task. Make sure you copy all files not just the index.html.
Good luck!

Hi @hamdifourati,
hmm, if I’m not mistaken, description said to copy only index file.
Thank you, I’ll try again.

1 Like

Nice catch @hamdifourati!

I confirmed that it deployed another test file for validation and now it worked for me successfully.

Thank you Hamdi

1 Like

Hi @Inderpreet This task is also failed for me today. everything was working fine. Please have a look. Thanks.

6

Hi @fazalmahmood, what was the failure message saying?

@aeldemerdash please check it.

before submitting I double checked it as you can see in screenshot of workspace a file test1.txt and in build History 3 successful build on same screenshot

@Inderpreet this task failed for me also with same message as jenkins job not confugured to deploy latest code

@fazalmahmood, I have used this pattern for copying the files: "* * /* " not “* /” (no spaces)

not sure if this makes any difference though, but if you have a chance to try this out please let me know the result.

Hi @Inderpreet,

This task failed for me with the same message as the others, even though everything seems to be in order. I just saw in this forum, that validation would check using a file other index.html. While i did not specifically check with any file other than index.html, i have configured all the build artefacts to be published on storage server so any other files too should have been published there. The build and SCM polling logs all indicate success. Not sure what went wrong. Can you please check this.
Thanks in advance.

Best regards,
Prashanta

Can you please take a look.

@aeldemerdash it was correct, because I checked on storage and on all app servers, both files index.html and test1.txt files were there after 3 successfull jobs.

The workspace path on jenkins server was /var/jenkins_home/workspace/nautilus-app-deployment, so after workspace was only one directory that’s why */

would you know why publish over ssh to the storage server as natasha is not allowing to publish artifacts. I have setup everything correctly. Am I missing something

Thanks

Do you need to setup the key when configuring server for publish over SSH in the Jenkins configure system. If yes then is it the private key of the root user on ststor01?

Hi @satagrawal, I think that user Natasha cannot write to /data directly without sudo privilege.

You might try removing “/data” from “Remote Directory” then use this script:

#!/bin/bash
echo Bl@kW | sudo -S cp * /data

Thanks for you response. So is it scp * (just one star) or should it be scp ** or scp **/*. Just making sure

And in the build step just use the EXEC Command and not source files correct?

no, I meant to use normal cp after getting the files in Natasha’s home directory. The stars you made were correct and they will copy everything from build artifacts. The point is to leave “Remote Directory” blank which will put them by default in user’s home directory then you exec a command to copy them to /data.

Update: Managed to complete this task successfully now.
Observations: I was using the SCP plugin to push the build artifacts to ststor01:/data earlier. This plugin seems to be unstable as this time the plugin failed to upload the files in some iterations whereas it could in others. Could not investigate why as it seemed random. The SCP Plugin also gives security warnings and therefore it seems best to avoid it.

Instead this time, i used the SSH plugin to upload the files and it worked like a charm.

Thanks Admins @Inderpreet . Overall a good challenging task.

Hi All,

I got this task today and it worked perfectly for me.

I did the below steps which can be helpful if you are stuck anywhere:

  1. Installed Gitea plugin
  2. Added Gitea Server under “Configure System” and Manage Hooks as Yes
  3. Webhook created in Gitea UI to hit the required job when commit happens
  4. Create the required job
    4.1 Give SCM of Gitea Repo
    4.2 Make Build Triggers as Poll SCM which will get triggered from webhook
    4.3 Build Script as below:
    - git clone of the repo in /tmp directory
    - copy all the files forcefully from cloned directory to /data folder
    - clean the /tmp directory so that if job runs again it should work properly.

This is just a basic guideline for this Task.