Skip to content

Instantly share code, notes, and snippets.

@arfar-x
Created February 20, 2024 13:03
Show Gist options
  • Select an option

  • Save arfar-x/148422073e8cb5e4a42b5b07f5b169ed to your computer and use it in GitHub Desktop.

Select an option

Save arfar-x/148422073e8cb5e4a42b5b07f5b169ed to your computer and use it in GitHub Desktop.
Gitlab CI snippet
before_script:
- |
# Validate repo's Git credentials.
git config user.email "$GITLAB_USER_EMAIL"
git config user.name "$GITLAB_USER_NAME"
git config credential.helper "store --file=.git/credentials"
git config http.sslverify "false"
.commit_version: &commit_version
- git remote set-url origin https://${GITLAB_USER_LOGIN}:${ACCESS_KEY}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
- git checkout $CI_COMMIT_REF_NAME
- git add .
- git commit -m "Versioned $MODULE_VERSION pipeline $CI_PIPELINE_ID"
- git push origin $CI_COMMIT_REF_NAME -o ci.skip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment