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

docker

parent 85d88c02
Loading
Loading
Loading
Loading
+24 −3
Original line number Diff line number Diff line
@@ -9,6 +9,11 @@ stages:
  - staging_secrets_in_repo
  - staging_linting_code
  - staging_linting_docker
  - dev_pulling_repo
  - dev_secrets_in_repo
  - dev_linting_code
  - dev_linting_docker


variables:
  GITLAB_API: "https://labs.etsi.org/api/v4"
@@ -52,7 +57,22 @@ dev_cancel_previous_action:
  stage: dev_cancel_previous_action
  script:
   - >
     echo "dev_cancel_previous_action job"
     echo "### cancel previous actions in dev branchc ###"
     if [[ -n "$CI_JOB_TOKEN" ]]; then
       echo "Checking for running jobs in the same pipeline..."
       jobs=$(curl --header "PRIVATE-TOKEN: $CI_JOB_TOKEN" "$GITLAB_API/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID/jobs")
       for job in $(echo "$jobs" | jq -r '.[] | @base64'); do
         _jq() {
           echo ${job} | base64 --decode | jq -r ${1}
         }
         status=$(_jq '.status')
         id=$(_jq '.id')
         if [[ "$status" == "running" ]] && [[ "$id" != "$CI_JOB_ID" ]]; then
           echo "Cancelling job $id"
           curl --request POST --header "PRIVATE-TOKEN: $CI_JOB_TOKEN" "$GITLAB_API/projects/$CI_PROJECT_ID/jobs/$id/cancel"
         fi
       done
     fi
  rules:
    - if: $CI_COMMIT_BRANCH
  <<: *dev_common
@@ -60,8 +80,9 @@ dev_cancel_previous_action:
include:
 - project: 'ocf/pipeline-scripts'
   ref: cicd-capif
   file: '/capif/templates/ci_staging.gitlab-ci.yml'
# - 'capif/templates/ci_dev.gitlab-ci.yml'
   file: 
#   - '/capif/templates/ci_staging.gitlab-ci.yml'
   - 'capif/templates/ci_dev.gitlab-ci.yml'
# - 'capif/templates/cd-deploy-ocf.gitlab-ci.yml'


+7 −1
Original line number Diff line number Diff line
@@ -51,3 +51,9 @@ dev_linting_docker:
  interruptible: true    
  needs: ["dev_linting_code"]
  <<: *dev_common

docker_login:
  stage: docker_login
  script:
   - >
    docker --version
 No newline at end of file