1
嗨,我需要一些幫助建立我的Travis ci部署。特拉維斯CI部署構建文件不在git repo
我認爲問題的根源在於github回購中我沒有我想要部署的構建文件。正如在.gitignore
文件中,我有生成我的版本的build/
文件夾。
.travis.yml
文件
osx_image: xcode8.3
sudo: required
dist: trusty
language: c
matrix:
include:
- os: osx
- os: linux
env: CC=clang CXX=clang++ npm_config_clang=1
compiler: clang
cache:
directories:
- node_modules
- "$HOME/.electron"
- "$HOME/.cache"
addons:
apt:
packages:
- libgnome-keyring-dev
- icnsutils
before_install:
- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([
"$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.1.tar.gz
| tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends
-y icnsutils graphicsmagick xz-utils; fi
install:
- nvm install 7
- curl -o- -L https://yarnpkg.com/install.sh | bash
- source ~/.bashrc
- npm install -g xvfb-maybe
- yarn
script:
- yarn run build
branches:
only:
- master
deploy:
provider: s3
access_key_id: MY_ACCESS_KEY_ID
secret_access_key:
secure: MY_SECURE_ACCESS_SECRET
bucket: MY_AWS_BUCKET
local-dir: build/*
acl: bucket_owner_full_control
on:
repo: MY_GITHUB_REPO
env:
matrix:
secure: MY_GITHUB_TOKEN
我知道我應該有before_install
下的特拉維斯文件中的一些代碼,但只是因爲我不熟悉的bash,我不知道如何正確地僅從我的build
文件夾中引用.dmg
文件。 (build/*.dmg
)
正如我所說,構建文件夾不在git倉庫中。
特拉維斯-CI錯誤日誌:
HEAD detached at ca6dfb3
Untracked files:
(use "git add <file>..." to include in what will be committed)
yarn.lock
nothing added to commit but untracked files present (use "git add" to track)
Dropped refs/[email protected]{0} (8ab81738da8330c59a8d91b0b3cef454b607dd3d)
/Users/travis/.rvm/gems/ruby-2.4.1/gems/dpl-1.8.40/lib/dpl/provider/s3.rb:47:in `chdir': No such file or directory @ dir_chdir - build/*.dmg (Errno::ENOENT)
from /Users/travis/.rvm/gems/ruby-2.4.1/gems/dpl-1.8.40/lib/dpl/provider/s3.rb:47:in `push_app'
from /Users/travis/.rvm/gems/ruby-2.4.1/gems/dpl-1.8.40/lib/dpl/provider.rb:154:in `block in deploy'
from /Users/travis/.rvm/gems/ruby-2.4.1/gems/dpl-1.8.40/lib/dpl/cli.rb:41:in `fold'
from /Users/travis/.rvm/gems/ruby-2.4.1/gems/dpl-1.8.40/lib/dpl/provider.rb:154:in `deploy'
from /Users/travis/.rvm/gems/ruby-2.4.1/gems/dpl-1.8.40/lib/dpl/provider/s3.rb:75:in `deploy'
from /Users/travis/.rvm/gems/ruby-2.4.1/gems/dpl-1.8.40/lib/dpl/cli.rb:32:in `run'
from /Users/travis/.rvm/gems/ruby-2.4.1/gems/dpl-1.8.40/lib/dpl/cli.rb:7:in `run'
from /Users/travis/.rvm/gems/ruby-2.4.1/gems/dpl-1.8.40/bin/dpl:5:in `<top (required)>'
from /Users/travis/.rvm/gems/ruby-2.4.1/bin/dpl:23:in `load'
from /Users/travis/.rvm/gems/ruby-2.4.1/bin/dpl:23:in `<main>'
failed to deploy
/Users/travis/.travis/job_stages: line 878: shell_session_update: command not found
這工作!但是,在指向特定文件擴展名build/*。dmg之後,它仍然會中斷。任何想法呢? – desicne
'local_dir'顯然需要一個目錄名稱,而不是一個glob模式。在'before_deploy'中,要麼:a)你想要創建一個目錄,移動'build/*。dmg'文件(並相應地調整'local_dir'的值);或者b)刪除'build'中與模式不匹配的每個文件。 – banzaiman