From 31555fed826814f18b1a7489e5ada20d6f4795e3 Mon Sep 17 00:00:00 2001 From: Slava Date: Mon, 28 Aug 2023 23:48:44 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e29902c..8334c71 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,8 +12,39 @@ prepare_job: - 'git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gl.beaconborn.ru/bacon/translation-generator.git' - 'python3 translation-generator/main.py $CI_PROJECT_DIR' - 'git commit -m "Updated translate"' + + after_script: + - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' + ## + ## Run ssh-agent (inside the build environment) + ## + - eval $(ssh-agent -s) + ## + ## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store + ## We're using tr to fix line endings which makes ed25519 keys work + ## without extra base64 encoding. + ## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556 + ## + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + ## + ## Create the SSH directory and give it the right permissions + ## + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + ## + ## Assuming you created the SSH_SERVER_HOST_KEYS variable, uncomment the + ## following two lines. + ## + - echo "$SSH_SERVER_HOST_KEYS" >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + - git config --global user.email 'bot@hzdr.de' + - git config --global user.name 'Bot' - 'git push -o ci.skip https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git origin HEAD:$CI_COMMIT_BRANCH' + + + + artifacts: paths: - 'data/localization/ru.po'