Loading .gitlab-ci.yml +4 −2 Original line number Diff line number Diff line Loading @@ -5,7 +5,8 @@ stages: # stages - "linting" - "build" - "image-build" - "deployment" # include jobs Loading @@ -13,4 +14,5 @@ include: # deployment - local: ".gitlab/linting.yaml" - local: ".gitlab/build.yaml" - local: ".gitlab/image-build.yaml" - local: ".gitlab/deployment.yaml" .gitlab/deployment.yaml 0 → 100644 +37 −0 Original line number Diff line number Diff line --- # deploy container on kubernetes deployment: stage: "deployment" image: name: "cr.simoncor.net/siempie/ansible-deployment: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: - | # initial kubernetes deployment ssh "$SSH_DEPLOYMENT_USER@mgmt01.infra.vpn.mirahsimon.us" "sudo -u simon \ kubectl apply -f /home/simon/Documents/kaas-start-simoncor-net/manifests" # rollout deployment ssh "$SSH_DEPLOYMENT_USER@mgmt01.infra.vpn.mirahsimon.us" "sudo -u simon \ kubectl rollout restart --namespace=start-simoncor-net deployment start-simoncor-net" .gitlab/build.yaml→.gitlab/image-build.yaml +2 −2 Original line number Diff line number Diff line Loading @@ -8,8 +8,8 @@ variables: stages: - "build" build image: stage: "build" image-build: stage: "image-build" image: "docker:27.3.1" services: - name: "docker:27.3.1-dind" Loading Loading
.gitlab-ci.yml +4 −2 Original line number Diff line number Diff line Loading @@ -5,7 +5,8 @@ stages: # stages - "linting" - "build" - "image-build" - "deployment" # include jobs Loading @@ -13,4 +14,5 @@ include: # deployment - local: ".gitlab/linting.yaml" - local: ".gitlab/build.yaml" - local: ".gitlab/image-build.yaml" - local: ".gitlab/deployment.yaml"
.gitlab/deployment.yaml 0 → 100644 +37 −0 Original line number Diff line number Diff line --- # deploy container on kubernetes deployment: stage: "deployment" image: name: "cr.simoncor.net/siempie/ansible-deployment: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: - | # initial kubernetes deployment ssh "$SSH_DEPLOYMENT_USER@mgmt01.infra.vpn.mirahsimon.us" "sudo -u simon \ kubectl apply -f /home/simon/Documents/kaas-start-simoncor-net/manifests" # rollout deployment ssh "$SSH_DEPLOYMENT_USER@mgmt01.infra.vpn.mirahsimon.us" "sudo -u simon \ kubectl rollout restart --namespace=start-simoncor-net deployment start-simoncor-net"
.gitlab/build.yaml→.gitlab/image-build.yaml +2 −2 Original line number Diff line number Diff line Loading @@ -8,8 +8,8 @@ variables: stages: - "build" build image: stage: "build" image-build: stage: "image-build" image: "docker:27.3.1" services: - name: "docker:27.3.1-dind" Loading