wget command error in jenkins - jenkins

I am trying to run below command using Jenkins shell:
wget -r --no-parent --reject "index.html*" http://${IP}/ranjans/ -P ${WORKSPACE}/tests
File is getting downloaded but my Jenkins job is marked failure. Am I missing anything here?

You might try looking at the no clobber option. I wonder if you are getting a bad result from wget because you are running this multiple times, and wget is complaining because the files already exist.
To double check that it is indeed wget that is failing, try printing out the exit value of wget. If it is 0, its a problem elsewhere.

Related

Recursive copy of grails maven repository with wget

This post is part of this one
I want to copy this repository on my local computer : https://repo.grails.org/grails/core/
To achieve my goal, I ran all night long this wget command :
wget -r -l=inf --no-parent --reject "index.html" https://repo.grails.org/grails/core"
This morning, the wget command was ended, and I went into ".m2e", and instead of having the subfolders "connectors" and "discovery_catalog" as expected, I have an "index.htm.tmp" file.
Same on all the folders (".meta", ".nexus", ".report", and so on).
How can I mirror this maven repository using wget ? Is wget the right tool for this ?
Thanks in advance.
The error was due to an Internet connection error.
I tried the same command on a subfolder and all worked as expected.
Sorry for the question, due to the massive amount of data on core grails repository, the script crashed and I thought it was ended.

Bazel fails to run command, by hand it works. How to debug?

I am trying to compile tensorflow in a bit difficult environment (Centos 6.2 with a load of "own" compilations).
A lot of problems I have solved already, but the one baffling me is a SWIG error. I run with "--verbose_failures" and I can see the command that bazel tries to run:
(cd /home/../.cache/bazel/_bazel../[long-hexa]/execroot/org_tensorflow && \
exec env - \
bazel-out/host/bin/external/swig/swig -c++ ...
It fails with "Exit 1: swig failed: error executing command.
However, when I cd to the mentioned directory and run the mentioned bazel-out/../swig command it succeeds! What I have understood is that this probably is a problem of bazel trying to sanitize the environment.
How can I go to debug this? Is there a way to show what environment variables bazel is using?

fpm is not recognised if executing script with jenkins and ssh

I am trying to execute a script over ssh connexion with Jenkins. I am using the SSH plugin and it is well configured. I arrive to execute the first part of the script, but when I try to execute a fpm command it says:
fpm: command not found
If I connect to the instance and run the same script that I call via Jenkins it runs and there is no error (fpm is installed).
So, I have created a test like a script test.sh:
#!/bin/bash -x
fpm
but, with Jenkins, I get the same error: fpm: command not found, while if I execute it I get a normal "parameter needed":
Missing required -s flag. What package source did you want? {:level=>:warn}
Missing required -t flag. What package output did you want? {:level=>:warn}
No parameters given. You need to pass additional command arguments so that I know what you want to build packages from. For example, for '-s dir' you would pass a list of files and directories. For '-s gem' you would pass a one or more gems to package from. As a full example, this will make an rpm of the 'json' rubygem: `fpm -s gem -t rpm json` {:level=>:warn}
Fix the above problems, and you'll be rolling packages in no time! {:level=>:fatal}
What am I missing? Why it cannot find fpm if it is installed?
Make sure fpm is in /usr/bin..
It seems that the problem came because the fpm was installed in the /home/user2connect/bin/, and the command was not recognised. For fixing this I had to call it wit the whole path:
/home/user2connect/bin/fpm ...
I have chosen to reinstall the fpm using sudo, so now it works.

Dockerfile build - possible to ignore error?

I've got a Dockerfile. When building the image, the build fails on this error:
automake: error: no 'Makefile.am' found for any configure output
Error build: The command [/bin/sh -c aclocal && autoconf && automake -a] returned a non-zero code: 1
which in reality is harmless. The library builds fine, but Docker stops the build once it receives this error. Is there any way I can instruct Docker to just ignore this?
Sure. Docker is just responding to the error codes returned by the RUN shell scripts in the Dockerfile. If your Dockerfile has something like:
RUN make
You could replace that with:
RUN make; exit 0
This will always return a 0 (success) exit code. The disadvantage here is that your image will appear to build successfully even if there are actual errors in the build process.
This might be of interest to those, whose potential errors in their images are not harmless enough to go unnoticed/logged. (Also, not enough rep. to comment, so here as an answer.)
As pointed out, the disadvantage of RUN make; exit 0 is you don't get to know, if your build failed. Hence, rather use something like:
make test 2>&1 > /where/ever/make.log || echo "There were failing tests!"
Like this, you get notified via the docker image build process log, and you can see what exactly went bad during make (or whatsoever else execution, this is not restricted to make).
You can also use the standard bash ignore error || true, which is nice if you are in the middle of a chain:
RUN <first stage> && <job that might fail> || true && <next stage>

I am running tar xzvfredhawk-yum-1.8.4-el6-i686.tar.gz and the terminal freezes.

I am new to CentOS6 as well as Redhawksdr, and I am trying to run the tar xzvfredhawk-yum-1.8.4-el6-i686.tar.gz instruction on page 24, section 2.3 and my terminal freezes. Anyone know what is wrong and how to fix it?
Try checking to see if yum is being locked by something else (though an error should be produced if this were the case):
ps aux | grep yum
If something else is locking yum, try killing it.
Also, take a look at your repositories in /etc/yum.repos.d. Are there any IP addresses in there that might cause a timeout? Try pinging any IPs that are in there: if you can't ping, remove them from /etc/yum.repos.d (do this by saving the file off somewhere else).
If neither of those work, please post the exact syntax you are using. If yum is waiting on an input, it will freeze (e.g., if the answer to David Duncan's question is "no", that would be your problem).
user2062950: I am assuming user2643765 is referring to section 2.3 of the REDHAWK user manual.
Please try this:
go to the location where the tar file is present, then run the following command:
tar xzvf redhawk-yum-1.8.4-el6-i686.tar.gz -C target_location

Resources