diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bcbaa8269aa8727e292d7d60fb0da94233524a5e..8267abeb4a69d2477c787e9f97253de813afc94d 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 5eadab5a62f98f7fe86896753d3f482f012c9f37..d1fb1cfaea7668a9cde7f64aeaf8b1bd7e076adb 100644 --- a/build_list.js +++ b/build_list.js @@ -157,4 +157,3 @@ function printTrackers() { function saveTrackersFile(trackersJson) { fs.writeFileSync(outputFile, trackersJson) } -