stages: - build - package - validate - publish include: - template: Security/Secret-Detection.gitlab-ci.yml - project: 'developerdurp/yml' ref: 'main' file: - 'jobs/octopus.yml' - 'jobs/version.yml' - 'jobs/sonarqube.yml' - 'jobs/golang.yml' - 'jobs/docker.yml' secret_detection: stage: compliance rules: - if: $CI_MERGE_REQUEST_IID allow_failure: false sonarqube: extends: .sonarcloud-check stage: compliance allow_failure: true rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/' || $CI_MERGE_REQUEST_IID exists: - "sonar-project.properties" golang-lint: extends: .golang-lint stage: compliance rules: - if: $CI_MERGE_REQUEST_IID exists: - "go.mod" version: extends: .version stage: .pre rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/' gobuild: variables: GOPROXY: https://nexus.durp.info/repository/go/ extends: .golang-build stage: build rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/' exists: - "go.mod" docker-build: extends: .docker_build stage: build needs: - job: gobuild artifacts: true - job: version optional: true artifacts: true rules: rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/' exists: - "Dockerfile" docker-push: extends: .docker_push_gitlab stage: publish needs: - job: gobuild artifacts: true - job: version artifacts: true rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/' exists: - "Dockerfile"