Skip to content
Snippets Groups Projects
Commit 950920fe authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
*.swp
.DS_Store
image: centos:7
.runner_tags: &runner_tags
tags:
- docker
stages:
- validate
- deploy
validate:
<<: *runner_tags
stage: validate
script:
- ./validate_xml
deploy:
<<: *runner_tags
stage: deploy
image: registry.esss.lu.se/ics-docker/tower-cli:3.2
script:
- >
tower-cli job launch
-h torn.ics.esss.lu.se
-u ${ANSIBLE_AWX_USERNAME}
-p ${ANSIBLE_AWX_PASSWORD}
-J deploy-beast
--tags beast-config
-e "beast_config_repo_version=$CI_COMMIT_REF_NAME" --monitor
only:
- master
<?xml version="1.0" encoding="utf-8" ?>
<!--
XML schema as used by the AlarmConfigTool
Command-line check of XML file against this schema:
xmllint -schema AlarmConfigurationSchema.xsd alarm_config_IHC_2014-09-04.xml
.. but using two '-' for the -schema arg, yet cannot have double- in this file
because that's confused with end of comment
Contributed by Laurier Baribeau,
<Laurier.Baribeau@lightsource.ca>
Updated by Denis Stepanov,
<Denis.Stepanov@iter.org>,
kasemirk@ornl.gov
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="config">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="guidance" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="display" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="command" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="automated_action" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="pv" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="component" minOccurs="0" maxOccurs="unbounded"/>
</xs:choice>
<xs:attribute name="name" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="guidance">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="details" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="display">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="details" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="command">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="details" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="automated_action">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="details" type="xs:string"/>
<xs:element name="delay" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="component">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="guidance" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="display" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="command" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="automated_action" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="pv" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="component" minOccurs="0" maxOccurs="unbounded"/>
</xs:choice>
<xs:attribute name="name" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="pv">
<xs:complexType>
<xs:sequence>
<xs:element name="description" type="xs:string" minOccurs="0"/>
<xs:element name="enabled" type="xs:boolean" minOccurs="0"/>
<xs:element name="latching" type="xs:boolean" minOccurs="0"/>
<xs:element name="annunciating" type="xs:boolean" minOccurs="0"/>
<xs:element name="delay" type="xs:decimal" minOccurs="0"/>
<xs:element name="count" type="xs:unsignedInt" minOccurs="0"/>
<xs:element name="filter" type="xs:string" minOccurs="0"/>
<xs:element ref="guidance" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="display" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="command" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="automated_action" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
beast-config
============
This repository is used to store all BEAST servers configuration.
Each xml configuration shall be saved under a directory named after the server
fully-qualified domain name.
The name of the xml file shall be the name of the BEAST root component.
If there is no directory named after the server, the configuration file from the *default*
directory is used.
The script *validate_xml* is used to validate all xml files against the Alarm Configuration Schema.
It is run automatically by the gitlab-ci pipeline.
You can run it locally on your machine (OSX and Linux) if you have xmllint installed.
When pushing to master, the new configuration is automatically deployed to the BEAST servers on the TN.
See http://cs-studio.sourceforge.net/docbook/ch14.html#idp971040 for more information about BEAST configuration.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config name="ALARM">
</config>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config name="LCR">
</config>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config name="MAIN">
</config>
#!/bin/bash
# Exit on first xmllint error
set -e
for xml in $(find . -name "*.xml")
do
xmllint --schema AlarmConfigurationSchema.xsd $xml
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment