首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何正确设置CircleCI插件

如何正确设置CircleCI插件
EN

Stack Overflow用户
提问于 2019-04-24 15:24:45
回答 1查看 687关注 0票数 0

我正在尝试将CircleCI插件集成到我的春季宠物诊所项目中。我是按照CircleCI网页上的说明操作的。我已经在我的项目根文件夹中创建了.circleci文件夹。

.circleci中,我添加了config.yml文件和从CircleCI页面复制粘贴的配置

我的配置是这样的:

代码语言:javascript
复制
# Use the latest 2.1 version of CircleCI pipeline processing engine, 
see https://circleci.com/docs/2.0/configuration-reference/
version: 2.1

# Use a package of configuration called an orb, see 
https://circleci.com/docs/2.0/orb-intro/
orbs:
  # Declare a dependency on the welcome-orb
  welcome: circleci/welcome-orb@0.3.1

# Orchestrate or schedule a set of jobs, see 
https://circleci.com/docs/2.0/workflows/
workflows:
  # Name the workflow "Welcome"
  Welcome:
    # Run the welcome/run job in its own container
    jobs:
      - welcome/run

在我运行项目之后,CircleCI抛出了一个错误。尤其是这个:"Config Processing Error: Don rerun“

代码语言:javascript
复制
 $#!/bin/sh -eo pipefail
        # No configuration was found in your project. Please refer to 
        https://circleci.com/docs/2.0/ to get started with your 
        configuration.
        # 
        # -------
        # Warning: This configuration was auto-generated to show you 
        the 
        message above.
        # Don't rerun this job. Rerunning will have no effect.
        false
        Exited with code 1

Spin Up Environment看起来像这样

代码语言:javascript
复制
        Build-agent version 1.0.10572-3ce00c85 (2019-04- 
        15T22:09:28+0000)
        Docker Engine Version: 17.05.0-ce
        Kernel Version: Linux b0a81c56acff 4.4.0-144-generic 
        #170~14.04.1- 
        Ubuntu SMP Mon Mar 18 15:02:05 UTC 2019 x86_64 Linux
        Starting container bash:4.4.19
          using image 
 bash@sha256:9f0a4aa3c9931bd5fdda51b1b2b74a0398a8eabeaf9519d807e010b9d9d41993

        Using build environment variables
          BASH_ENV=/tmp/.bash_env-5cbebf83d4b030000849b60f-0-build
          CI=true
          CIRCLECI=true
          CIRCLE_BRANCH=master
          CIRCLE_BUILD_NUM=5
          CIRCLE_BUILD_URL=https://circleci.com/gh/sajmon2325/Spring- 
          Pet- 
          Clinic/5
          CIRCLE_COMPARE_URL=
          CIRCLE_JOB=Build Error
          CIRCLE_NODE_INDEX=0
          CIRCLE_NODE_TOTAL=1
          CIRCLE_PREVIOUS_BUILD_NUM=4
          CIRCLE_PROJECT_REPONAME=Spring-Pet-Clinic
          CIRCLE_PROJECT_USERNAME=sajmon2325
          CIRCLE_REPOSITORY_URL=git@github.com:sajmon2325/Spring-Pet- 
          Clinic.git
          CIRCLE_SHA1=48f6db114b41c338e606de32d8648c64ba5119fd
          CIRCLE_SHELL_ENV=/tmp/.bash_env-5cbebf83d4b030000849b60f-0- 
              build
          CIRCLE_STAGE=Build Error
          CIRCLE_USERNAME=sajmon2325
          CIRCLE_WORKFLOW_ID=2789d93e-f1e4-4c81-93f1-846f7d38c107
          CIRCLE_WORKFLOW_JOB_ID=670105ca-617e-445e-9b5e-6ac57f6af8da
          CIRCLE_WORKFLOW_UPSTREAM_JOB_IDS=
          CIRCLE_WORKFLOW_WORKSPACE_ID=2789d93e-f1e4-4c81-93f1- 
          846f7d38c107
          CIRCLE_WORKING_DIRECTORY=~/project

          Using environment variables from project settings and/or 
          contexts
          CIRCLE_JOB=**REDACTED**

所以一开始我认为我只有一个CircleCI配置的框架,这就是为什么我编辑我的config.yml文件如下所示(实际的版本)

代码语言:javascript
复制
 # Java Maven CircleCI 2.0 configuration file
    #
    # Check https://circleci.com/docs/2.0/language-java/ for more details
    #
    version: 2
    jobs:
        build:
            docker:
            # specify the version you desire here
            - image: circleci/openjdk:11-browsers-legacy

            # Specify service dependencies here if necessary
            # CircleCI maintains a library of pre-built images
            # documented at https://circleci.com/docs/2.0/circleci-images/
            # - image: circleci/postgres:9.4

            working_directory: ~/repo

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

            steps:
            - checkout

            # Download and cache dependencies
            - restore_cache:
                  keys:
                  - v1-dependencies-{{ checksum "pom.xml" }}
                  # fallback to using the latest cache if no exact match 
                is 
            found
                  - v1-dependencies-

            - run: mvn install -DskipTests

            - run: mvn dependency:go-offline

            - save_cache:
                  paths:
                  - ~/.m2
                  key: v1-dependencies-{{ checksum "pom.xml" }}

            # run tests!
            - run: mvn integration-test

但即使这样也行不通。我仍然有相同的错误:

代码语言:javascript
复制
$#!/bin/sh -eo pipefail
# No configuration was found in your project. Please refer to https://circleci.com/docs/2.0/ to get started with your configuration.
# 
# -------
# Warning: This configuration was auto-generated to show you the message above.
# Don't rerun this job. Rerunning will have no effect.
false
Exited with code 1

我只需要成功地集成CircleCi插件与我的项目。如果您需要查看我的存储库,请访问以下链接:https://github.com/sajmon2325/Spring-Pet-Clinic.git

EN

回答 1

Stack Overflow用户

发布于 2019-04-28 19:36:33

问题是.circleci不在存储库的根目录中。它目前在sfg-pet-clinic/中,CircleCI构建过程不会在那里找到它。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55824496

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档