Skip to content
Snippets Groups Projects
Commit dea7ea7e authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1960-fix-install-tests' into 'master'

Resolve "fix install tests"

Closes #1960

See merge request !1650
parents 0894927d 7a131415
No related branches found
No related tags found
2 merge requests!1700Resolve "introduce new frontend to the jar file build process",!1650Resolve "fix install tests"
Pipeline #85323 passed
......@@ -464,73 +464,13 @@ build_debian_package:
- export DEBEMAIL="piotr.gawron@uni.lu"
- debian/create-debian-pkg.sh
test_upgrade_debian_package:
image: debian:stretch
stage: test
only:
- tags
# we need to run it in privileged mode due to: https://stackoverflow.com/questions/29683231/tomcat7-fail-to-start-inside-ubuntu-docker-container
tags:
- privileged
services:
- name: piotrgawron/debian-repo
alias: debian-repo
dependencies:
- build_debian_package
script:
- echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list
- echo "deb-src http://archive.debian.org/debian stretch main" >> /etc/apt/sources.list
- echo "deb http://archive.debian.org/debian stretch-backports main" >> /etc/apt/sources.list
- echo "deb http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list
- echo "deb-src http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get install -y ssh software-properties-common dirmngr wget curl apt-transport-https postgresql
- service postgresql start
- debian_file=$(ls debian/*.deb)
- version=$(echo $debian_file| cut -f2 -d"_")
- echo "PUT $debian_file /docker/incoming" | sftp -o StrictHostKeyChecking=no user@debian-repo
- ssh root@debian-repo /usr/local/sbin/reprepro-import
- apt-add-repository "deb http://repo-r3lab.uni.lu/debian/ stable main"
- apt-key adv --no-tty --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xcb185f4e31872412
- echo debconf minerva/internal/skip-preseed boolean true | debconf-set-selections
- echo debconf minerva/dbconfig-install select true | debconf-set-selections
- echo debconf minerva/pgsql/app-pass select secret_password | debconf-set-selections
- echo debconf minerva/remote/host select localhost | debconf-set-selections
- echo debconf minerva/db/dbname select minerva_db | debconf-set-selections
- echo debconf minerva/db/app-user select minerva_user@localhost | debconf-set-selections
- apt-get update
#hacky way of installing minerva on docker - by default rc-invoke is preventing services changes on docker
- mv /usr/sbin/policy-rc.d /usr/sbin/policy-rc.d.backup
- mv gitlab-ci-policy-rc.d /usr/sbin/policy-rc.d
- chmod 0755 /usr/sbin/policy-rc.d
- DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated minerva
#local repository with new version
- apt-add-repository "deb http://debian-repo/ unstable main"
- apt-get update --allow-unauthenticated
- apt-get dist-upgrade -y --allow-unauthenticated
- mv /usr/sbin/policy-rc.d.backup /usr/sbin/policy-rc.d
- service tomcat8 start
#we need to wait a bit for tomcat start
- sleep 15
- wget http://localhost:8080/minerva/
#test if we can login and get configuration using new version
- test 200 = $(curl -X POST -d "login=admin&password=admin" --write-out %{http_code} --silent --output /dev/null -c cookie.txt http://localhost:8080/minerva/api/doLogin)
- test 200 = $(curl --write-out %{http_code} --silent --output configuration.json --cookie cookie.txt http://localhost:8080/minerva/api/configuration/)
- test 1 = $(cat configuration.json| grep $version | wc -l)
test_install_debian_package:
image: debian:stretch
stage: test
only:
- tags
# we need to run it in privileged mode due to: https://stackoverflow.com/questions/29683231/tomcat7-fail-to-start-inside-ubuntu-docker-container
tags:
- privileged
services:
- name: piotrgawron/debian-repo
alias: debian-repo
dependencies:
- build_debian_package
script:
......@@ -543,23 +483,15 @@ test_install_debian_package:
- DEBIAN_FRONTEND=noninteractive apt-get install -y ssh software-properties-common dirmngr wget curl postgresql
- service postgresql start
- debian_file=$(ls debian/*.deb)
- echo "PUT $debian_file /docker/incoming" | sftp -o StrictHostKeyChecking=no user@debian-repo
- ssh root@debian-repo /usr/local/sbin/reprepro-import
- apt-add-repository "deb http://debian-repo/ unstable main"
- echo debconf minerva/internal/skip-preseed boolean true | debconf-set-selections
- echo debconf minerva/dbconfig-install select true | debconf-set-selections
- echo debconf minerva/pgsql/app-pass select secret_password | debconf-set-selections
- echo debconf minerva/remote/host select localhost | debconf-set-selections
- echo debconf minerva/db/dbname select minerva_db | debconf-set-selections
- echo debconf minerva/db/app-user select minerva_user@localhost | debconf-set-selections
- apt-get update --allow-insecure-repositories
#hacky way of installing minerva on docker - by default rc-invoke is preventing services changes on docker
- mv /usr/sbin/policy-rc.d /usr/sbin/policy-rc.d.backup
- mv gitlab-ci-policy-rc.d /usr/sbin/policy-rc.d
- chmod 0755 /usr/sbin/policy-rc.d
- DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated minerva
- mv /usr/sbin/policy-rc.d.backup /usr/sbin/policy-rc.d
- service tomcat8 start
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get install -y ./$debian_file
- java -jar /usr/share/minerva/minerva.jar &
#we need to wait a bit for tomcat start
- sleep 15
- wget http://localhost:8080/minerva/
......@@ -587,9 +519,9 @@ test_deploy_with_db_without_superadmin_rights:
- echo "database.password=test" >> /etc/minerva/db.properties
- echo "CREATE DATABASE test;CREATE USER test WITH ENCRYPTED PASSWORD 'test';GRANT ALL PRIVILEGES ON DATABASE test TO test;" >tmp.sql
- PGPASSWORD=$POSTGRES_PASSWORD psql -h postgres -U $POSTGRES_USER $POSTGRES_DB < tmp.sql
- FIX ME!!!!!!!!!
- mv minerva.war /usr/local/tomcat/webapps/minerva.war
- /usr/local/tomcat/bin/startup.sh
- mkdir -p /usr/share/minerva/data/
- mv minerva.jar /usr/share/minerva/
- java -jar /usr/share/minerva/minerva.jar
- sleep 15
- curl http://localhost:8080/minerva/
#test if we can login and list projects
......
......@@ -76,18 +76,6 @@
<version>${annotation-api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb.version}</version>
</dependency>
<!-- XML parser -->
<dependency>
......
......@@ -48,19 +48,6 @@
<version>${xercesImp.version}</version>
</dependency>
<!-- Java xml serialization -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>com.github.sbgn</groupId>
<artifactId>libsbgn</artifactId>
......@@ -125,18 +112,6 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb.version}</version>
</dependency>
<!-- Log4J2 -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
......@@ -148,7 +123,8 @@
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<!-- Spring uses commons-logging, so: https://stackoverflow.com/a/41475146/1127920 -->
<!-- Spring uses commons-logging, so:
https://stackoverflow.com/a/41475146/1127920 -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
......
......@@ -22,9 +22,22 @@
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.version}</version>
<version>${jaxb-api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb-impl.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb-core.version}</version>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
......
......@@ -22,7 +22,9 @@
<xalan.version>2.7.3</xalan.version>
<annotation-api.version>1.3.2</annotation-api.version>
<jaxb.version>2.3.0</jaxb.version>
<jaxb-api.version>2.3.1</jaxb-api.version>
<jaxb-core.version>2.3.0.1</jaxb-core.version>
<jaxb-impl.version>2.3.9</jaxb-impl.version>
<apache.httpcomponents.version>4.5.14</apache.httpcomponents.version>
<apache.httpcomponents-core.version>4.4.16</apache.httpcomponents-core.version>
......
......@@ -161,6 +161,10 @@
<version>${greenmail.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.sun.activation</groupId>
<artifactId>jakarta.activation</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
......
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