From c2ade641ffab07431fcfe40da97b413f52efab7d Mon Sep 17 00:00:00 2001 From: Florian Hoss Date: Fri, 23 Jun 2023 09:25:22 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f71673b..5120ef0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,7 @@ variables: GOLANG_VERSION: '1.20' NODE_VERSION: '18' ALPINE_VERSION: '3' + DEBIAN_VERSION: '12' image: docker:$DOCKER_VERSION-git @@ -11,6 +12,7 @@ stages: - test - build - analyse + - deploy include: - local: .gitlab/_common.gitlab-ci.yml @@ -63,3 +65,18 @@ container_scanning: variables: CS_IMAGE: $LATEST_IMAGE CS_DOCKERFILE_PATH: docker/Dockerfile + +deploy-job: + stage: deploy + image: debian:${DEBIAN_VERSION}-slim + id_tokens: + TBOT_GITLAB_JWT: + aud: tp.fhoss.de + script: + - cd /tmp + - apt-get curl + - 'curl -O https://cdn.teleport.dev/teleport-v13.1.1-linux-amd64-bin.tar.gz' + - tar -xvf teleport-v13.1.1-linux-amd64-bin.tar.gz + - ./teleport/install + - 'tbot start --token=gitlab --destination-dir=/tmp/tbot-user --data-dir=/tmp/tbot-data --auth-server=tp.fhoss.de:443 --join-method=gitlab --oneshot' + - 'tsh -i /tmp/tbot-user/identity --proxy tp.fhoss.de:443 ssh bot@benelli "echo $CI_JOB_ID >> ~/gitlab_run_log"'