Skip to content
Snippets Groups Projects
Commit a749e826 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Merge branch 'main' into 'release'

Renovate-updates deployed to prod

See merge request !26
parents c719005a 18d43a58
No related branches found
No related tags found
2 merge requests!35build: New dummy version for testing the pipeline,!26Renovate-updates deployed to prod
Pipeline #3204 failed
image: openjdk:11-jdk image: eclipse-temurin:17.0.9_9-jdk-jammy
stages: stages:
- build - build
- test - test
...@@ -15,7 +15,7 @@ variables: ...@@ -15,7 +15,7 @@ variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dmaven.artifact.threads=10" MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dmaven.artifact.threads=10"
MAIN_BRANCH: "main" MAIN_BRANCH: "main"
RELEASE_BRANCH: "release" RELEASE_BRANCH: "release"
CLI_PATH: "/disks/data01/wildfly/wildfly-25.0.1.Final/bin" CLI_PATH: "/disks/data01/wildfly/wildfly-26.1.3.Final/bin"
TMP_PATH: "/home/deployer/gitlab_tmp" TMP_PATH: "/home/deployer/gitlab_tmp"
DEPLOYMENT_PATH: "/home/wildfly/deployments" DEPLOYMENT_PATH: "/home/wildfly/deployments"
ARCHIVE_PATH: "/home/wildfly/archive" ARCHIVE_PATH: "/home/wildfly/archive"
...@@ -25,6 +25,7 @@ cache: ...@@ -25,6 +25,7 @@ cache:
- .m2/repository/ - .m2/repository/
before_script: before_script:
- apt-get update && apt-get install -y git
- git config --global user.name "${GITLAB_USER_NAME}" - git config --global user.name "${GITLAB_USER_NAME}"
- git config --global user.email "${GITLAB_USER_EMAIL}" - git config --global user.email "${GITLAB_USER_EMAIL}"
- echo "Get common settings" - echo "Get common settings"
...@@ -33,8 +34,8 @@ before_script: ...@@ -33,8 +34,8 @@ before_script:
- cp $SETTINGS_XML ../$SETTINGS_XML - cp $SETTINGS_XML ../$SETTINGS_XML
- cd .. - cd ..
- rm -rf $COMMON_CONFIG_LOCAL - rm -rf $COMMON_CONFIG_LOCAL
- apt-get update -y && apt-get install -y python && apt-get install -y rsync openssh-client - apt-get update -y && apt-get install -y python3 && apt-get install -y rsync openssh-client
- "python build_pom_with_models.py" - "python3 build_pom_with_models.py"
build: build:
stage: build stage: build
......
...@@ -34,11 +34,11 @@ $ mvnw.cmd clean install ...@@ -34,11 +34,11 @@ $ mvnw.cmd clean install
**PLEASE NOTE that this builds the package without any models. See "Adding models" below for more information** **PLEASE NOTE that this builds the package without any models. See "Adding models" below for more information**
Download and install [WildFly](https://www.wildfly.org/) >= 25.0.1 Download and install [WildFly](https://www.wildfly.org/) == 26.1.3
Deploy the build from this project in Wildfly. Deploy the build from this project in Wildfly.
Wildfly should run on Java >= 11 Wildfly should run on Java >= 17
### Adding models ### Adding models
...@@ -59,6 +59,17 @@ To build with your preferred set of models, create a new file called e.g. `my_mo ...@@ -59,6 +59,17 @@ To build with your preferred set of models, create a new file called e.g. `my_mo
$ build_with_models.py my_models.xml $ build_with_models.py my_models.xml
``` ```
To create Maven `<dependencies/>` XML with the latest versions of all models on NIBIO's GitLab, use the `build_models_xml.py` script, like this:
```bash
# Write latest production version dependency elements XML to my_models.xml
$ ./build_models_xml.py > my_models.xml
# Write latest SNAPSHOT version dependency elements XML to my_models.xml
$ ./build_models_xml.py -s > my_models.xml
```
## Implement a model ## Implement a model
See [implement_model.md](./docs/implement_model.md) See [implement_model.md](./docs/implement_model.md)
......
#!/usr/bin/python3
'''
Copyright (C) 2023 NIBIO
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
@author Tor-Einar Skog <tor-einar.skog@nibio.no>
'''
# Fetches the package registry list from our GitLab,
# filters only models packages,
# figures out which is the newest version of each package,
# creates Maven dependencies XML stubs
# dumps to stdout
# Example usage:
# $ ./build_models_xml.py -s > models.xml
import sys
import requests
import xml.etree.ElementTree as ET
if len(sys.argv) == 2 and sys.argv[1] == "-h":
print("""usage: build_with_models [-s]""")
exit(0)
# Use the -s option to fetch only SNAPSHOT versions
snapshot = True if len(sys.argv) == 2 and sys.argv[1] == "-s" else False
url = "https://gitlab.nibio.no/api/v4/projects/401/packages?per_page=100&order_by=version&sort=desc"
all_packages = []
response = requests.get(url)
if response.status_code == 200:
# Get the first page contents
data = response.json()
all_packages.extend(data)
# Iterate the next pages
while 'next' in response.links:
next_url = response.links["next"]["url"]
response = requests.get(next_url)
if response.status_code == 200:
data = response.json()
all_packages.extend(data)
models = {}
model_prefixes = ["no/nibio/vips/model","fi/luke/vips/model"]
# Filter models and store only the most recent version (highest alphanumeric number)
for package in all_packages:
for model_prefix in model_prefixes:
if package["name"].find(model_prefix) >=0 and ((snapshot and package["version"].find("SNAPSHOT")>=0) or (not snapshot and package["version"].find("SNAPSHOT")<0)):
model_name = package["name"][len(model_prefix) + 1:]
if models.get(model_name, None) == None:
models[model_name] = {}
models[model_name]["groupId"] = model_prefix.replace("/",".")
models[model_name]["version"] = package["version"]
else:
models[model_name]["version"] = package["version"] if package["version"] > models[model_name]["version"] else models[model_name]["version"]
# Build partial Maven XML
dependencies = ET.Element("dependencies")
for model_name, value in models.items():
dependency = ET.SubElement(dependencies, "dependency")
ET.SubElement(dependency,"groupId").text = value["groupId"]
ET.SubElement(dependency, "artifactId").text = model_name
ET.SubElement(dependency, "version").text = value["version"]
# Dumps the indented XML to stdout
tree = ET.ElementTree(dependencies)
ET.indent(tree, space="\t",level=0)
ET.dump(tree)
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>AlternariaModel</artifactId> <artifactId>RoughageNutritionModel</artifactId>
<version>1.1.4</version> <version>1.1.7</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>AppleScabModel</artifactId> <artifactId>AlternariaModel</artifactId>
<version>1.1.3</version> <version>1.1.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>BarleyNetBlotchModel</artifactId> <artifactId>BarleyNetBlotchModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>BremiaLactucaeModel</artifactId> <artifactId>AppleScabModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>DeliaRadicumModel</artifactId> <artifactId>DeliaRadicumModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>DeliaRadicumFloralisObservationModel</artifactId> <artifactId>DeliaRadicumFloralisObservationModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>DOWNCASTModel</artifactId> <artifactId>BremiaLactucaeModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>fi.luke.vips.model</groupId> <groupId>fi.luke.vips.model</groupId>
<artifactId>FinnCerealModels</artifactId> <artifactId>FinnCerealModels</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>GrassDryingModel</artifactId> <artifactId>DOWNCASTModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>LygusRugulipennisModel</artifactId> <artifactId>LygusRugulipennisModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>MamestraBrassicaeModel</artifactId> <artifactId>GrassDryingModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>Model_LEAFBLOTCH</artifactId> <artifactId>Model_LEAFBLOTCH</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>Model_MAIZEPHENO</artifactId> <artifactId>NaerstadModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>NaerstadModel</artifactId> <artifactId>MamestraBrassicaeModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>NegativePrognosisModel</artifactId> <artifactId>Model_MAIZEPHENO</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>OatFloweringModel</artifactId> <artifactId>OatFloweringModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>PsilaRosaeObservationModel</artifactId> <artifactId>NegativePrognosisModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>PsilaRosaeTempModel</artifactId> <artifactId>PsilaRosaeObservationModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>RoughageNutritionModel</artifactId> <artifactId>PsilaRosaeTempModel</artifactId>
<version>1.1.5</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>SeptoriaApiicolaModel</artifactId> <artifactId>SeptoriaHumidityModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>SeptoriaHumidityModel</artifactId> <artifactId>SeptoriaReferenceHumidityModel</artifactId>
<version>1.1.3</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.nibio.vips.model</groupId> <groupId>no.nibio.vips.model</groupId>
<artifactId>SeptoriaReferenceHumidityModel</artifactId> <artifactId>SeptoriaApiicolaModel</artifactId>
<version>1.1.3</version> <version>1.1.4</version>
</dependency> </dependency>
</dependencies> </dependencies>
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<groupId>no.nibio</groupId> <groupId>no.nibio</groupId>
<artifactId>VIPSCore</artifactId> <artifactId>VIPSCore</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>2.0.4</version> <version>2.0.5-SNAPSHOT</version>
<name>VIPSCore</name> <name>VIPSCore</name>
<url>http://maven.apache.org</url> <url>http://maven.apache.org</url>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<dependency> <dependency>
<groupId>io.github.classgraph</groupId> <groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId> <artifactId>classgraph</artifactId>
<version>4.8.162</version> <version>4.8.165</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.thetransactioncompany</groupId> <groupId>com.thetransactioncompany</groupId>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId> <artifactId>jackson-annotations</artifactId>
<version>2.13.1</version> <version>2.16.1</version>
<type>jar</type> <type>jar</type>
</dependency> </dependency>
<dependency> <dependency>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.datatype</groupId> <groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId> <artifactId>jackson-datatype-jsr310</artifactId>
<version>2.13.1</version> <version>2.16.1</version>
<type>jar</type> <type>jar</type>
</dependency> </dependency>
<dependency> <dependency>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>3.8.1</version> <version>4.13.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<dependency> <dependency>
<groupId>commons-logging</groupId> <groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId> <artifactId>commons-logging</artifactId>
<version>1.2</version> <version>1.3.0</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<dependency> <dependency>
<groupId>commons-validator</groupId> <groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId> <artifactId>commons-validator</artifactId>
<version>1.7</version> <version>1.8.0</version>
<type>jar</type> <type>jar</type>
</dependency> </dependency>
<dependency> <dependency>
...@@ -123,13 +123,13 @@ ...@@ -123,13 +123,13 @@
<dependency> <dependency>
<groupId>commons-net</groupId> <groupId>commons-net</groupId>
<artifactId>commons-net</artifactId> <artifactId>commons-net</artifactId>
<version>3.8.0</version> <version>3.10.0</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-codec</groupId> <groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId> <artifactId>commons-codec</artifactId>
<version>1.15</version> <version>1.16.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.googlecode.json-simple</groupId> <groupId>com.googlecode.json-simple</groupId>
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version> <version>3.12.1</version>
<configuration> <configuration>
<source>11</source> <source>11</source>
<target>11</target> <target>11</target>
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.1</version> <version>3.6.3</version>
<configuration> <configuration>
<tags> <tags>
<tag> <tag>
...@@ -167,8 +167,14 @@ ...@@ -167,8 +167,14 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-wrapper-plugin</artifactId> <artifactId>maven-wrapper-plugin</artifactId>
<version>3.1.1</version> <version>3.2.0</version>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.4.0</version>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"baseBranches": ["renovate-updates"]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment