Category: Uncategorized
-
Jenkins: Build / “Execute shell” / exit codes …
From the help section of “Execute Shell”:
By default, the shell will be invoked with the “-ex” option. So all of the commands are printed before being executed, and the build is considered a failure if any of the commands exits with a non-zero exit code. Again, add the #!/bin/... line to change this behavior.
Funny, “set -e” (“exit immediately if … exits with a non-zero status”) is being applied, just as it is with good old “make”.
There are pros and cons for that. But in the end I can seriously not live with it, because I can’t have a single file or directory test, that (expectedly!) exits non-zero.
Another funny aspect (the bash man page says):
Subshells spawned to execute command substitution inherit the value of the -e option from the parent shell. When not in posix mode, bash clears the -e option in such subshells.
-
“called” a batch script within a batch script, forgot to use “call”, and wondered …
<!–www.bibleserver.com | 522: Connection timed out
body{margin:0;padding:0}
<!–[if lte IE 9]>/cdn-cgi/scripts/jquery.min.js<![endif]–>
/cdn-cgi/scripts/zepto.min.js<!–
/cdn-cgi/scripts/cf.common.jsError
522
Ray ID: 3a8c541b7acb15b9 • 2017-10-05 00:40:45 UTC
Connection timed out
You
Browser
Working
Frankfurt
Cloudflare
Working
www.bibleserver.com
Host
Error
What happened?
The initial connection between Cloudflare’s network and the origin web server timed out. As a result, the web page can not be displayed.
What can I do?
If you’re a visitor of this website:
Please try again in a few minutes.
If you’re the owner of this website:
Contact your hosting provider letting them know your web server is not completing requests. An Error 522 means that the request was able to connect to your web server, but that the request didn’t finish. The most likely cause is that something on your server is hogging resources. Additional troubleshooting information here.
-
cURL: how do I save a file using the response header filename with cURL
This question relates to the command line version of cURL. I’m trying to download a file from a cgi script.http://someserver/perl/dl.pl?ID=2Using a browser the filename comes up as
- curl –remote-header-name …
- wget –content-disposition …
-
Jenkins: setting up a the environment for a Windows/Microsoft compilation job
- https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin
- https://www.gnu.org/software/make/manual/html_node/Errors.html — make’s exit code checking
There are a couple of different ways of injecting environment variables:
Within the “Build Environment” / “Inject environment variables to the build process” section of a Jenkins job (provided by the EnvInject plugin) you may me tempted to make use of a file named by “Properties File Path” that adds settings to your environment variables, e.g. “c:jenkins-slaveslave-env.txt“.
As opposed to properties injection through such file using a section “Properties Content” makes your environment set up more obvious and transparent. If you have a lot of jobs with an identical subset of properties, it certainly makes sense to have them within such a shared file. But there are also situations you can neither handle through “Properties File Path” nor through “Properties Content“:
For using Microsoft Visual Studio’s C compiler on the command line you ought to call their vcvarsall.bat. Do not try to set up your compilation environment (INCLUDE, Path, LIB, LIBPATH, SDK, …) yourself! You can neither use “Script File Path” nor “Script Content” for that, because “adding or overriding environment variables in the script doesn’t have any impacts in the build job”.
This is what I suggest: Prepare the call of vcvarsall.bat within the section “Build Environment” / “Properties Content” instead.
PF=C:Program Files PFx86=C:Program Files (x86) VSINSTALLDIR=%PFx86%Microsoft Visual Studio 10.0 VCINSTALLDIR=%VSINSTALLDIR%VC JAVA_HOME=$PFJavajdk1.8.0_60 Path=$Path;%JAVA_HOME%bin
Within the section “Build” / “Execute Windows batch command” call vcvarsall.bat:
call "%VCINSTALLDIR%vcvarsall.bat"
Variables set up through vcvarsall.bat that you may want to make use of:
- WindowsSdkDir=…Microsoft SDKsWindows…
- …
If you want to call ant as a separate build step (“Add build step“), this is not going to work, as the environment set up through vcvarsall.bat is not available within that separate build step. That’s unfortunate, but that’s the way it is. You rather want to call ant explicitly within the same Windows batch:
call "%VCINSTALLDIR%vcvarsall.bat" cd src || exit 1 "%PF%apache-ant-1.9.6binant.bat" -file build.xml && exit %%ERRORLEVEL%%
Good old make checked each action line’s exit code, and if an action had a non-zero exit code, make stopped and told you why it stopped. You could circumvent that globally through the command line option “-i“, you could circumvent that locally through an action line prefix: “–“.
Windows batch jobs (within a Jenkins job) do not run within a framework like that. You have to check exit codes yourself, add “|| exit 1” wherever appropriate. If you don’t, certain problems do not get recognised.
-
Windows utilities that you sometimes want to start through Win-R
- cmd = …
- iexplore = Internet Explorer
- notepad
- taskmgr = the Task Manager
-
“CMake” is a software “build” utility
CMake is cross-platform free and open-source software for managing the build process of software using a compiler-independent method. It is designed to support directory hierarchies and applications that depend on multiple libraries. It is used in conjunction with native build environments such as make, Apple’s Xcode, and Microsoft Visual Studio. It has minimal dependencies, requiring only a C++ compiler on its own build system.
- use CMake with option –debug-trycompile so that CMake does not delete the try_compile build tree — in order to research problems with CMake error messages runs you may have to look into these temp. files