This commit is contained in:
WinterMyst 2024-09-22 18:55:51 +02:00
parent 5f4ab69c2c
commit 2ee59e85e4

View File

@ -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
- |