Loading .gitlab-ci.yml +2 −34 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ install_project: tags: - git-run-ia2 script: - echo "Current directory $(pwd) $GITLAB_TOKEN" - echo "Current directory $(pwd)" - ls -la - echo "Python version $(python -v)" - pip install --upgrade pip Loading Loading @@ -148,36 +148,4 @@ commit_formatted_code: - git pull - git push https://davide.ricci:$GITLAB_TOKEN@www.ict.inaf.it/gitlab/davide.ricci/software-di-controllo.git ${FORMATTED_BRANCH_NAME} # before_script: # # Git and SSH setup (ensure SSH_DEPLOY_KEY CI/CD variable is set as File type) # - apt-get update -y && apt-get install -y openssh-client git # - eval $(ssh-agent -s) # - mkdir -p ~/.ssh && chmod 700 ~/.ssh # - echo "$SSH_DEPLOY_KEY" | tr -d '\r' > ~/.ssh/id_ci_deploy && chmod 600 ~/.ssh/id_ci_deploy # - ssh-add ~/.ssh/id_ci_deploy # - ssh-keyscan -p ${CI_SERVER_PORT:-22} $CI_SERVER_HOST >> ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts # - git config --global user.email "${GIT_USER_EMAIL}" # - git config --global user.name "${GIT_USER_NAME}" # # Ensure we are on the correct branch and have the latest files from artifacts # - git checkout "$CI_COMMIT_BRANCH" # script: # - echo "Checking for formatting changes to commit..." # - | # # Add only the formatted targets to avoid committing other unintended changes # git add "${FORMAT_TARGETS}" # # if ! git diff --cached --quiet HEAD; then # Check staged changes against HEAD # echo "Code formatting changes applied. Committing to branch '${CI_COMMIT_BRANCH}'." # # Option 1: Commit to a NEW branch (Safer) # git checkout -B "${FORMATTED_BRANCH_NAME}" # git commit -m "ci: Apply automated code formatting [skip ci]" # git push -u origin "${FORMATTED_BRANCH_NAME}" -o ci.skip # echo "Changes pushed to new branch '${FORMATTED_BRANCH_NAME}'. Please review and merge." # else # echo "No formatting changes to commit." # fi # rules: # # Example: Only run manually on the default branch after all checks pass # - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule" # Avoid on schedules # when: manual # Make this a conscious decision # allow_failure: false # If it runs, it must succeed Loading
.gitlab-ci.yml +2 −34 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ install_project: tags: - git-run-ia2 script: - echo "Current directory $(pwd) $GITLAB_TOKEN" - echo "Current directory $(pwd)" - ls -la - echo "Python version $(python -v)" - pip install --upgrade pip Loading Loading @@ -148,36 +148,4 @@ commit_formatted_code: - git pull - git push https://davide.ricci:$GITLAB_TOKEN@www.ict.inaf.it/gitlab/davide.ricci/software-di-controllo.git ${FORMATTED_BRANCH_NAME} # before_script: # # Git and SSH setup (ensure SSH_DEPLOY_KEY CI/CD variable is set as File type) # - apt-get update -y && apt-get install -y openssh-client git # - eval $(ssh-agent -s) # - mkdir -p ~/.ssh && chmod 700 ~/.ssh # - echo "$SSH_DEPLOY_KEY" | tr -d '\r' > ~/.ssh/id_ci_deploy && chmod 600 ~/.ssh/id_ci_deploy # - ssh-add ~/.ssh/id_ci_deploy # - ssh-keyscan -p ${CI_SERVER_PORT:-22} $CI_SERVER_HOST >> ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts # - git config --global user.email "${GIT_USER_EMAIL}" # - git config --global user.name "${GIT_USER_NAME}" # # Ensure we are on the correct branch and have the latest files from artifacts # - git checkout "$CI_COMMIT_BRANCH" # script: # - echo "Checking for formatting changes to commit..." # - | # # Add only the formatted targets to avoid committing other unintended changes # git add "${FORMAT_TARGETS}" # # if ! git diff --cached --quiet HEAD; then # Check staged changes against HEAD # echo "Code formatting changes applied. Committing to branch '${CI_COMMIT_BRANCH}'." # # Option 1: Commit to a NEW branch (Safer) # git checkout -B "${FORMATTED_BRANCH_NAME}" # git commit -m "ci: Apply automated code formatting [skip ci]" # git push -u origin "${FORMATTED_BRANCH_NAME}" -o ci.skip # echo "Changes pushed to new branch '${FORMATTED_BRANCH_NAME}'. Please review and merge." # else # echo "No formatting changes to commit." # fi # rules: # # Example: Only run manually on the default branch after all checks pass # - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule" # Avoid on schedules # when: manual # Make this a conscious decision # allow_failure: false # If it runs, it must succeed