-
Hervé MENAGER authored
because ansible does not support python3.4 anymore, and this causes this on deployment: https://github.com/ansible/ansible/issues/24180 Former-commit-id: 5448751bd777f3f2d9b60dea313cf8fa2305fedc
6f0174cf
.gitlab-ci.yml 1.33 KiB
stages:
- test
- deploy
test-centos7:
image: centos:centos7
stage: test
script:
- yum install -y epel-release
- yum install install -y python34-pip python34-devel
- yum install -y gcc graphviz graphviz-devel
- yum install -y httpd httpd-devel
- cd ippisite
- pip3 install -r requirements.txt
- python3 manage.py test
deploy-webserver:
stage: deploy
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
- yum install -y gcc
- wget https://centos7.iuscommunity.org/ius-release.rpm
- rpm -Uvh ius-release*.rpm
- yum install -y python35u python35u-libs python35u-devel python35u-pip
- pip3 install ansible
- cd ansible
- whoami
- ansible-playbook -vvv -i ./hosts_deploy deploy.yaml --extra-vars "deploy_user_name=ippidb repo_api_token=JZS-4cH7bWkFkHa2rAVf"