From b21a341332e9e26e6e8c7a05b45d11ba20d99aa7 Mon Sep 17 00:00:00 2001 From: Nisar Hassan Naqvi Date: Wed, 6 Nov 2019 04:12:19 +0000 Subject: [PATCH] Simplifies code contributions by automating the dev setup with gitpod.io --- .gitpod.Dockerfile | 7 +++++++ .gitpod.yml | 13 +++++++++++++ README.md | 6 ++++++ 3 files changed, 26 insertions(+) create mode 100644 .gitpod.Dockerfile create mode 100644 .gitpod.yml diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 000000000..43355323f --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,7 @@ +FROM gitpod/workspace-full-vnc + +USER gitpod + +RUN sudo apt-get update && \ + sudo apt-get install -yq firefox && \ + sudo rm -rf /var/lib/apt/lists/* diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 000000000..648e81e3f --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,13 @@ +image: + file: .gitpod.Dockerfile +tasks: + - command: | + gp await-port 8888 && gp preview $(gp url 8888)/web/viewer.html && echo '[{"name": "Firefox","path": "/usr/bin/firefox"}]' | jq '.' > test/resources/browser_manifests/browser_manifest.json + + - init: npm install -g gulp-cli && npm install + command: gulp server +ports: + - port: 8888 + onOpen: ignore + - port: 6080 + onOpen: ignore diff --git a/README.md b/README.md index 38f8b4149..ee976fcc9 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,12 @@ It is also possible to view all test PDF files on the right side by opening: + http://localhost:8888/test/pdfs/?frame +## Online setup with a single click + +It's recommended to follow [Getting the Code] above, however you can also use [Gitpod](https://gitpod.io) (a free online VS Code like IDE). With a single click it will launch a ready to use workspace, with all the dependencies pre-installed and the web server running, so that you can start coding straight away. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/mozilla/pdf.js) + ## Building PDF.js In order to bundle all `src/` files into two production scripts and build the generic