bonfy / problems

record problems I have met and solved
2 stars 1 forks source link

Problems in Travis-ci #10

Open bonfy opened 7 years ago

bonfy commented 7 years ago
  1. auto push to Github
  2. setup phantomjs in Travis-ci (purpose to use selenium)
bonfy commented 7 years ago

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

在Travis CI配置Github的Access Token

S: Build Lifecycle

install:

before_script:

- npm install -g gulp

script:

after_script:

branches: only:

bonfy commented 7 years ago

https://github.com/travis-ci/travis-ci/issues/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 commented 7 years ago
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 为啥啊