Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
deploy all the sites
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Apr 28, 2019
1 parent d3ac7f0 commit 6fefc84
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ ADD setup.R /tmp/setup.R
RUN Rscript /tmp/setup.R

ADD build.R /build.R
ADD deploy.R /deploy.R
ADD entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
5 changes: 2 additions & 3 deletions build.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ library(betty)
args <- commandArgs(TRUE)
remote <- args[1]
if(is.na(remote))
stop("No remote parameter provided")
deploy_org <- args[2]
build_site(remote, dest = "/data", deploy_org = deploy_org)
stop("No remote argument provided")
build_site(remote, dest = "/data")
4 changes: 4 additions & 0 deletions deploy.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Firt argument should be the URL
library(betty)
deploy_all_sites(doc_root = "/data/docs", deploy_org = "ropensci-docs",
site_root = 'https://docs.ropensci.org')
5 changes: 3 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/sh
Rscript /build.R "$@"
#!/bin/bash
SCRIPT="$1"
Rscript "/${SCRIPT}.R" "${@:2}"
23 changes: 14 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,32 @@ Now navigate to http://localhost in your browser. Use `docker stop` and `docker
docker stop httpd
```

The `data` volume persists after killing or restarting webserver.
The `data` volume persists after killing or restarting webserver. To manually explore the `data` volume, just mount it in any container with a shell:

```
docker run --rm -it -v data:/data busybox
```


## Building and host locally

Build packages from their git url using the `ropensci/docs` image. These may run in parallel:
Build packages from their git url using the `ropensci/docs` image with arguments `build {git_url}`. These may run in parallel:

```
docker run --rm -it -v data:/data ropensci/docs https://github.com/jeroen/openssl
docker run --rm -it -v data:/data ropensci/docs https://github.com/ropensci/magick
docker run --rm -it -v data:/data ropensci/docs https://github.com/ropensci/tesseract
docker run --rm -it -v data:/data ropensci/docs build https://github.com/jeroen/openssl
docker run --rm -it -v data:/data ropensci/docs build https://github.com/ropensci/magick
docker run --rm -it -v data:/data ropensci/docs build https://github.com/ropensci/tesseract
```

Upon success, the websites will be available in http://localhost/docs
Upon success, websites are saved to `/data` will be available in http://localhost/docs

## Deploy to Github

## Build and deploy to Github
To also deploy to Github you need to provide a `GITHUB_PAT` variable with permission to your Github org. Then run `deploy` to upload all the sites to your github org.

To also deploy to Github you need to provide a `GITHUB_PAT` variable with permission to your Github org. Then just append a asecond argument to the docker command with the organization name to deploy:

```
docker run --rm -it --env-file=env.txt -v data:/data ropensci/docs https://github.com/ropensci/magick ropensci-docs
docker run --rm -it --env-file=env.txt -v data:/data ropensci/docs deploy
```

## Cleanup
Expand Down

0 comments on commit 6fefc84

Please sign in to comment.