Как использовать git lfs в AWS CodeBuild? - PullRequest
1 голос
/ 18 июня 2020

Поскольку AWS CodeBuild, похоже, не поддерживает git LFS (Large File System), я попытался установить его:

version: 0.2

phases:
  install:
    commands:
      - apt-get install -y bash curl
      - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
      - apt-get install -y git-lfs
  pre_build:
    commands:
      - echo Downloading LFS files
      - git lfs pull
  build:
    commands:
      - echo Build started on `date`
  post_build:
    commands:
      - echo Build completed on `date`

Для приведенного выше кода я получаю следующую ошибку ( переименованный адрес репо):

[Container] 2020/06/18 16:02:17 Running command git lfs pull
fatal: could not read Password for 'https://username@bitbucket.org': No such device or address
batch response: Git credentials for https://username@bitbucket.org/company/repo.git not found.
error: failed to fetch some objects from 'https://username@bitbucket.org/company/repo.git/info/lfs'

[Container] 2020/06/18 16:02:17 Command did not exit successfully git lfs pull exit status 2
[Container] 2020/06/18 16:02:17 Phase complete: PRE_BUILD State: FAILED
[Container] 2020/06/18 16:02:17 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: git lfs pull. Reason: exit status 2

Могу ли я сделать что-нибудь еще для получения файлов LFS?

1 Ответ

0 голосов
/ 19 июня 2020

CodeBuild изначально не поддерживает git LFS. Обходной путь - настроить Git LFS 1 и клонировать репозиторий 2 как часть выполнения buildspe c .yml.

Use 'git -credential-helper: yes 'в buildspe c для CodeBuild, чтобы предоставить учетные данные для git команд 3 .

...