.gitlab-ci.yml 2.38 KB
Newer Older
Hervé  MENAGER's avatar
Hervé MENAGER committed
1 2 3 4
stages:
  - test
  - deploy

Hervé  MENAGER's avatar
Hervé MENAGER committed
5 6 7 8
test-centos7:
  image: centos:centos7
  stage: test
  script:
Hervé  MENAGER's avatar
Hervé MENAGER committed
9
  - yum install -y epel-release wget
Hervé  MENAGER's avatar
Hervé MENAGER committed
10 11
  - wget https://centos7.iuscommunity.org/ius-release.rpm
  - rpm -Uvh ius-release*.rpm
12 13
  - yum provides python3.6
  - yum install -y python36u python36u-libs python36u-devel python36u-pip
14
  - yum install -y blas-devel lapack-devel
15 16
  - pip3.6 install --user pip
  - python3.6 -m pip install virtualenv
17
  - virtualenv -p python3.6 venv
Hervé  MENAGER's avatar
Hervé MENAGER committed
18
  - . venv/bin/activate
19
  - pip3.6 install -r requirements-working.txt
Hervé  MENAGER's avatar
Hervé MENAGER committed
20
  - yum install -y httpd httpd-devel gcc
21
  - pip3.6 install mod_wsgi
22
  - python3.6 setup.py test
23

24 25 26 27
test-python36:
  image: python:3.6
  stage: test
  script:
28
  - apt-get update && apt install -y libblas-dev liblapack-dev python3-dev
29
  - pip install -r requirements-working.txt
30
  - python setup.py test
31 32 33 34 35

test-python37:
  image: python:3.7
  stage: test
  script:
36
  - apt-get update && apt install -y libblas-dev liblapack-dev python3-dev
37
  - pip install -r requirements-working.txt
38
  - python setup.py test
39

40
pages:
Hervé  MENAGER's avatar
Hervé MENAGER committed
41
  image: python:3.6
Hervé  MENAGER's avatar
Hervé MENAGER committed
42
  stage: deploy
43
  script:
44
  - pip install sphinx sphinx-argparse sphinxcontrib.bibtex sphinx_rtd_theme
45
  - pip install -r requirements-working.txt
Hervé  MENAGER's avatar
Hervé MENAGER committed
46
  - pip install .
47 48 49 50 51 52 53
  - cd doc
  - make html
  - mv build/html/ ../public
  artifacts:
    paths:
    - public
  only:
Hervé  MENAGER's avatar
Hervé MENAGER committed
54
  - master
Hervé  MENAGER's avatar
Hervé MENAGER committed
55
  
Hervé  MENAGER's avatar
Hervé MENAGER committed
56 57
deploy-webserver:
  stage: deploy
58
  image: centos:centos7
Hervé  MENAGER's avatar
Hervé MENAGER committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
  before_script:
    # install ssh-agent
    - 'which ssh-agent || ( yum -y install openssh-clients )'
    # run ssh-agent
    - eval $(ssh-agent -s)
    # add ssh key stored in SSH_PRIVATE_KEY variable to the agent store
    - ssh-add <(echo "$SSH_PRIVATE_KEY")
    # disable host key checking (NOTE: makes you susceptible to man-in-the-middle attacks)
    # WARNING: use only in docker container, if you use it with shell you will overwrite your user's ssh config
    - mkdir -p ~/.ssh
    - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
  script:
    - yum install -y epel-release wget
    - yum install -y gcc
    - wget https://centos7.iuscommunity.org/ius-release.rpm
    - rpm -Uvh ius-release*.rpm
75
    - yum install -y python35u python35u-libs python35u-devel python35u-pip openssl-devel  libffi-devel
Hervé  MENAGER's avatar
Hervé MENAGER committed
76 77 78
    - pip3.5 install ansible
    - cd ansible
    - whoami
79
    - ansible-playbook -vvv -i ./hosts_deploy deploy.yaml --extra-vars "deploy_user_name=jass repo_api_token=$REPO_API_TOKEN"
Bryan  BRANCOTTE's avatar
Bryan BRANCOTTE committed
80 81 82
  only:
  - master