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

ci test that upgrades minerva

parent 984a7ad0
No related branches found
No related tags found
2 merge requests!630WIP: Resolve "The privileges of a new user are not saved in some cases",!393Continous integration tests for upgrading existing debian package from r3lab repository
Pipeline #6452 failed
......@@ -193,6 +193,53 @@ build_debian_package:
- export DEBEMAIL="piotr.gawron@uni.lu"
- debian/create-debian-pkg.sh
test_upgrade_debian_package:
image: debian
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:
- apt-get update
- apt-get install -y ssh software-properties-common dirmngr wget curl apt-transport-https
- 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://ppa.launchpad.net/webupd8team/java/ubuntu trusty main"
- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
- apt-add-repository "deb http://repo-r3lab.uni.lu/debian/ stable main"
- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xcb185f4e31872412
- apt-get update
# auto accept oracle license
- echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
#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 Docker/policy-rc.d /usr/sbin/policy-rc.d
- apt-get install -y --allow-unauthenticated minerva
#local repository with new version
- apt-add-repository "deb http://debian-repo/ unstable main"
- apt-get update
- 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 --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
stage: test
......
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