Loading capif/templates/ci_dev.gitlab-ci.yml +24 −7 Original line number Diff line number Diff line Loading @@ -16,12 +16,6 @@ variables: .dev_common: &dev_common tags: - shell rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" when: never - if: $CI_COMMIT_BRANCH #dev_pulling_repo: # stage: dev_pulling_repo Loading @@ -37,6 +31,12 @@ dev_secrets_in_repo: cd ../ trufflehog capif --exclude_paths capif/cicd/exclusions --max_depth=5 # needs: ["dev_pulling_repo"] rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" when: never - if: $CI_COMMIT_BRANCH <<: *dev_common # define the process to do linting code: Sonarque, ruff? Loading @@ -48,6 +48,12 @@ dev_linting_code: pip install ruff ruff check --config cicd/ruff.toml . || true needs: ["dev_secrets_in_repo"] rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" when: never - if: $CI_COMMIT_BRANCH <<: *dev_common dev_linting_docker: Loading Loading @@ -114,6 +120,12 @@ dev_linting_docker: # - docker-lint.json # interruptible: true needs: ["dev_linting_code"] rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" when: never - if: $CI_COMMIT_BRANCH <<: *dev_common dev_build_and_push: Loading Loading @@ -194,5 +206,10 @@ dev_build_and_push: - docker push $CI_REGISTRY/ocf/capif/$CI_COMMIT_REF_SLUG/vault:$CI_COMMIT_REF_SLUG - echo "----------------------------------------------------" - docker logout $CI_REGISTRY rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" when: never - if: $CI_COMMIT_BRANCH <<: *dev_common capif/templates/ci_staging.gitlab-ci.yml +20 −6 Original line number Diff line number Diff line Loading @@ -21,10 +21,6 @@ variables: - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "staging" tags: - shell rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" #staging_pulling_repo: # stage: staging_pulling_repo Loading @@ -40,6 +36,10 @@ staging_secrets_in_repo: cd ../ trufflehog capif --exclude_paths capif/cicd/exclusions --max_depth=5 # needs: ["staging_pulling_repo"] rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" <<: *staging_common # define the process to do linting code: Sonarque, ruff? Loading @@ -51,6 +51,10 @@ staging_linting_code: pip install ruff ruff check --config cicd/ruff.toml . || true needs: ["staging_secrets_in_repo"] rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" <<: *staging_common staging_linting_docker: Loading Loading @@ -117,6 +121,10 @@ staging_linting_docker: # - docker-lint.json # interruptible: true needs: ["staging_linting_code"] rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" <<: *staging_common Loading @@ -133,7 +141,10 @@ staging_cvs: - docker build -t $CI_REGISTRY/ocf/capif/$CI_COMMIT_REF_SLUG/capif-client:$CI_COMMIT_REF_SLUG . - grype $CI_REGISTRY/ocf/capif/$CI_COMMIT_REF_SLUG/capif-client:$CI_COMMIT_REF_SLUG --scope all-layers - echo "----------------------------------------------------" rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" <<: *staging_common staging_build_and_push: Loading Loading @@ -214,5 +225,8 @@ staging_build_and_push: - docker push $CI_REGISTRY/ocf/capif/$CI_COMMIT_REF_SLUG/vault:$CI_COMMIT_REF_SLUG - echo "----------------------------------------------------" - docker logout $CI_REGISTRY rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" <<: *staging_common Loading
capif/templates/ci_dev.gitlab-ci.yml +24 −7 Original line number Diff line number Diff line Loading @@ -16,12 +16,6 @@ variables: .dev_common: &dev_common tags: - shell rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" when: never - if: $CI_COMMIT_BRANCH #dev_pulling_repo: # stage: dev_pulling_repo Loading @@ -37,6 +31,12 @@ dev_secrets_in_repo: cd ../ trufflehog capif --exclude_paths capif/cicd/exclusions --max_depth=5 # needs: ["dev_pulling_repo"] rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" when: never - if: $CI_COMMIT_BRANCH <<: *dev_common # define the process to do linting code: Sonarque, ruff? Loading @@ -48,6 +48,12 @@ dev_linting_code: pip install ruff ruff check --config cicd/ruff.toml . || true needs: ["dev_secrets_in_repo"] rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" when: never - if: $CI_COMMIT_BRANCH <<: *dev_common dev_linting_docker: Loading Loading @@ -114,6 +120,12 @@ dev_linting_docker: # - docker-lint.json # interruptible: true needs: ["dev_linting_code"] rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" when: never - if: $CI_COMMIT_BRANCH <<: *dev_common dev_build_and_push: Loading Loading @@ -194,5 +206,10 @@ dev_build_and_push: - docker push $CI_REGISTRY/ocf/capif/$CI_COMMIT_REF_SLUG/vault:$CI_COMMIT_REF_SLUG - echo "----------------------------------------------------" - docker logout $CI_REGISTRY rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" when: never - if: $CI_COMMIT_BRANCH <<: *dev_common
capif/templates/ci_staging.gitlab-ci.yml +20 −6 Original line number Diff line number Diff line Loading @@ -21,10 +21,6 @@ variables: - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "staging" tags: - shell rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" #staging_pulling_repo: # stage: staging_pulling_repo Loading @@ -40,6 +36,10 @@ staging_secrets_in_repo: cd ../ trufflehog capif --exclude_paths capif/cicd/exclusions --max_depth=5 # needs: ["staging_pulling_repo"] rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" <<: *staging_common # define the process to do linting code: Sonarque, ruff? Loading @@ -51,6 +51,10 @@ staging_linting_code: pip install ruff ruff check --config cicd/ruff.toml . || true needs: ["staging_secrets_in_repo"] rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" <<: *staging_common staging_linting_docker: Loading Loading @@ -117,6 +121,10 @@ staging_linting_docker: # - docker-lint.json # interruptible: true needs: ["staging_linting_code"] rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" <<: *staging_common Loading @@ -133,7 +141,10 @@ staging_cvs: - docker build -t $CI_REGISTRY/ocf/capif/$CI_COMMIT_REF_SLUG/capif-client:$CI_COMMIT_REF_SLUG . - grype $CI_REGISTRY/ocf/capif/$CI_COMMIT_REF_SLUG/capif-client:$CI_COMMIT_REF_SLUG --scope all-layers - echo "----------------------------------------------------" rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" <<: *staging_common staging_build_and_push: Loading Loading @@ -214,5 +225,8 @@ staging_build_and_push: - docker push $CI_REGISTRY/ocf/capif/$CI_COMMIT_REF_SLUG/vault:$CI_COMMIT_REF_SLUG - echo "----------------------------------------------------" - docker logout $CI_REGISTRY rules: - if: $CI_COMMIT_BRANCH == "main" when: never - if: $CI_COMMIT_BRANCH == "staging" <<: *staging_common