feat: initial commit

This commit is contained in:
Simon Cornet 2025-04-16 17:32:51 +02:00
commit 0830507cf7
20 changed files with 459 additions and 0 deletions

31
.gitlab/deployment.yaml Normal file
View file

@ -0,0 +1,31 @@
---
# deploy ansible/roles/common code
deployment:
stage: "deployment"
image:
name: "cr.simoncor.net/siempie/ssh-client:latest"
entrypoint: ["/bin/sh", "-c"]
rules:
# run only on push to default branch
- if:
'$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH ==
$CI_DEFAULT_BRANCH'
- when: "never"
# prepare ssh
before_script:
# prepare ssh
- |
# prepare ssh
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "$SSH_CONFIG" > ~/.ssh/config
echo "$SSH_DEPLOYMENT_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
# deployment commands
script:
- |
# install ansible roles dependancies
ssh $SSH_DEPLOYMENT_USER@$ANSIBLE_SERVER "sudo /usr/local/bin/ansible-galaxy install -r /etc/ansible/roles/requirements.yaml --force"