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
|
# deploy ansible/roles/common code
|
||||||
deployment:
|
deployment:
|
||||||
stage: "deployment"
|
stage: "deployment"
|
||||||
|
|
@ -9,35 +8,24 @@ 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
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
chmod 700 ~/.ssh
|
chmod 700 ~/.ssh
|
||||||
echo "$SSH_CONFIG" > ~/.ssh/config
|
echo "$SSH_CONFIG" > ~/.ssh/config
|
||||||
echo "$SSH_DEPLOYMENT_KEY" > ~/.ssh/id_ed25519
|
echo "$SSH_DEPLOYMENT_KEY" > ~/.ssh/id_ed25519
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
|
||||||
# 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"
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue