Commit f21a5e39 authored by Andres Anaya Amariels's avatar Andres Anaya Amariels 🚀
Browse files

rules

parent 12b457c8
Loading
Loading
Loading
Loading
+24 −7
Original line number Diff line number Diff line
@@ -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
@@ -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?
@@ -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:
@@ -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:
@@ -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
+20 −6
Original line number Diff line number Diff line
@@ -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
@@ -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?
@@ -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:
@@ -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


@@ -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:
@@ -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