【问题标题】:How to rewrite this gitlab yml file to docker file如何将此 gitlab yml 文件重写为 docker 文件
【发布时间】:2019-12-19 03:09:36
【问题描述】:

我需要你的帮助在 docker 文件中执行下面的 gitlab yaml 文件,基本上我想把这个 gitlab yaml 文件的内容作为一个 docker 容器并在 kubernetes 中执行。这里是 gitlab yaml 文件

 stages:
   - auto-test-pre-stage
   - auto-test-stage
   - test

  variables:
   BUCKET_NAME: junitreports/CompanionAppSimulator
   AWS_DEFAULT_REGION: us-east-2

  test:
   image: python:latest
   stage: test
   tags:
     - docker
   before_script:
     - pip install awscli
   script:
     - echo 'this is the script 2'
     - cd /builds/core-systems/find/test/Companion/report/
     - ls -l
     - aws s3 cp . s3://${BUCKET_NAME}/${CI_COMMIT_REF_SLUG}/-$(date +"%m-%d-%y-%T") --recursive
   environment:
   name: ${CI_COMMIT_REF_SLUG}
   url: http://${BUCKET_NAME}.s3-website.${AWS_DEFAULT_REGION}.amazonaws.com/${CI_COMMIT_REF_SLUG}
  only:
    - branches
  except:
    - master


   .auto_test_template: &auto_test_definition  # template for deploy jobs
    image: katalonstudio/katalon
    stage: auto-test-pre-stage
   tags:
     - docker
   script:
     - cd test/CompanionAppSimulator
     - katalon-execute.sh -retry=0 -statusDelay=15 -testSuitePath="Test Suites/AppSimulator"   
     artifacts:
      name: "Test Reports"
      paths:
        - /builds/core-systems/finders-keepers/test/CompanionAppSimulator/report/
     reports:
         junit:
        - '/builds/core-systems/finders-keepers/test/CompanionAppSimulator/report/*.xml'

     auto_test_feature:
     <<: *auto_test_definition
  tags:
    - docker
  only:
    - branches
      except:
       - master
       - develop

    auto_test_develop:
          <<: *auto_test_definition
      tags:
        - docker
      only:
        - develop

    auto_test_stage:
      <<: *auto_test_definition
      stage: auto-test-stage
       tags:
        - docker
      only:
        - master
      when: manual  

使上述文件内容作为docker容器执行的任何其他替代方法..有没有其他方法可以实现这种情况

【问题讨论】:

    标签: docker gitlab dockerfile gitlab-ci-runner


    【解决方案1】:

    你不能在 kubernetes 集群上运行 gitlab-ci 文件,如果你想将此文件用于 CI 目的,该文件是特定于 gitlab 的。

    附:通过在 Kubernetes 集群上运行 yaml 文件想要实现什么? 编辑:我知道您希望自己的图像在不使用 Gitlab 的情况下处理 CI 部分。

    【讨论】:

    • 您可以编写自己的代码来使用任何语言实现 CI,然后您可以将其 dockerize。
    猜你喜欢
    • 2012-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-13
    相关资源
    最近更新 更多