【发布时间】:2017-08-24 20:37:46
【问题描述】:
您好,我需要一些帮助来设置我的 travis ci 部署。
我认为问题的根源是在 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 下的 travis 文件中有一些代码,但就像我不熟悉 bash 一样,我不知道如何正确引用我的 build 文件夹中的 .dmg 文件。 (build/*.dmg)
正如我所说,构建文件夹已从 git 存储库中排除。
Travis-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/stash@{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
【问题讨论】:
标签: bash electron travis-ci electron-builder