feat: add gitigore file
This commit is contained in:
parent
4fa6a04b81
commit
a60418e6db
2 changed files with 12 additions and 23 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
.ansible
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
---
|
||||
|
||||
# deploy ansible/roles/common code
|
||||
deployment:
|
||||
stage: "deployment"
|
||||
|
|
@ -9,12 +8,13 @@ deployment:
|
|||
rules:
|
||||
|
||||
# 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"
|
||||
|
||||
# prepare ssh
|
||||
before_script:
|
||||
|
||||
# prepare ssh
|
||||
- |
|
||||
# prepare ssh
|
||||
|
|
@ -26,18 +26,6 @@ deployment:
|
|||
|
||||
# deployment commands
|
||||
script:
|
||||
|
||||
- |
|
||||
# git cleanup
|
||||
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/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"
|
||||
# install ansible roles dependancies
|
||||
ssh $SSH_DEPLOYMENT_USER@$ANSIBLE_SERVER "sudo /usr/local/bin/ansible-galaxy install -r /etc/ansible/roles/requirements.yaml"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue