Commit 3af3d660 authored by Valentin Suhnjov's avatar Valentin Suhnjov

Merge branch 'releases/release-0.0.5' into master

parents a5fabb7b f3902ba6
/.idea/
/target/
image: riha-test-env
variables:
DEPLOYMENT_DIR: "/opt/tomcat/webapps"
ARTIFACT_NAME: "$CI_PROJECT_NAME.war"
stages:
- test
- build
- deploy
# Tests are failing. Commented for now
# test:
# stage: test
# script:
# - mvn clean test
# tags:
# - riha
build:
stage: build
script:
- mvn -DskipTests=true clean package
artifacts:
paths:
- target/*.war
tags:
- riha
deploy_development:
stage: deploy
script:
- echo "$SSH_PRIVATE_KEY" > id_rsa
- chmod 700 id_rsa
- mkdir $HOME/.ssh
- echo "$SSH_HOST_KEY" > $HOME/.ssh/known_hosts
- scp -i id_rsa target/*.war deployer@$SSH_HOST:$DEPLOYMENT_DIR/$ARTIFACT_NAME
environment:
name: development
url: http://$SSH_HOST:$PORT/
only:
- develop
tags:
- riha
\ No newline at end of file
......@@ -15,6 +15,8 @@ Kompileeritud WAR paketi leiab `target/` kataloogist.
## Paigalduse häälestamine
### Kompileerimise käigus
Tarkvarasse vaikimisi kompileeritavaid parameetreid saab määrata maven'i parameetrite abil kompileerimise käigus.
Näiteks parameetrit `skipTests` saab määrata käsurealt kujul:
......@@ -23,12 +25,12 @@ Näiteks parameetrit `skipTests` saab määrata käsurealt kujul:
mvn package -DskipTests=true
```
Parameetreid saab esitada käsureal mitu, igaüks eraldi kujul:
Parameetreid saab esitada käsureal mitu, igaüks eraldi kujul (va tähtega märgistatud):
```
-D{parameeter}={väärtus}
```
Võimalik on kasutada järgmisi parameetreid:
Võimalik on kasutada järgmisi parameetreid (vaikeväärtused defineeritud `src/main/resources/riharest.project.properties` failis):
Parameeter | Vaikeväärtus | Kirjeldus
-------------------------|--------------|----------
......@@ -38,10 +40,10 @@ riharest.authService | http://192.168.50.140:8080/riha/sessionManagementServ
riharest.isTest | true | Kui väärtus on `true`, siis API aktsepteerib tokenina väärtust `testToken`, ilma seda valideerimata.
riharest.authTimeout | 3600000 | Autentimise tokeni kehtivus millisekundites. Peale selle aja möödumist toimub REST teenuse poolt uuesti tokeni kontroll autentimisteenuse abil.
riharest.pathRootWindows | C:\\Users\\Praktikant\\test_folder\\ | Failitee, kuhu alla paigaldatakse RIHA dokumentidega seotud failid. Kasutatakse juhul, kui lahendus on paigaldatud Windows'i operatsioonisüsteemiga arvutisse.
riharest.base.url | http://192.168.50.106:8080/rest | URL, mille kaudu on RIHA REST API kättesaadav. Antud parameetri baasilt tekitatakse taastatavates vastustes URLid allalaaditavatele failidele.
riharest.jdbc.url | jdbc:postgresql://192.168.50.106:5432/riha | RIHA andmebaasi JDBC andmebaasiühenduse URL
riharest.jdbc.user | riha | RIHA andmebaasi kasutajatunnus, kelle nimel peab REST API tegema andmebaasiühenduse
riharest.jdbc.password | riha | RIHA andmebaasi parool, kelle nimel peab REST API tegema andmebaasiühenduse
riharest.base.url ***** | http://192.168.50.106:8080/rest | URL, mille kaudu on RIHA REST API kättesaadav. Antud parameetri baasilt tekitatakse taastatavates vastustes URLid allalaaditavatele failidele.
riharest.jdbc.url ***** | jdbc:postgresql://192.168.50.106:5432/riha | RIHA andmebaasi JDBC andmebaasiühenduse URL
riharest.jdbc.user ***** | riha | RIHA andmebaasi kasutajatunnus, kelle nimel peab REST API tegema andmebaasiühenduse
riharest.jdbc.password | riha | RIHA andmebaasi parool, kelle nimel peab REST API tegema andmebaasiühenduse
jmeter.ignoreFailuers | true | Kui tõene, siis jMeter testskriptid ei peata tööd esimese ettetulnud vea peale, vaid töötavad lõpuni ning registreerivad kõik täitmise käigus juhtunud vead. Väära väärtuse korral registreeritakse ainult esimene juhtunud viga ning lõpetatakse töö.
jmeter.test | rest-get-object | jMeter testi nimi, mis testifaasis tuleb käivitada. Võimalikud variandid vt kataloogis `src/test/jmeter` olevate failide nimed.
......@@ -54,3 +56,6 @@ loomiseks seda.
* Andmebaasiühenduse parameetreid kasutatakse ka ühiktestide käivitamiseks. Juhul, kui andmebaas pole tarkvara kompileerimise
ajal kättesaadav, tuleb ühikteste mitte käivitada (st kasutada parameetrit `skipTests=true`).
### Konfiguratsiooni faili abil
Kõrgema prioriteediga parameetrid võib määrata `/opt/tomcat/conf/riharest.project.properties` faili abil. Selle faili olemasolu ei ole kohustuslik ja võib sisaldada ainult väike osa konfiguratsioonist. Parameetrite prioriteet on kõrgem kui vaikeväärtustel.
......@@ -5,7 +5,7 @@
<groupId>ee.eesti.riha</groupId>
<artifactId>rest</artifactId>
<version>0.0.4-SNAPSHOT</version>
<version>0.0.5-SNAPSHOT</version>
<packaging>war</packaging>
......@@ -34,9 +34,6 @@
<!-- See Profile <id>${project.groupId}-${project.artifactId}}</id> below! -->
<riharest.test.jdbc.url>${riharest.jdbc.url}</riharest.test.jdbc.url>
<riharest.test.jdbc.user>${riharest.jdbc.user}</riharest.test.jdbc.user>
<riharest.test.jdbc.password>${riharest.jdbc.password}</riharest.test.jdbc.password>
<riharest.test.pathRoot>target/test-files/</riharest.test.pathRoot>
<riharest.test.pathRootWindows>${riharest.pathRootWindows}</riharest.test.pathRootWindows>
<riharest.test.authService>${riharest.authService}</riharest.test.authService>
......@@ -81,9 +78,6 @@
<!-- FIXME No reason to hold these values here! -->
<riharest.jdbc.url>jdbc:postgresql://localhost:5432/riha</riharest.jdbc.url>
<riharest.jdbc.user>riha</riharest.jdbc.user>
<riharest.jdbc.password>riha</riharest.jdbc.password>
<!-- app base url -->
<riharest.base.url>http://localhost:8080/rest</riharest.base.url>
......
......@@ -14,7 +14,7 @@ import org.springframework.core.io.support.PropertiesLoaderUtils;
public final class PropsReader {
// this where external riharest.project.properties should be
// so that properties could be changed without recompiling
// if you change it you must change it in src/main/resources/hibernate-applicationContext.xml as well
// if you change it you must change it in src/main/resources/persistence-context.xml as well
private static final String EXTERNAL_CONF_LOCATION = "/opt/tomcat/conf/";
private static final String FILE_NAME = "riharest.project.properties";
......
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd">
<context:component-scan base-package="ee.eesti.riha.rest" />
<mvc:resources mapping="/resources/**" location="/resources/" />
<mvc:annotation-driven />
<tx:annotation-driven transaction-manager="txManager"/>
<!-- location must be changed in ee.eesti.riha.rest.util.PropsReader as well -->
<context:property-placeholder location="file:///opt/tomcat/conf/riharest.project.properties"
ignore-unresolvable="true" ignore-resource-not-found="true" order="1"/>
<context:property-placeholder location="classpath*: **/riharest.project.properties"
ignore-resource-not-found="false" order="2"/>
<import resource="persistence-context.xml"/>
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="WEB-INF/classes/messages" />
</bean>
<!-- <bean id="InfosysteemDaoImpl" class="ee.eesti.riha.rest.dao.InfosysteemDAOImpl"
/> -->
</beans>
\ No newline at end of file
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-4.0.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:cache="http://www.springframework.org/schema/cache" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-4.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:property-placeholder location="file:///opt/tomcat/conf/riharest.project.properties"
ignore-unresolvable="true" ignore-resource-not-found="true" order="100"/>
<import resource="hibernate-applicationContext.xml" />
<context:property-placeholder location="classpath:riharest.project.properties" order="200"/>
<!-- this is needed to use environment variables in xml -->
<context:property-placeholder />
<import resource="persistence-context.xml"/>
<context:component-scan base-package="ee.eesti.riha.rest" />
<mvc:resources mapping="/resources/**" location="/resources/" />
<mvc:annotation-driven />
<cache:annotation-driven />
......@@ -27,4 +33,9 @@
</property>
</bean>
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="WEB-INF/classes/messages" />
</bean>
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.2.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd">
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<context:property-placeholder location="classpath*: **/riharest.jdbc.properties"/>
<!-- <jee:jndi-lookup id="dataSource" jndi-name="jdbc/riharest/datasource"
/> -->
<tx:annotation-driven transaction-manager="txManager"/>
<jee:jndi-lookup id="dataSource" jndi-name="jdbc/riharest/datasource"
default-ref="propDataSource">
</jee:jndi-lookup>
<bean id="propDataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.postgresql.Driver" />
......
riharest.jdbc.url=${riharest.jdbc.url}
riharest.jdbc.user=${riharest.jdbc.user}
riharest.jdbc.password=${riharest.jdbc.password}
\ No newline at end of file
riharest.jdbc.url=jdbc:postgresql://192.168.1.37:5432/riha?currentSchema=riha
riharest.jdbc.user=postgres
riharest.jdbc.password=admin
#Document files are located in PATH_ROOT/00/.. directory
PATH_ROOT=${riharest.pathRoot}
#The url of the authentication service
......
riharest.jdbc.url=${riharest.test.jdbc.url}
riharest.jdbc.user=${riharest.test.jdbc.user}
riharest.jdbc.password=${riharest.test.jdbc.password}
riharest.jdbc.url=jdbc:postgresql://localhost:5432/riha
riharest.jdbc.user=riha
riharest.jdbc.password=riha
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment