diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c462780..872070c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,9 @@ stages: - validate - - sonar - test - - build variables: DENO_VERSION: "2.6.4" - DOCKER_IMAGE_NAME: "$CI_REGISTRY/deeplite" PORT: "8000" # Global template for Deno jobs @@ -45,40 +42,6 @@ type:check: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - if: "$CI_COMMIT_BRANCH" -# ===== SONARQUBE STAGE ===== - -sonarqube:scan: - stage: sonar - image: - name: sonarsource/sonar-scanner-cli:latest - entrypoint: [""] - variables: - SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" - GIT_DEPTH: "0" - cache: - key: "${CI_JOB_NAME}" - paths: - - .sonar/cache - script: - - | - sonar-scanner \ - -Dsonar.host.url="${SONAR_HOST}" \ - -Dsonar.token="${SONAR_TOKEN}" \ - -Dsonar.projectKey="${CI_PROJECT_PATH_SLUG}" \ - -Dsonar.projectName="${CI_PROJECT_NAME}" \ - -Dsonar.projectVersion="${CI_COMMIT_SHORT_SHA}" \ - -Dsonar.sources=src \ - -Dsonar.sourceEncoding=UTF-8 \ - -Dsonar.language=ts \ - -Dsonar.exclusions="**/*.test.ts,**/test/**" \ - -Dsonar.tests=src \ - -Dsonar.test.inclusions="**/*.test.ts" - allow_failure: true - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - - if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH" - dependencies: [] - # ===== TEST STAGE ===== integration:test: @@ -129,42 +92,3 @@ integration:test: when: - runner_system_failure - stuck_or_timeout_failure - -# ===== BUILD & PUSH STAGE (Tags only) ===== - -docker:build-push: - stage: build - image: docker:29-dind - services: - - docker:29-dind - variables: - DOCKER_TLS_CERTDIR: "/certs" - before_script: - - docker info - - echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY" - script: - - export VERSION=${CI_COMMIT_TAG#v} - - echo "Building and pushing Docker image version $VERSION" - - - | - docker build \ - --build-arg DENO_VERSION=${DENO_VERSION} \ - --tag ${DOCKER_IMAGE_NAME}:${VERSION} \ - --tag ${DOCKER_IMAGE_NAME}:${CI_COMMIT_SHA} \ - --tag ${DOCKER_IMAGE_NAME}:latest \ - . - - - docker push ${DOCKER_IMAGE_NAME}:${VERSION} - - docker push ${DOCKER_IMAGE_NAME}:${CI_COMMIT_SHA} - - docker push ${DOCKER_IMAGE_NAME}:latest - - - echo "Successfully pushed:" - - echo " - ${DOCKER_IMAGE_NAME}:${VERSION}" - - echo " - ${DOCKER_IMAGE_NAME}:${CI_COMMIT_SHA}" - - echo " - ${DOCKER_IMAGE_NAME}:latest" - rules: - - if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/' - retry: - max: 2 - when: - - runner_system_failure