From dc14e6bd55992aed08f0ea1be11bd197e302e475 Mon Sep 17 00:00:00 2001 From: jacquarg Date: Tue, 17 May 2022 08:35:39 +0200 Subject: [PATCH] 5080: Update trackers list from CI with git commands. --- .gitlab-ci.yml | 17 ++++++++++++++++- build_list.js | 1 - 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bcbaa826..8267abeb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,22 @@ stages: build-list: stage: deploy + before_script: + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - 'which git || ( apt-get install git -y )' + - eval $(ssh-agent -s) + - echo "$SSH_E_ROBOT_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + - git remote set-url origin ssh://git@gitlab.e.foundation/$CI_PROJECT_PATH.git + - git config --global user.name "$GITLAB_USER_NAME" + - git config --global user.email "$GITLAB_USER_EMAIL" + script: - node build_list.js - node validate_json.js - - node upload_list.js + - git add list/e_trackers.json + - git commit -m "Auto update trackers list" + - git push diff --git a/build_list.js b/build_list.js index 5eadab5a..d1fb1cfa 100644 --- a/build_list.js +++ b/build_list.js @@ -157,4 +157,3 @@ function printTrackers() { function saveTrackersFile(trackersJson) { fs.writeFileSync(outputFile, trackersJson) } - -- GitLab