feat: add gitigore file

This commit is contained in:
Simon Cornet 2025-03-31 11:34:22 +02:00
commit a60418e6db
2 changed files with 12 additions and 23 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.ansible

View file

@ -1,5 +1,4 @@
--- ---
# deploy ansible/roles/common code # deploy ansible/roles/common code
deployment: deployment:
stage: "deployment" stage: "deployment"
@ -9,12 +8,13 @@ deployment:
rules: rules:
# run only on push to default branch # run only on push to default branch
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if:
'$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH ==
$CI_DEFAULT_BRANCH'
- when: "never" - when: "never"
# prepare ssh # prepare ssh
before_script: before_script:
# prepare ssh # prepare ssh
- | - |
# prepare ssh # prepare ssh
@ -26,18 +26,6 @@ deployment:
# deployment commands # deployment commands
script: script:
- | - |
# git cleanup # install ansible roles dependancies
ssh $SSH_DEPLOYMENT_USER@$ANSIBLE_SERVER "sudo /usr/bin/git -C /etc/ansible/roles/common reset --hard HEAD --quiet" ssh $SSH_DEPLOYMENT_USER@$ANSIBLE_SERVER "sudo /usr/local/bin/ansible-galaxy install -r /etc/ansible/roles/requirements.yaml"
ssh $SSH_DEPLOYMENT_USER@$ANSIBLE_SERVER "sudo /usr/bin/git -C /etc/ansible/roles/common clean -fx"
ssh $SSH_DEPLOYMENT_USER@$ANSIBLE_SERVER "sudo /usr/bin/git -C /etc/ansible/roles/common clean -fd"
- |
# print deployment details
ssh $SSH_DEPLOYMENT_USER@$ANSIBLE_SERVER "echo Deploying commit id $CI_COMMIT_SHORT_SHA with message: $CI_COMMIT_MESSAGE"
- |
# download deployment
ssh $SSH_DEPLOYMENT_USER@$ANSIBLE_SERVER "sudo /usr/bin/git -C /etc/ansible/roles/common fetch --quiet"
ssh $SSH_DEPLOYMENT_USER@$ANSIBLE_SERVER "sudo /usr/bin/git -C /etc/ansible/roles/common checkout $CI_COMMIT_SHORT_SHA --quiet"