Как правильно настроить плагин CircleCI - PullRequest
0 голосов
/ 24 апреля 2019

Я пытаюсь интегрировать плагин CircleCI с моим проектом spring-pet-clinic. Я следовал инструкции на веб-странице CircleCI. Я создал папку .circleci в корневой папке моего проекта.

Внутри .circleci Я добавил файл config.yml и скопированную конфигурацию со страницы CircleCI

Мой конфиг был такой:

# 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 выдал ошибку. Особенно этот: «Ошибка обработки конфигурации: не перезапускать»

 $#!/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

Среда раскрутки выглядит следующим образом

        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 так, чтобы он выглядел так (актуальная версия)

 # 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

Но даже это не работает. У меня все та же ошибка:

$#!/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

1 Ответ

0 голосов
/ 28 апреля 2019

Проблема в том, что .circleci не находится в корне хранилища.В настоящее время он находится в sfg-pet-clinic/, и процесс сборки CircleCI не найдет его там.

...