2017-10-17 5 views
1

CircleCI 2.0の設定中ですが、ubuntuパッケージ 'pdf2htmlex'を含める必要がありますが、次のエラーが発生しています:ここでCircleCI 2.0、 "Permission denied"でapt-getが失敗する

apt-get update && apt-get install -y pdf2htmlex 
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) 
E: Unable to lock directory /var/lib/apt/lists/ 
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) 
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? 
Exited with code 100 

.circle/config.ymlの関連する部分である:

version: 2 
jobs: 
    build: 
    docker: 
     # specify the version you desire here 
     - image: circleci/node:7.10 
     - image: circleci/postgres:9.6.2 

     # 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/mongo:3.4.4 

    working_directory: ~/repo 

    steps: 
     - checkout 
     - run: 
      name: Install System Dependencies 
      command: apt-get update && apt-get install -y pdf2htmlex  
     - run: 
      name: save SHA to a file 
      command: echo $CIRCLE_SHA1 > .circle-sha 
     - restore_cache: 
      key: dependency-cache-{{ checksum "package.json" }} 
     - run: 
      name: Install dependencies via npm 
      command: npm install 
     - run: 
      name: Run tests 
      command: npm run test 
     - run: scripts/build.sh 
     - save_cache: 
      key: dependency-cache-{{ checksum "package.json" }} 
      paths: 
      - node_modules 
     - save_cache: 
      key: v1-repo-{{ checksum ".circle-sha" }} 
      paths: 
      - ~/repo 

誰もが、これは私たちの統合テストの一部が失敗する原因とされているので、これを回避する方法を提案することはできますか?

答えて

2

あなたはラインをインストールapt-getsudoを追加することができる必要があります:私はそれは私が得る時間で行方不明見つけるおりますので、ワークフローの各フェーズのために取得するのapt-

version: 2 
jobs: 
    build: 
    docker: 
     # specify the version you desire here 
     - image: circleci/node:7.10 
     - image: circleci/postgres:9.6.2 

     # 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/mongo:3.4.4 

    working_directory: ~/repo 

    steps: 
     - checkout 
     - run: 
      name: Install System Dependencies 
      command: sudo apt-get update && sudo apt-get install -y pdf2htmlex  
     - run: 
      name: save SHA to a file 
      command: echo $CIRCLE_SHA1 > .circle-sha 
     - restore_cache: 
      key: dependency-cache-{{ checksum "package.json" }} 
     - run: 
      name: Install dependencies via npm 
      command: npm install 
     - run: 
      name: Run tests 
      command: npm run test 
     - run: scripts/build.sh 
     - save_cache: 
      key: dependency-cache-{{ checksum "package.json" }} 
      paths: 
      - node_modules 
     - save_cache: 
      key: v1-repo-{{ checksum ".circle-sha" }} 
      paths: 
      - ~/repo 
+0

はところで私がする必要があります。テストフェーズ –

+0

キャッシュを保存することで、毎回apt-getをインストールする必要はありません。ありがとう。 – hqt

関連する問題