Commit ed7427a9 authored by Daniele Venzano's avatar Daniele Venzano

Test the full pipeline

parent 3d28bab6
......@@ -11,24 +11,24 @@ variables:
ZOE_TEST_IMAGE: zoe:$CI_BUILD_REF
ZOE_COMMON_OPTIONS: --debug --backend-swarm-url ${SWARM_URL} --deployment-name test${CI_BUILD_REF} --dbuser ${POSTGRES_USER} --dbhost postgres --dbport 5432 --dbname ${POSTGRES_DB} --dbpass ${POSTGRES_PASSWORD} --master-url tcp://localhost:4850 --auth-type text --proxy-type none --listen-port 5100 --workspace-base-path /tmp
#lint:
# stage: static-test
# image: python:3.4
# script:
# - pip install -r requirements.txt
# - pip install -r requirements_tests.txt
# - chmod 755 run_tests.sh && ./run_tests.sh
lint:
stage: static-test
image: python:3.4
script:
- pip install -r requirements.txt
- pip install -r requirements_tests.txt
- chmod 755 run_tests.sh && ./run_tests.sh
#SonarQube:
# stage: static-test
# image: zoerepo/sonar-scanner
# variables:
# SONAR_PROJECT_KEY: "zoe.$CI_BUILD_REF_NAME"
# SONAR_PROJECT_NAME: "Zoe devel"
# SONAR_PROJECT_VERSION: "$CI_BUILD_REF"
# SONARQUBE_SERVER_URL: "$SONARQUBE_SERVER_URL"
# script:
# - /usr/bin/sonar-scanner-run.sh
SonarQube:
stage: static-test
image: zoerepo/sonar-scanner
variables:
SONAR_PROJECT_KEY: "zoe.$CI_BUILD_REF_NAME"
SONAR_PROJECT_NAME: "Zoe devel"
SONAR_PROJECT_VERSION: "$CI_BUILD_REF"
SONARQUBE_SERVER_URL: "$SONARQUBE_SERVER_URL"
script:
- /usr/bin/sonar-scanner-run.sh
#frontend-unittest:
# stage: static-test
......@@ -39,52 +39,55 @@ variables:
# - npm install -g @angular/cli
# - ng test
#api-test:
# stage: integration-test
# services:
# - postgres:9.3
# image: python:3.4
# before_script:
# - pip install -r requirements.txt
# - pip install -r requirements_tests.txt
# - echo "admin,admin,admin" > zoepass.csv
# - mkdir /tmp/test${CI_BUILD_REF}
# script:
# - python3 create_db_tables.py ${ZOE_COMMON_OPTIONS}
# - python3 zoe-api.py ${ZOE_COMMON_OPTIONS} --log-file zoe-api-${CI_BUILD_REF}.log &
# - sleep 1
# - python3 zoe-master.py ${ZOE_COMMON_OPTIONS} --log-file zoe-master-${CI_BUILD_REF}.log &
# - sleep 1
# - cd tests
# - coverage run basic_auth_success_test.py localhost:5100
# artifacts:
# paths:
# - zoe-api-${CI_BUILD_REF}.log
# - zoe-master-${CI_BUILD_REF}.log
api-test:
stage: integration-test
services:
- postgres:9.3
image: python:3.4
before_script:
- pip install -r requirements.txt
- pip install -r requirements_tests.txt
- echo "admin,admin,admin" > zoepass.csv
- mkdir /tmp/test${CI_BUILD_REF}
- python3 create_db_tables.py ${ZOE_COMMON_OPTIONS}
- python3 zoe-api.py ${ZOE_COMMON_OPTIONS} --log-file zoe-api-${CI_BUILD_REF}.log &
- sleep 1
- python3 zoe-master.py ${ZOE_COMMON_OPTIONS} --log-file zoe-master-${CI_BUILD_REF}.log &
- sleep 1
script:
- cd tests
- coverage run -p basic_auth_success_test.py localhost:5100
- coverage run -p cookie_auth_success_test.py
- coverage combine
- coverage report
artifacts:
paths:
- zoe-api-${CI_BUILD_REF}.log
- zoe-master-${CI_BUILD_REF}.log
- tests
#images:
# image: docker:latest
# stage: build
# before_script:
# - mkdir -p /etc/docker/certs.d/$DOCKER_REGISTRY
# - cp /registry-ca.crt /etc/docker/certs.d/$DOCKER_REGISTRY/ca.crt
# - docker login -u gitlab-ci-runner -p $REGISTRY_PASSWORD $DOCKER_REGISTRY
# script:
# - docker build --pull -t ${DOCKER_REGISTRY}/ci/${ZOE_TEST_IMAGE} .
# - docker push ${DOCKER_REGISTRY}/ci/${ZOE_TEST_IMAGE}
images:
image: docker:latest
stage: build
before_script:
- mkdir -p /etc/docker/certs.d/$DOCKER_REGISTRY
- cp /registry-ca.crt /etc/docker/certs.d/$DOCKER_REGISTRY/ca.crt
- docker login -u gitlab-ci-runner -p $REGISTRY_PASSWORD $DOCKER_REGISTRY
script:
- docker build --pull -t ${DOCKER_REGISTRY}/ci/${ZOE_TEST_IMAGE} .
- docker push ${DOCKER_REGISTRY}/ci/${ZOE_TEST_IMAGE}
docs:
stage: deploy
image: python:3.4
image: ${DOCKER_REGISTRY}/ci/${ZOE_TEST_IMAGE}
before_script:
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- 'echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- apt-get update -y && apt-get install rsync -y
script:
- pip install -r requirements.txt
- sh ./build_docs.sh
- rsync -avz docs/_build/html/ ubuntu@${STAGING_IP}:${STAGING_PATH}/docs
environment:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment