2017-11-28 13:38:13 +08:00
|
|
|
language: bash
|
|
|
|
sudo: required
|
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
before_install:
|
|
|
|
- openssl aes-256-cbc -K $encrypted_6cc8cff04075_key -iv $encrypted_6cc8cff04075_iv
|
|
|
|
-in .travis/id_rsa.enc -out ~/.ssh/id_rsa -d
|
|
|
|
- chmod 600 ~/.ssh/id_rsa
|
|
|
|
- export TZ='Asia/Shanghai'
|
|
|
|
- date
|
|
|
|
- git config --global user.name "khs1994"
|
|
|
|
- git config --global user.email "khs1994@khs1994.com"
|
|
|
|
script:
|
|
|
|
- docker run -it --rm -v $PWD:/srv/gitbook-src yeasy/docker_practice build
|
|
|
|
after_success:
|
|
|
|
- sudo chmod -R 777 _book
|
2018-03-19 16:04:23 +08:00
|
|
|
- echo "FROM nginx:1.13.8-alpine" >> Dockerfile
|
2018-01-23 21:34:32 +08:00
|
|
|
- echo "COPY _book /usr/share/nginx/html" >> Dockerfile
|
2018-03-30 10:04:01 +08:00
|
|
|
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
2018-01-23 21:34:32 +08:00
|
|
|
- docker build -t dockerpracticecn/docker_practice .
|
|
|
|
- docker run -dit --rm -p 4000:80 dockerpracticecn/docker_practice
|
|
|
|
- sleep 5
|
|
|
|
- curl 127.0.0.1:4000
|
|
|
|
- docker push dockerpracticecn/docker_practice
|
2017-11-28 13:38:13 +08:00
|
|
|
- cd _book
|
|
|
|
- git init
|
|
|
|
- git remote add origin "$REPO"
|
|
|
|
- git add .
|
|
|
|
- COMMIT=`date "+%F %T"`
|
|
|
|
- git commit -m "Travis CI Site updated $COMMIT"
|
|
|
|
- git push -f origin master:"$DEPLOY_BRANCH"
|
|
|
|
env:
|
|
|
|
global:
|
|
|
|
- DEPLOY_BRANCH: pages
|
|
|
|
# - DEPLOY_BRANCH: legacy-pages
|
|
|
|
- REPO: git@github.com:yeasy/docker_practice.git
|
|
|
|
addons:
|
|
|
|
ssh_known_hosts:
|
|
|
|
- github.com
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- dev
|
|
|
|
# - docker-legacy
|