Skip to content
Snippets Groups Projects
Unverified Commit 0b7c2c68 authored by JohannesGarm's avatar JohannesGarm Committed by GitHub
Browse files

Merge pull request #30 from safaci2000/feature/cicd

Adding CI/CD
parents c865935a d41835e7
Branches
Tags
No related merge requests found
kind: pipeline
name: default
steps:
- name: build
image: python:3.9
environment:
POSTGRES_HOST: database
commands:
- apt update && apt-get install -y postgresql-client
- cat datafiles/schema.sql | PGPASSWORD="w1gWIn7NDGXjXMguiI2Qe05X" psql -U opennsa -h database -d opennsatest
- python3 -m pip install -r requirements.txt
- cp util/integration-config.json .opennsa-test.json
- cp config/opennsa.conf.template config/opennsa.conf
- PYTHONPATH=. trial test
services:
- name: database
image: postgres:12-alpine
environment:
POSTGRES_USER: opennsa
POSTGRES_PASSWORD: w1gWIn7NDGXjXMguiI2Qe05X
POSTGRES_DB: opennsatest
trigger:
event:
- push
- pull_request
...@@ -15,6 +15,6 @@ def setupDatabase(config_file=CONFIG_FILE): ...@@ -15,6 +15,6 @@ def setupDatabase(config_file=CONFIG_FILE):
tc = json.load( open(config_file) ) tc = json.load( open(config_file) )
database.setupDatabase( tc['database'], tc['user'], tc['password'], host='127.0.0.1') database.setupDatabase( tc['database'], tc['user'], tc['password'], host=tc['hostname'])
...@@ -123,7 +123,7 @@ class ConfigTest(unittest.TestCase): ...@@ -123,7 +123,7 @@ class ConfigTest(unittest.TestCase):
self.database = tc['database'] self.database = tc['database']
self.db_user = tc['user'] self.db_user = tc['user']
self.db_password = tc['password'] self.db_password = tc['password']
self.db_host = '127.0.0.1' self.db_host = tc['hostname']
def _generate_temp_file(self, buffer): def _generate_temp_file(self, buffer):
""" """
......
...@@ -117,7 +117,7 @@ class MultipleInstancesTestMultipleInstancesTest(unittest.TestCase): ...@@ -117,7 +117,7 @@ class MultipleInstancesTestMultipleInstancesTest(unittest.TestCase):
self.database = tc['database'] self.database = tc['database']
self.db_user = tc['user'] self.db_user = tc['user']
self.db_password = tc['password'] self.db_password = tc['password']
self.db_host = '127.0.0.1' self.db_host = tc['hostname']
# make temporary files for nrm map files # make temporary files for nrm map files
......
...@@ -32,7 +32,7 @@ class NCSVPNBackendTest(unittest.TestCase): ...@@ -32,7 +32,7 @@ class NCSVPNBackendTest(unittest.TestCase):
self.backend.startService() self.backend.startService()
database.setupDatabase( tc['database'], tc['database-user'], tc['database-password']) database.setupDatabase(tc['database'], tc['database-user'], tc['database-password'], host=tc['hostname'])
self.requester_nsa = nsa.NetworkServiceAgent('test-requester', 'http://example.org/nsa-test-requester') self.requester_nsa = nsa.NetworkServiceAgent('test-requester', 'http://example.org/nsa-test-requester')
self.provider_nsa = nsa.NetworkServiceAgent('test-provider', 'http://example.org/nsa-test-provider') self.provider_nsa = nsa.NetworkServiceAgent('test-provider', 'http://example.org/nsa-test-provider')
......
{
"container" : "opennsa-test-database",
"database" : "opennsatest",
"user" : "opennsa",
"hostname" : "database",
"password" : "w1gWIn7NDGXjXMguiI2Qe05X"
}
...@@ -21,7 +21,8 @@ echo "{ ...@@ -21,7 +21,8 @@ echo "{
\"container\" : \"$container\", \"container\" : \"$container\",
\"database\" : \"$database\", \"database\" : \"$database\",
\"user\" : \"$user\", \"user\" : \"$user\",
\"password\" : \"$password\" \"password\" : \"$password\",
\"hostname\" : \"127.0.0.1\"
}" > "$configfile" }" > "$configfile"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment