Hello, world! GSoC 2020 Phase 3 has ended now and it was a great period for thw Jenkins Windows Services – YAML Configuration Support project.
In this blog post, I will announce the updates during the GSoC 2020 – Phase 2 and Phase 3. If you are not already aware of this project,
I would recommend reading this blog post which was published after GSoC 2020 – Phase 1.
Windows Service Wrapper – YAML configuration support
YAML schema validation
XML Schema validation
Under WinSW – YAML configurations support, these tasks will be done.
At the moment YAML object mapping is finished and merged.
You can find all the implementations in this Pull Request.
This task is already done and merged. Find the implementation in this Pull Request.
At the moment there are 2 internal plugins in WinSW. RunAwayProcessKiller and SharedDirectoryMapper.
We allow users to provide configurations for those plugins in the same XML and YAML configuration file which is used to configure WinSW. This task is merged as well.
YAML Configuration structure
Now users can provide environment variables as a sequence of dictionaries that contains name and value for environment variables.
Users can specify timestamp values in the same manner used in XML (e.g.
YAML configuration document was published. YAML Configuration Specification
Extend the WinSW to support both XML and YAML
id: jenkins name: Jenkins description: This service runs Jenkins automation server. env: - name: JENKINS_HOME value: '%LocalAppData%Jenkins.jenkins' - name: LM_LICENSE_FILE value: host1;host2 executable: java arguments: >- -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "E:Winsw Testyml6jenkins.war" --httpPort=8081 log: mode: rotate onFailure: - action: restart delay: 10 sec - action: reboot delay: 1 hour extensions: - id: killOnStartup enabled: yes classname: WinSW.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension settings: pidfile: '%BASE%pid.txt' stopTimeOut: 5000 StoprootFirst: false - id: mapNetworDirs enabled: yes classname: WinSW.Plugins.SharedDirectoryMapper.SharedDirectoryMapper settings: mapping: - enabled: false label: N uncpath: \UNC - enabled: false label: M uncpath: \UNC2
Let me explain in brief, why we need a new CLI.
In WinSW, we will keep both XML and YAML configuration support.
But according to the current implementation, the user can’t specify the configurations file explicitly.
Also, we want to let the user skip the schema validation as well.
So We decided to move into new CLI which is more structured with commands and options.
Please read my previous blog post to learn more about commands and options in the new CLI.
User can configure the Windows Service Wrapper by both XML and YAML configuration files using the following steps.
Create the configuration file (XML or YAML).
Save it with the same name as the Windows Service Wrapper executable name.
Place the configuration file inside the directory(or in a parent directory), where the Windows Service Wrapper executable is located.
If there are both XML and YAML configuraiton files, Windows Service Wrapper will be configured by the XML configuration file.
XML Schema validation
XML configuration file will be validated with the XSD file.
I have started working on this feature and you can find the implementation in this Pull Request.
YAML Configuration validate on startup
Originally posted on Jenkins Blog