Skip to content

Commit

Permalink
Merge branch 'release/0.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
vst committed Feb 16, 2016
2 parents 8b3781d + 327a21e commit 5c5a423
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 3 deletions.
11 changes: 10 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
VERS: 2016-02-14 ------- release/0.0.1
VERS: 2016-02-16 ------- release/0.0.2

* 2016-02-16 aa6dfc5 [release] Version bumped to 0.0.2 (vst@vsthost.com)
* 2016-02-16 45112d9 [feature] Added some required R libraries (vst@vsthost.com)
* 2016-02-15 da4a60f [chore] Using a more recent version of pandoc instead of 1.12.etc. (vst@vsthost.com)
* 2016-02-15 481d828 [chore] Added Rprofile, setup and install scripts, default index page (vst@vsthost.com)
* 2016-02-14 a6e10a3 [chore] Development version bumped to 0.0.2-SNAPSHOT (vst@vsthost.com)

VERS: 2016-02-14 10c6583 release/0.0.1 (vst@vsthost.com)

* 2016-02-14 7937370 [release] Change log updated (vst@vsthost.com)
* 2016-02-14 9b18bbd [release] Version bumped to 0.0.1 (vst@vsthost.com)
* 2016-02-14 756ebbb [chore] Insignificant Dockerfile changes (vst@vsthost.com)
* 2016-02-14 26c55b4 Initial commit (vst@vsthost.com)
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM ubuntu:14.04
MAINTAINER Vehbi Sinan Tunalioglu <vst@vsthost.com>

## Define versions required:
ENV VERSION 0.0.1
ENV VERSION 0.0.2

## Prepare apt-get:
RUN echo "debconf debconf/frontend select Noninteractive" | debconf-set-selections && \
Expand All @@ -17,11 +17,21 @@ RUN echo "debconf debconf/frontend select Noninteractive" | debconf-set-selectio
apt-get install -qy \
nano \
unzip \
opencpu && \
pandoc \
wget \
opencpu \
littler && \
wget -O /tmp/pandoc.deb https://github.com/jgm/pandoc/releases/download/1.16.0.2/pandoc-1.16.0.2-1-amd64.deb && dpkg -i /tmp/pandoc.deb && rm /tmp/pandoc.deb && \
apt-get clean autoclean && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

## Copy stuff:
COPY opt/ /opt/telostat

## Run setup script:
RUN /opt/telostat/bin/setup.sh

# Expose required ports:
EXPOSE 80
EXPOSE 8004
Expand Down
14 changes: 14 additions & 0 deletions opt/Rprofile.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Set-up the default repository:
local({
r <- getOption("repos")
r["CRAN"] <- "http://cran.r-project.org"
options(repos=r)
})

## Provide the start-up function:
.First <- function () {
cat("\n Welcome to R on opencpu-telostat!\n\n")
}

## Provide the function called prior closing the R session:
.Last <- function () cat("\n Goodbye!\n Telostat Team\n\n")
56 changes: 56 additions & 0 deletions opt/bin/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

## Get package names:
PACKAGES=${@}
R_MIRROR=${R_MIRROR:-"http://cran.r-project.org"}

## If no packages exit:
if [ -z "${PACKAGES}" ]; then
echo "No package names specified. Exiting..."
exit 1
fi

## Checks if the input is a file path.
function is_file {
echo $1 | grep -qE "tar.gz$"
}

## Checks if the input is a github repository.
function is_github {
echo $1 | grep -qE ".+/.+"
}

## Installs a file.
function install_file {
R CMD INSTALL $1
}

## Installs a github hosted R package.
function install_github {
r -e "devtools::install_github(\"$1\")"
}

## Install the R package from CRAN.
function install_cran {
r -e "install.packages(\"$1\", repos=\"${R_MIRROR}\", quiet=TRUE); library($1)"
}

## Installs the provided package.
function install {
if is_file $1; then
echo "File..."
install_file $1
elif is_github $1; then
echo "Github..."
install_github $1
else
echo "CRAN..."
install_cran $1
fi
}

## Iterate over packages and install:
for i in ${PACKAGES}; do
echo "Installing $i"
install ${i} && echo "Installed $i" || echo "Not Installed $i"
done
8 changes: 8 additions & 0 deletions opt/bin/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Populate the .Rprofile
cat /opt/telostat/Rprofile.R > /etc/R/Rprofile.site

## Install required packages:
/opt/telostat/bin/install.sh vst/sepl rmarkdown dplyr lubridate ggplot2 zoo xts data.table httr

## Copy the web stuff:
cp -R /opt/telostat/www/* /var/www/html/
44 changes: 44 additions & 0 deletions opt/www/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<html>
<head>
<style>
body {
background-color: rgb(45, 163, 199);
}
.aligner {
height:100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.aligner-item {
text-align: center;
font-family: Helvetica, Arial, sans-serif;
background-color: rgb(14, 35, 42);
padding: 20px 40px;
color: #ccc;
border-radius: 8px;
box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.8);
font-size: 1.4em;
}
a {
text-decoration: none;
font-size: 1.9em;
font-weight: bold;
color: #ccc;
}
</style>
</head>
<body>
<div class="aligner">
<div class="aligner-item">
<p>
<a href="http://www.telostat.com">Telostat Pte Ltd</a>
</p>
<p>
Welcome to the OpenCPU Box.
</p>
</div>
</div>
</body>
</html>

0 comments on commit 5c5a423

Please sign in to comment.