Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
18 changes: 10 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: python
sudo: false
python: "3.6"
sudo: true

services:
- docker
Expand All @@ -9,24 +10,25 @@ env:
- secure: br4/uA6kM7/aiO9c4/uKrn0PCYHa8NTD/DV98N8K1/YHb5HGbOhIVrV7F7GBKiGOQKIwuD7hZ9fmZeI80iDjIdBfP+rlUt3Ipdd6/X+IwcHu46t9N89Fuw6EK+KApjK3et1BXvqT8GPMjOLX9a2O58fYMMr6OBPQGPDdSNCLnE7PQ1kX79WtXI/YpF3Ip5mDDrOeOOddVpS6+biHBthrdYRK/ZZJDTVt1HmL3Oe9LF8vt9Xw3JdzHnwBTuWg1mI+z0UCD7Nsylls/zxg8uORaMKnDIem9D9oIFWcLFWP9U/rqkIaoDi5XNwVWvMEmBT9D2qRfthm4yGyMFaBTbmE/JPG1bVuYgZYnz9DXRacRW978NudAYE7VOHjom89cW5sEt2525RbXtTgS53hZP+0PKwouXGvZPh+S45uSzKAuiCuXAuwRMLC9P77KKy+2ouhD0Czbz6BoBUtF8/KkTCQyxfo4h96+l3aVaCfD10LA3dRPJI2lWozvi57PmFvHVfKwN4B+aNunFvfuQhVdVZbudnKlFO0ew4AFaIZlKc35QeG8Yi7aymOeg+d2GsCpYG9blvMgF4+2K1Zt1OGbaO+cOhY3rI5pE6PRKQKfcpUaOLXhozLVBCMNJmXmbevuTwV6JK9UYnNRW7oVNfAbnox63PkfQIVC8LIJ7i21f/qjAU=
- secure: Nwuuh9hk3JhmoPDQG5hCt5dOvQnwOQm0SkQsHbE9PHWMZSftysM/dig80qmdoB4JfcB+0OzXFPJwBZC+IMePzjEsGcP4p2BgEnYmDS3TrPcSiPAljqvOiNj/0/K7I74ZgLm4UtnRjM6m1Og4p8+ueOHXJIiOXMmd6O2njwFcrEk9zFOrYyNLCv6OfnOQDG8E9MFuV5uoHGyr4aurjdZNRj+Io6ENbatWBXCeFTh/XuDNDrCyBrB0FkRah2jF8JMi5hU+FQI78ZnXJxGhSabyEZhPRdPEPI2FHFSn3tEiaoRQghksIR9SNfz86HqZ488BBLttBPkl9m9TbXi9ZczjagkMS5mpQ5z2HNb0Jy5brlKVkfZQry/cmIoFZHWvNzUnCM6QzaQbmsinpC9BKdnllpQfRlE/Z4jzfVLeHCvOvJu8xrGj0LsVslJZTO2g2zZkbrH0myfiV3WHIKZW+IbblqtYIN3FlT8UMnK80TJKNqP1FYU4TAg15ZNtxcr9DTi4ybLm7+c4s+Blb3UNDzhP2IfUSLnLSs/5mPhXsg+CQXAYX6ZES50XH5HCLDPUsodfI1uVEyisOKYGyFh1/ggpXJagGCAc1b9DIAriYs347fZc1OrplUtzDFQmxEpW5kGlnC3vdfALYOTejUZX2OLWLJ1rfRhfcwoWOXc++T8lqvY=
matrix:
- VERSION=0.9-composable
- VERSION=1.0-composable
- VERSION=1.1-composable
- VERSION=latest-composable
- VERSION=1.2
- VERSION=dev
- VERSION=latest

before_script:
- pip install sh requests docker-compose
- cd ${VERSION}
- cp ../hub-docs/docker-compose.yml ../hub-docs/nginx.conf .
- sed -i 's/latest-composable/${VERSION}/' docker-compose.yml

script:
- set -e
- docker build -t fiware/wirecloud:${VERSION} .
- docker-compose up -d
- sleep 40
- curl -v http://localhost/api/version
# We need to run this using sudo to be able to remove some files created by
# docker
- sudo /home/travis/virtualenv/python3.6/bin/python tests.py

after_success:
- set +e
- test "$TRAVIS_BRANCH" = "master" && test "$TRAVIS_PULL_REQUEST" = "false" && docker login -u $DOCKER_USER -p $DOCKER_PASS && docker push fiware/wirecloud:${VERSION}

branches:
Expand Down
57 changes: 0 additions & 57 deletions 0.9-composable/Dockerfile

This file was deleted.

41 changes: 0 additions & 41 deletions 0.9-composable/apache-config.conf

This file was deleted.

66 changes: 0 additions & 66 deletions 0.9-composable/docker-entrypoint.sh

This file was deleted.

33 changes: 0 additions & 33 deletions 0.9/Dockerfile

This file was deleted.

41 changes: 0 additions & 41 deletions 0.9/apache-config.conf

This file was deleted.

14 changes: 0 additions & 14 deletions 0.9/docker-entrypoint.sh

This file was deleted.

30 changes: 30 additions & 0 deletions 1.0-composable/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: "3.1"

services:

nginx:
restart: always
image: nginx:latest
ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./static:/var/www/static:ro
depends_on:
- wirecloud


postgres:
restart: always
image: postgres:latest
volumes:
- ./postgres-data:/var/lib/postgresql/data

wirecloud:
restart: always
image: fiware/wirecloud:1.0-composable
depends_on:
- postgres
volumes:
- ./wirecloud_instance:/opt/wirecloud_instance
- ./static:/var/www/static
File renamed without changes.
62 changes: 62 additions & 0 deletions 1.0-composable/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c) 2018 Future Internet Consulting and Development Solutions S.L.

import os
import shutil
import time
import unittest
from urllib.parse import parse_qs, urlparse

import requests
import sh


class ComposedTests(unittest.TestCase):

@classmethod
def setUpClass(cls):
print("#")
print("# Initializing composed test case")
print("#\n")
sh.docker_compose.up(d=True, remove_orphans=True, _fg=True)
time.sleep(40)
print()

@classmethod
def tearDownClass(cls):
print()
print("#")
print("# Removing containers and volumes")
print("#\n")
sh.docker_compose.down(remove_orphans=True, v=True, _fg=True)
shutil.rmtree('wirecloud_instance')
shutil.rmtree('postgres-data')
shutil.rmtree('static')
print()

def test_features_api_should_be_available(self):
response = requests.get("http://localhost/api/features")
self.assertEqual(response.status_code, 200)

def test_search_engine_should_work(self):
response = requests.get("http://localhost/api/search?namespace=workspace&maxresults=1")
self.assertEqual(response.status_code, 200)

def test_root_page_should_work(self):
response = requests.get("http://localhost/")
self.assertEqual(response.status_code, 200)

def test_home_page_should_work(self):
response = requests.get("http://localhost/wirecloud/home")
self.assertEqual(response.status_code, 200)

def test_should_serve_static_files(self):
response = requests.get("http://localhost/static/theme/wirecloud.defaulttheme/images/logos/header.png")
self.assertEqual(response.status_code, 200)


if __name__ == "__main__":
unittest.main(verbosity=2)

Loading