docker_practice/.travis.yml

54 lines
1.2 KiB
Go
Raw Normal View History

language: bash
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
2019-08-31 09:47:38 +00:00
- echo "FROM nginx:alpine" >> Dockerfile
- echo "COPY _book /usr/share/nginx/html" >> Dockerfile
2019-08-31 09:47:38 +00:00
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
2019-08-31 09:47:38 +00:00
2019-09-01 11:58:45 +00:00
- docker build -t dockerpracticesig/docker_practice:us-en .
- docker run -dit --rm -p 4000:80 dockerpracticesig/docker_practice:us-en
2019-08-31 09:47:38 +00:00
- sleep 5
- curl 127.0.0.1:4000
2019-08-31 09:47:38 +00:00
2019-09-01 11:58:45 +00:00
- docker push dockerpracticesig/docker_practice:us-en
2019-08-31 09:47:38 +00:00
- cd _book
- git init
2019-09-05 05:06:29 +00:00
- git remote add origin "$DEPLOY_REPO"
- git add .
- COMMIT=`date "+%F %T"`
- git commit -m "Travis CI Site updated $COMMIT"
- git push -f origin master:"$DEPLOY_BRANCH"
env:
global:
2019-09-05 05:06:29 +00:00
- DEPLOY_BRANCH: master
- DEPLOY_REPO: git@github.com:docker-practice/us-en.git
addons:
ssh_known_hosts:
- github.com
branches:
only:
2019-05-13 15:06:39 +00:00
- english