diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bbb0c2240d5f2db8ae37e57ac5fc652da76dad61..7658a54f2407cee5bd49a90946226146ca45be3b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -188,3 +188,19 @@ cppcheck: - html_report/ +deploy_cppcheck_to_elladan: + stage: deploy + needs: ["cppcheck"] + + before_script: + - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' + - apt-get install -y rsync + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY_ELLADAN" | tr -d '\r' | ssh-add - + - ssh-keyscan -t rsa elladan.irmb.bau.tu-bs.de >> ~/.ssh/known_hosts + - pip3 install ansible + + script: + - ansible-playbook -i ansible/hosts.cfg -u public_pages ansible/playbook_cppcheck.yml diff --git a/ansible/hosts.cfg b/ansible/hosts.cfg index 9c6d00b0534243cb1f473718c4b271cd893627bf..791cf36df2f9597d84ecef9d512b6855dfeb1873 100644 --- a/ansible/hosts.cfg +++ b/ansible/hosts.cfg @@ -2,3 +2,5 @@ host_key_checking=False [gitlab_ci_deploy_targets] phoenix.hlr.rz.tu-bs.de ansible_ssh_private_key_file=./private_key +[gitlab_ci_deploy_cppcheck] +elladan.irmb.bau.tu-bs.de diff --git a/ansible/playbook.yml b/ansible/playbook.yml index 2653089c73ba5fab6175638e2133db344d227782..4f0633a95475d33ca8d406664b0857204adac5a5 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -25,6 +25,3 @@ - { src: '../gpu.cmake', dest: '~/VirtualFluids_dev/gpu.cmake' } - { src: '../pyproject.toml', dest: '~/VirtualFluids_dev/pyproject.toml' } - { src: '../setup.py', dest: '~/VirtualFluids_dev/setup.py' } - - - diff --git a/ansible/playbook_cppcheck.yml b/ansible/playbook_cppcheck.yml new file mode 100644 index 0000000000000000000000000000000000000000..b33d71ba8821c1a0af38c1bf265d9f7393f4c462 --- /dev/null +++ b/ansible/playbook_cppcheck.yml @@ -0,0 +1,10 @@ +- hosts: gitlab_ci_deploy_cppcheck + tasks: + - name: Create remote cppcheck dir + command: mkdir ~/cppcheck + ignore_errors: yes + + - name: Synchronize cppcheck with remote + synchronize: + src: "../html_report" + dest: "~/cppcheck/html_report"