CircleCI:找不到名为ubuntu的执行程序的定义吗? [英] CircleCI: Cannot find a definition for executor named ubuntu?

本文介绍了CircleCI:找不到名为ubuntu的执行程序的定义吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试扩展已经使用的球体.我们以前使用过Docker,但现在希望将来使用 machine 执行器,也许将来使用 windows 执行器.我仔细阅读了文档,但是尚不清楚是否可以有不同类型的执行程序并在相同的工作上调用它们.

I am trying to extend the orb that is already in use. We have used Docker before but now want to use a machine executor and maybe a windows executor in the future. I go through the documentation, but it is not clear if it is possible to have executors of different types and call them on the same jobs.

CircleCI是否可以在同一球体中包含不同类型的执行程序?

Is it possible to have executors of different types in the same orb in CircleCI?

我尝试创建执行程序 ubuntu.yml :

description: >
  The executor to run testcontainers without extra setup in Circle CI builds.

parameters:
  # https://circleci.com/docs/2.0/configuration-reference/#resource_class
  resource-class:
    type: enum
    default: medium
    enum: [medium, large, xlarge, 2xlarge]

  tag:
    type: string
    default: ubuntu-2004:202010-01

resource_class: <<parameters.resource-class>>

machine:
  image: <<parameters.tag>>

另一位执行者 openjdk.yml :

description: >
  The default executor for our OpenJDK + Maven-based builds.

parameters:
  # https://circleci.com/docs/2.0/configuration-reference/#resource_class
  resource-class:
    type: enum
    default: medium
    enum: [small, medium, medium+, large, xlarge]

  tag:
    type: string
    default: 11.0-jdk-stretch

resource_class: <<parameters.resource-class>>

docker:
  - image: circleci/openjdk:<<parameters.tag>>

我的工作开始是

parameters:
  executor:
    type: executor
    default: openjdk
  resource-class:
    type: enum
    default: medium
    enum: [small, medium, medium+, large, xlarge]

executor: << parameters.executor >>
resource_class: << parameters.resource-class >>

environment:
  # Customize the JVM maximum heap limit
  MAVEN_OPTS: -Xmx3200m

如何引用我的 ubuntu 执行器,以便其他球体可以看到它?

How can I reference my ubuntu executor so that it can be visible by other orbs?

推荐答案

Circle CI中有3种类型的执行程序调用:

There 3 types of executors invocation in Circle CI:

  • 调用CircleCI预定义图像,例如 ruby​​ openjdk .
  • 从同一配置文件/球形调用执行程序,例如 my-openjdk my-executor .

例如,

executors:
  my-executor:
    machine: true
  my-openjdk:
    docker:
      - image: openjdk:11

  • 从现有球体(例如< orb-name>//< executor-name> )调用执行者.
    • Invoke executors from the existing orbs such as <orb-name>/<executor-name>.
    • 在我的情况下,这是第三个选项, my-orb/ubuntu .

      In my case, it was the 3rd option, my-orb/ubuntu.

      这篇关于CircleCI:找不到名为ubuntu的执行程序的定义吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆