Skip to content

Commit

Permalink
travis deploy to GitHub release on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Mar 16, 2019
1 parent 8a16781 commit 486a755
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 6 deletions.
38 changes: 32 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ dist: xenial
services:
- docker

env:
- WKHTMLTOPDF_VERSION=0.12.1.3
- WKHTMLTOPDF_VERSION=0.12.5
stages:
- name: test
- name: deploy
if: tag IS present

before_install:
install:
- pip install tox-travis
# overwrite default imagemagick policy that prevents reading PDF
- sudo cp tests/travis-imagemagick-policy.xml /etc/ImageMagick-6/policy.xml
- sudo apt-get -y install -f ghostscript
# install wkhtmltopdf for native test
- wget -q -O /tmp/wkhtmltox.deb https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.xenial_amd64.deb
- sudo apt -y install -f /tmp/wkhtmltox.deb

install:
# build and start server image
- docker build -f Dockerfile-${WKHTMLTOPDF_VERSION} -t kwkhtmltopdf:${WKHTMLTOPDF_VERSION} .
- docker run -d --name kwkhtmltopdf -p 8080:8080 kwkhtmltopdf:${WKHTMLTOPDF_VERSION}
- export KWKHTMLTOPDF_SERVER_URL=http://localhost:8080
Expand All @@ -31,3 +31,29 @@ script:
after_script:
- docker logs kwkhtmltopdf
- docker stop kwkhtmltopdf

jobs:
include:
- stage: test
env:
- WKHTMLTOPDF_VERSION=0.12.1.3
- stage: test
env:
- WKHTMLTOPDF_VERSION=0.12.5
- stage: deploy
install:
- go build client/go/kwkhtmltopdf_client.go
- sha1sum kwkhtmltopdf_client > SHA1SUMS
script: skip
after_script: skip
deploy:
provider: releases
api_key:
secure: H8OMvqw40jEffhfNTKtNM2eI6X6Jv/FiXdMotImCIPScSjTw6s7oRIiE3zBdJLg6o+5MTkZI6ihLXVZaEstFC99fx7VRVTb/n6JMS96kDqqdqjmAuHtG2ovN6gR65l1TPbeAinOrk4B5kPBLqOjQGLnrVF6pE12dScExCVF9ckXUTnwkDhpReTK2e0m0KEQBLcGeGEFYSIEkMFqWfl3WealLBnSgYFpU0bphYy44uNVWdHtqKpF9hMRuPq3FM+H7eKZhNF34Q+XzULZd7WfU8DeQ0ZtVTlCK3djqLI2kMm/QULjLGAQVRiG8F0xlQ5T7iIaS+VK5WTg8v6zXEFVEbxkWv5oCJuS8tUy3iCyQ9lhgY173fyOhnwGBYzQFP2M82T9o2UiSu5JzxMWHYKResHO3c1nLQ27eP5hnSQxJe0DHvBBKD5H3/lpxfET0/JszXvNMezWmOA7QaQBFQdDwGPftQm4AZlv5eh7Wgr5SZFbhqc+UGGg4rl5WXOBJ+/XruKUSMVFh3wJNitXEvtEKSqb8MjiPqJi5ApKsrIt6CuLnhLWFXIDDMGj3oznRvKyLA2SPWk3Xcpny6zt2uZ6XpeiJqOQhiete5udEjfPZ27rGHra8JEj4ARCUJXEDo1iAJPFbJXLxjCw08BFAik19mUiK3VhUZZ5j36wtQaggzB4=
skip_cleanup: true
file:
- kwkhtmltopdf_client
- SHA1SUMS
on:
repo: acsone/kwkhtmltopdf
tags: true
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 0.9.0 (2019-03-16)

First release.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ Several attack vectors exist (local file access being the most obvious).
Mitigating them is not a priority, since the main use case is
to use it as a private service.

# Releasing

Push the master branch and ensure tests pass on travis.

Create and push a git tag.

Travis will build and deploy the client as a GitHub release.

Docker Hub will build the images.

# Credits

Author: [email protected].
Expand Down

0 comments on commit 486a755

Please sign in to comment.