diff options
Diffstat (limited to '.gitlab-ci.yml')
| -rw-r--r-- | .gitlab-ci.yml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..c816acd --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,26 @@ +stages: # List of stages for jobs, and their order of execution + - test + - deploy + +lint-test-job: + stage: test + image: pipelinecomponents/ansible-lint + script: + - ansible-lint -p lamp.yml | ansible-lint-junit -o ansible-lint.xml || true + artifacts: + when: always + reports: + junit: ansible-lint.xml + +deploy-job: + stage: deploy + image: ansible + before_script: + - mkdir -p ~/.ssh + - ssh-keyscan ansible-debian.xlinfo.lan > ~/.ssh/known_hosts + - ssh-keyscan ansible-rocky.xlinfo.lan >> ~/.ssh/known_hosts + - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa + - chmod 600 ~/.ssh/id_rsa + - chmod 700 ~/.ssh/ + script: + - ansible-playbook lamp.yml -i hosts |
