Skip to content

Commit d831cec

Browse files
committed
build: create an gitpod.io configuration
1 parent 8900c33 commit d831cec

File tree

4 files changed

+46
-4
lines changed

4 files changed

+46
-4
lines changed

.gitpod.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
image:
2+
file: ./devops/gitpod.dockerfile
3+
tasks:
4+
- init: npm install && RScript -e "blogdown::install_hugo()"
5+
- command: "echo 'run: \"npm start\" or \"npm run start:blog\"'"
6+
ports:
7+
- port: 1313
8+
vscode:
9+
extensions:
10+
- [email protected]:SrD06skfmg05hLAerl2aKQ==

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Delphi Website
22

3+
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/cmu-delpih/www-main)
4+
5+
36
Delphi's homepage at https://cmu-delphi-main.netlify.app/
47

58
This site is based on [Hugo](https://gohugo.io) and uses [Prettier](https://prettier.io) for formatting.
@@ -38,9 +41,9 @@ In RMarkdown things are slightly more different since the R Markdown parser is u
3841
**Examples**
3942

4043
```
41-
[Facebook](`r blogdown::shortcode_html("ref", "2020-08-26-fb-survey")`)
42-
[previous exploratory investigations](`r blogdown::shortcode_html("ref", "2020-08-26-fb-survey#some-interesting-examples")`)
43-
[public API](`r blogdown::shortcode_html("apiref", "api/covidcast.html")`)
44+
`r blogdown::shortcode_html("reflink", "2020-08-26-fb-survey", "Facebook")`
45+
`r blogdown::shortcode_html("reflink", "2020-08-26-fb-survey#some-interesting-examples", "previous exploratory investigations")`
46+
`r blogdown::shortcode_html("apireflink", "api/covidcast.html", "public API")`
4447
4548
```
4649

@@ -53,6 +56,8 @@ In addition, there in the `/data` directory there are the following listings in
5356

5457
## Development Environment
5558

59+
One click: [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/cmu-delpih/www-main)
60+
5661
### Web Editor Only
5762

5863
1. Install Node: https://nodejs.org/en/download/

devops/gitpod.dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# docker image for setting up an R environment
2+
FROM gitpod/workspace-full
3+
4+
# install miniconda
5+
ENV PATH /opt/conda/bin:$PATH
6+
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda2-4.7.12-Linux-x86_64.sh -O ~/miniconda.sh && \
7+
sudo /bin/bash ~/miniconda.sh -b -p /opt/conda && \
8+
rm ~/miniconda.sh && \
9+
sudo ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
10+
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
11+
echo "conda activate base" >> ~/.bashrc && \
12+
sudo /opt/conda/bin/conda install --name base --channel conda-forge mamba=* && \
13+
sudo find /opt/conda/ -follow -type f -name '*.a' -delete && \
14+
sudo find /opt/conda/ -follow -type f -name '*.js.map' -delete && \
15+
sudo /opt/conda/bin/conda clean -afy && \
16+
conda config --prepend envs_dirs $HOME/.conda/envs && \
17+
conda config --prepend pkgs_dirs $HOME/.conda/pkgs
18+
19+
ADD ./environment.yml .
20+
RUN mamba env create -f environment.yml
21+
22+
ADD ./dependencies.R .
23+
24+
RUN conda run -n www-main Rscript ./dependencies.R
25+
26+
RUN echo "conda activate www-main" >> ~/.bashrc
27+
ENV PATH /home/gitpod/.conda/envs/www-main/bin:$PATH

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"build:blog": "Rscript -e \"blogdown::build_site(local=FALSE, run_hugo=FALSE, build_rmd=TRUE)\"",
2525
"build": "hugo --gc --minify",
2626
"start": "hugo server -D",
27-
"start:blog": "Rscript -e \"blogdown::serve_site()\"",
27+
"start:blog": "Rscript -e \"blogdown::serve_site(port=1313, browser=FALSE)\"",
2828
"format": "prettier *.* \"(.vscode|content|data|themes)/**\" --write",
2929
"lint": "prettier *.* \"(.vscode|content|data|themes)/**\" --check",
3030
"image": "docker build -t www-main:latest --file ./devops/Dockerfile ."

0 commit comments

Comments
 (0)