Since the last article, "Jenkins + Git Build Continuous Integration environment", this configuration of the job has new requirements, but also stepped into a new pit. It is hereby recorded that the police have their own body.
Task Requirements:
These three steps add a build step to the build section of the Job Configuration page.
First add the "Package Build" command:
CD Buildscriptsbuild.bat
Dojo's build tools are automatically used in BUILD.bat.
To add a compression command:
CD Buildoutput//Copy the built-in folders and files to a directorymkdir webappbuilderforarcgismove Client Webappbuilderforarcgismove server Webappbuilderforarcgismove Startup.bat Webappbuilderforarcgis//copy Nodejs.exe to the directoryxcopy E:\youPath\nodejs webappbuilderforarcgis\server/y/E//call 7zip to generate a compressed package"C:\Program Files\7-zip\7z.exe" a wab.zip webappbuilderforarcgis\*//Copy the ZIP package to the target directorymkdir E:\yourPath\WebAppBuilderForArcGIS\%BUILD_NUMBER%copy wab.zip E:\xt-release\webappbuilderforarcgis\%build_number%Move Wab.zip E:\xt-release\webappbuilderforarcgis\
7zip and Nodejs are required during this step
Send zip:
Curl http://server:8080/job/project/build?token=build_wabsanity
In this step we use the Curl command to tell another remote server that our zip has been compressed. After the remote server accepts the command, it executes its own automation script.
In this process, Windows users need to install curl separately and configure Curl's directory in the global variable path to make Curl a global command.
The pits encountered in this configuration are: Although all script commands do not have asynchronous operations, if all of the commands are placed in a build step, the following command will not continue after the BUILD.bat is executed. The final conclusion is that the entire process is split and each part is placed in a single build step .
Jenkins+git Integration test (build, zip, curl)