Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems in Travis-ci #10

Open
bonfy opened this issue Apr 20, 2017 · 3 comments
Open

Problems in Travis-ci #10

bonfy opened this issue Apr 20, 2017 · 3 comments
Labels

Comments

@bonfy
Copy link
Owner

bonfy commented Apr 20, 2017

  1. auto push to Github
  2. setup phantomjs in Travis-ci (purpose to use selenium)
@bonfy
Copy link
Owner Author

bonfy commented Apr 20, 2017

http://blog.csdn.net/woblog/article/details/51319364

在Travis CI配置Github的Access Token

  • 在github上生成Access Token
    先我们来到github的设置界面,点击到Personal access tokens页面,点击右上角的Generate new token按钮会重新生成一个,点击后他会叫你输入密码,然后来到如下界面,给他去一个名字,下面是勾选一些权限
  • 在Travis CI配置
    配置界面还是在项目的setting里面
  • .travis.yml 中配置
language: node_js
node_js: stable

# S: Build Lifecycle
install:
  - npm install


#before_script:
 # - npm install -g gulp

script:
  - hexo g

after_script:
  - cd ./public
  - git init
  - git config user.name "lifengsofts"
  - git config user.email "lifengsofts@gmail.com"
  - git add .
  - git commit -m "Update docs"
  - git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:master
# E: Build LifeCycle

branches:
  only:
    - blog-source
env:
 global:
   - GH_REF: github.com/lifengsofts/lifengsofts.github.io.git

@bonfy
Copy link
Owner Author

bonfy commented Apr 25, 2017

travis-ci/travis-ci#3225

sudo: false

cache:
  directories:
    - "travis_phantomjs"

before_install:
  # Ensure we have newer version of PhantomJS to fix weird test failures from 1.9.8
  - export TRAVIS_PHANTOMJS_INSTALL_PATH="$PWD/travis_phantomjs"
  - export TRAVIS_PHANTOMJS_VERSION_NAME="phantomjs-2.1.1-linux-x86_64"
  - export PATH="$TRAVIS_PHANTOMJS_INSTALL_PATH/$TRAVIS_PHANTOMJS_VERSION_NAME/bin:$PATH"
  - hash -d phantomjs || true
  - echo "phantomjs version is $(phantomjs --version)"
  - if [ $(phantomjs --version) != '2.1.1' ]; then $PWD/bin/travis_get_updated_phantomjs; hash -d phantomjs || true; echo "updated phantomjs version is $(phantomjs --version)"; fi

@bonfy
Copy link
Owner Author

bonfy commented Apr 26, 2017

language: python
python:
  - "3.5"

before_install:
  - phantomjs --version # 输出 phantomjs 版本

# command to install dependencies
install:
  - pip install -r req.txt

before_script:
  - ls

script:
  - python3 leetcode_generate.py

after_script:
  - git init
  - git config user.name "bonfy"  #修改name
  - git config user.email "foreverbonfy@163.com"  #修改email
  - git add .
  - git commit -m "update auto by tracis-ci"
  - git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:master  #GH_TOKEN是在Travis中配置token的名称

env:
 global:
- GH_REF: github.com/bonfy/leetcode

额,结果不知道为何 总是读不到 配置信息

报了 raise Exception: username and password is None 为啥啊

@bonfy bonfy added the question label Apr 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant