stages: - testing - build - deploy # sonarqube-check: # stage: testing # variables: # SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache # GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task # cache: # key: "${CI_JOB_NAME}" # paths: # - .sonar/cache # script: # - docker run -e SONAR_TOKEN="d28d6131b6ae80c750c2f6e18667754fbef6dff0" -e SONAR_HOST_URL="https://sonar.zhigui.com" -v ~/.m2:/root/.m2 -v ${PWD}:/app maven:3.8-openjdk-16-slim bash -c "cd /app && mvn verify sonar:sonar -DskipTests=true -Dmaven.test.failure.ignore=true || true && rm -rf target" # allow_failure: true # only: # - develop # or the name of your main branch # tags: # - bj-shell build-image: stage: build only: refs: - develop # changes: # - src/**/* # - docker/**/* script: - make alldefconfig - export VERSION=dev - make build-image - make push-image tags: - bj-shell-bif deploy-dev: stage: deploy only: refs: - develop # changes: # - src/**/* dependencies: - build-image before_script: - echo "$SSH_PRIVATE_KEY" > /tmp/id_rsa - chmod 600 /tmp/id_rsa - git config --global user.email "gitlab@gitlab.com" - git config --global user.name "GitLab CI/CD" script: - GIT_SSH_COMMAND='ssh -i /tmp/id_rsa' git clone --single-branch --branch develop ${GIT_SSH_REPO} - cd els-ops && sed -i "s/gitTag:.*/gitTag:\ $CI_COMMIT_SHORT_SHA/g" els-server/values.yaml - git commit -am '[skip ci] DEV image update' - GIT_SSH_COMMAND='ssh -i /tmp/id_rsa' git push origin develop - rm -rf /tmp/id_rsa tags: - bj-shell-bif build-image-with-tag: stage: build only: refs: - tags script: - export VERSION=dev - make build-image - make push-image - make clean-image tags: - bj-shell-bif