Created
November 29, 2016 15:33
-
-
Save remyleone/2f4ef7d7f404b4aeb9ce59a26cbaf620 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: debian | |
before_script: | |
- apt-get update && apt-get clean | |
- apt-get install --fix-missing -y python-dev python-pip python-setuptools | |
- apt-get install --fix-missing -y build-essential | |
- apt-get install --fix-missing -y libyaml-dev | |
- apt-get install --fix-missing -y libssl-dev openssl | |
- apt-get install --fix-missing -y libffi-dev | |
- apt-get install --fix-missing -y curl tree netcat | |
# Install Python dependencies | |
- pip install -r requirements.txt | |
test_ansible: | |
script: | |
# Build documentation | |
- (cd docs; make html) | |
# Testing ansible | |
- cp playbooks/secrets.yml.example playbooks/secrets.yml | |
# Check the role/playbook's syntax. | |
- (cd playbooks; ansible-playbook -i hosts.example main.yml --syntax-check) | |
# Run the role/playbook with ansible-playbook. | |
- (cd playbooks; ansible-playbook -vv -i hosts.example main.yml) | |
# Test if servers are up and running | |
# 5672: RabbitMQ (plain text - amqp) | |
- nc -z localhost 5672 | |
# 80: Web interface | |
- nc -z localhost 80 | |
# 15672: RabbitMQ management interface | |
- nc -z localhost 15672 | |
# Curl will fail if we get an HTTP 5xx return code | |
- curl --fail http://localhost | |
# Print logs from supervisor | |
- find /var/log/supervisor/ -type f -exec cat {} + | |
# Show deployed code | |
- tree /home/f-interop | |
test_orchestrator: | |
before_script: | |
- apt-get update && apt-get clean | |
- apt-get install --fix-missing -y python-dev python-pip python-setuptools | |
- apt-get install --fix-missing -y python3-dev python3-pip python3-setuptools | |
- apt-get install --fix-missing -y libssl-dev openssl | |
- apt-get install --fix-missing -y libffi-dev | |
# Install Python dependencies | |
- python3 -m pip install -r requirements.txt | |
- python3 -m pip install -r finterop/requirements.txt | |
# Testing ansible | |
- cp playbooks/secrets.yml.example playbooks/secrets.yml | |
- mkdir -p playbooks/credentials/server | |
# FINTEROP_RABBITMQ_PASSWORD password | |
- echo f-interop > playbooks/credentials/server/rabbitmq_admin_password | |
# Run the role/playbook with ansible-playbook. | |
- (cd playbooks; ansible-playbook -vv -i hosts.example main.yml --tags rmq,orchestrator) | |
script: | |
- "python3 -m pytest -s -vvvv finterop/orchestrator/tests < /dev/null > /tmp/test.out 2> /tmp/test.err" | |
- cat /tmp/test.out | |
- cat /tmp/test.err | |
variables: | |
FINTEROP_RABBITMQ_USER: "admin" | |
FINTEROP_RABBITMQ_PASSWORD: "f-interop" | |
FINTEROP_RABBITMQ_HOST: "localhost" | |
FINTEROP_RABBITMQ_HTTP_PORT: "15672" | |
FINTEROP_ORCHESTRATOR_HTTP_PORT: "9000" | |
FINTEROP_DEFAULT_EXCHANGE: "default" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment