doubengman2072 2019-06-21 15:37
浏览 49
已采纳

Circleci和GoBuffalo挑战

I'm currently trying to get GoBuffalo and CircleCi working, but so far without luck.

Circleci fails on the "buffalo build" step with the error message: enter image description here

My config.yaml:

version: 2
jobs:
  khw_build_and_test:
    docker:
      - image: circleci/golang:1.9
    working_directory: /go/src/github.com/khwerhahn/khw
    environment:
      TEST_RESULTS: /tmp/test-results
    steps:
      - checkout
      - run: mkdir -p $TEST_RESULTS # create the test results directory
      - run:
          name: Update PATH and Define Environment Variable at Runtime
          command: |
            echo 'export PATH=${GOPATH}/bin/:${PATH}' >> $BASH_ENV
            source $BASH_ENV
      - run: go get -v -t -d ./...
      - run: go get -u -v github.com/gobuffalo/buffalo/buffalo
      - run: buffalo build
      - restore_cache:
          keys:
            - v1-pkg-cache
      - save_cache: # Store cache in the /go/pkg directory
          key: v1-pkg-cache
          paths:
            - "/go/pkg"
  khw_deploy_to_production:
    xxxx cut out xxxx

workflows:
  version: 2
  build_test_deploy:
    jobs:
      - khw_build_and_test
      - khw_deploy_to_production:
          requires:
            - khw_build_and_test
          filters:
            branches:
              only: master

Can somebody explain this error to me?

  • 写回答

2条回答 默认 最新

  • dpzff20644 2019-07-05 23:34
    关注

    Tino, this is how I run my tests in CircleCi with buffalo, one important thing is that you can use buffalo images to build/test your code.

    This has some advantages:

    1. All buffalo dependencies are already in the buffalo image
    2. It has postgres preinstalled so I just have to start it and run tests against it.
    version: 2
    
    jobs:
      test:
        docker:
          - image: gobuffalo/buffalo:v0.14.0
        working_directory: /go/src/github.com/my/app
        steps:
          - checkout
          - run: GO111MODULE=off go get github.com/gobuffalo/buffalo-plugins
          - run: buffalo plugins install
          - run: service postgresql start && buffalo db create -e test && buffalo db migrate -e test
          - run: service postgresql start && buffalo test ./...
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化