From 2ee59e85e478e47398ba3981f7af9d6380a8a32a Mon Sep 17 00:00:00 2001 From: WinterMyst Date: Sun, 22 Sep 2024 18:55:51 +0200 Subject: [PATCH] e --- .gitlab-ci.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ce1e9a9..0d49b40 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,22 +27,32 @@ release: image: ubuntu:latest # Or any other basic image before_script: # Install Node.js v21.7.3 manually - - apt-get update && apt-get install -y curl jq git + - apt-get update && apt-get install -y curl jq git openssh-client - curl -fsSL https://deb.nodesource.com/setup_21.x | bash - - apt-get install -y nodejs - node -v # Verify the correct Node.js version # Install Gulp globally - npm install --global gulp-cli - gulp --version # Verify Gulp is installed + # Prepare SSH + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + # Decode and set up the SSH private key + - echo "$SSH_PRIVATE_KEY_BASE64" | base64 -d > ~/.ssh/id_rsa + - chmod 600 ~/.ssh/id_rsa + # Start the SSH agent and add the key + - eval $(ssh-agent -s) + - ssh-add ~/.ssh/id_rsa + # Add GitLab to known hosts to prevent authenticity prompt + - ssh-keyscan gitlab.com >> ~/.ssh/known_hosts + # Set Git configuration - git config --global user.name "GitLab CI" - git config --global user.email "ci@gitlab.com" - # Use the PAT for authentication - - git config --global credential.helper store - - echo "https://oauth2:${GITLAB_PAT}@gitlab.com" > ~/.git-credentials - - git remote set-url origin https://oauth2:${GITLAB_PAT}@gitlab.com/wintermyst/kidsonbrooms.git - - git fetch --unshallow # Ensure we fetch all history for the branch (not a shallow clone) - - git checkout master # Switch to the master branch - - git branch --set-upstream-to=origin/master master # Set the upstream to the master branch + # Update the Git remote to use SSH + - git remote set-url origin git@gitlab.com:wintermyst/kidsonbrooms.git + # Fetch and check out the master branch + - git fetch --unshallow + - git checkout master script: # Check if VERSION is provided - |