-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from wdwatkins/master
Building in docker
- Loading branch information
Showing
4 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# tagged version, not latest! | ||
FROM rocker/geospatial:3.5.2 | ||
|
||
# install node and npm (see https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions) | ||
RUN sudo apt-get install -y curl &&\ | ||
sudo apt-get install -y gnupg &&\ | ||
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - &&\ | ||
sudo apt-get update &&\ | ||
sudo apt-get install -y nodejs &&\ | ||
sudo apt-get install -y build-essential | ||
|
||
RUN sudo npm install -g\ | ||
webpack\ | ||
webpack-cli\ | ||
d3-geo-projection | ||
|
||
#bring in DOI root cert. Remove this statement for non-USGS persons | ||
RUN /usr/bin/wget -O /usr/lib/ssl/certs/DOIRootCA.crt http://sslhelp.doi.net/docs/DOIRootCA2.cer && \ | ||
ln -sf /usr/lib/ssl/certs/DOIRootCA.crt /usr/lib/ssl/certs/`openssl x509 -hash -noout -in /usr/lib/ssl/certs/DOIRootCA.crt`.0 && \ | ||
echo "\\n\\nca-certificate = /usr/lib/ssl/certs/DOIRootCA.crt" >> /etc/wgetrc; | ||
|
||
RUN Rscript -e 'installed.packages()' | ||
#Note that version rocker images are already set up to use the MRAN mirror corresponding to the | ||
#date of the R version, so package dates are already set (unless forcing another repo) | ||
RUN Rscript -e 'devtools::install_github("richfitz/remake")' && \ | ||
Rscript -e 'install.packages("grithub", repos = c(getOption("repos"), "https://owi.usgs.gov/R"))' && \ | ||
Rscript -e 'devtools::install_github("USGS-VIZLAB/[email protected]")' | ||
#note that most common packages will already be installed as part of the geospatial image | ||
RUN install2.r --error \ | ||
sbtools \ | ||
geojsonio \ | ||
dataRetrieval\ | ||
bit64 | ||
|
||
RUN mkdir /home/rstudio/gage-conditions | ||
RUN chown rstudio /home/rstudio/gage-conditions | ||
WORKDIR /home/rstudio/gage-conditions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
pipeline { | ||
agent none | ||
stages { | ||
stage('Checkout repo') { | ||
agent any | ||
steps { | ||
sh 'wget -O DOIRootCA2.cer http://sslhelp.doi.net/docs/DOIRootCA2.cer' | ||
git "https://github.com/wdwatkins/gage-conditions" | ||
} | ||
} | ||
stage('build viz') { | ||
agent { | ||
dockerfile { | ||
args '-v ${WORKSPACE}:/home/rstudio/gage-conditions' | ||
} | ||
} | ||
steps { | ||
sh 'mkdir -p target' | ||
sh ''' | ||
Rscript -e 'vizlab::vizmake("dv_sites_sp")' | ||
Rscript -e "remake::make(remake_file = 'map_preprocess.yml')" | ||
Rscript -e "vizlab::vizmake()" | ||
''' | ||
} | ||
} | ||
stage('push to S3') { | ||
agent any | ||
steps { | ||
sh 'aws s3 sync ./target/ s3://dev-owi.usgs.gov/vizlab/water-use-15/ --exclude "*.svg" --exclude "*.json"; \ | ||
aws s3 sync ./target/ s3://dev-owi.usgs.gov/vizlab/water-use-15/ --exclude "*" --include "*.svg" --content-type "image/svg+xml"; \ | ||
aws s3 sync ./target/ s3://dev-owi.usgs.gov/vizlab/water-use-15/ --exclude "*" --include "*.json" --content-type "application/json"' | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: "3" | ||
services: | ||
docker-dev-mode: | ||
image: gage-conditions | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "8787:8787" | ||
volumes: | ||
- gage-conditions-data:/home/rstudio/gage-conditions | ||
environment: | ||
- ROOT=TRUE | ||
- PASSWORD=mypass | ||
|
||
volumes: | ||
gage-conditions-data: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters