-
Notifications
You must be signed in to change notification settings - Fork 2
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 #9 from roqua/ae-circleci-20
move to circleci 20
Showing
6 changed files
with
173 additions
and
27 deletions.
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
.git | ||
.gitignore | ||
^circle.yml$ | ||
^.gitignore$ | ||
.circleci | ||
docker_configs | ||
^Dockerfile$ |
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,129 @@ | ||
defaults: &defaults | ||
working_directory: /app | ||
docker: | ||
- image: docker:17.05.0-ce-git | ||
environment: | ||
R_LIBS_USER: ~/lib/R/library | ||
_R_CHECK_FORCE_SUGGESTS_: FALSE | ||
_R_CHECK_ASCII_DATA_: FALSE | ||
|
||
version: 2 | ||
jobs: | ||
run_tests: | ||
<<: *defaults | ||
steps: | ||
- restore_cache: | ||
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }} | ||
- checkout | ||
- setup_remote_docker | ||
- run: | ||
name: Load Docker image layer cache | ||
command: | | ||
set +o pipefail | ||
docker load -i /caches/app.tar | true | ||
- run: | ||
name: Build application Docker image | ||
command: | | ||
docker build --cache-from=app -t app -f Dockerfile . | ||
- run: | ||
name: Save Docker image layer cache | ||
command: | | ||
mkdir -p /caches | ||
docker save -o /caches/app.tar app | ||
- run: | ||
name: Test the app | ||
command: | | ||
docker run app R CMD check /autovarCore/autovarCore_1.0-4.tar.gz --no-manual --no-build-vignettes --as-cran | ||
- save_cache: | ||
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }} | ||
paths: | ||
- /caches | ||
|
||
coverage: | ||
<<: *defaults | ||
steps: | ||
- restore_cache: | ||
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }} | ||
- checkout | ||
- setup_remote_docker | ||
- run: | ||
name: Load Docker image layer cache | ||
command: | | ||
set +o pipefail | ||
docker load -i /caches/app.tar | true | ||
- run: | ||
name: Build application Docker image | ||
command: | | ||
docker build --cache-from=app -t app -f Dockerfile . | ||
- run: | ||
name: Save Docker image layer cache | ||
command: | | ||
mkdir -p /caches | ||
docker save -o /caches/app.tar app | ||
- run: | ||
name: Codecov the app | ||
command: | | ||
docker run -e CODECOV_TOKEN app Rscript -e 'covr::codecov()' | ||
check_syntax: | ||
<<: *defaults | ||
steps: | ||
- restore_cache: | ||
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }} | ||
- checkout | ||
- setup_remote_docker | ||
- run: | ||
name: Load Docker image layer cache | ||
command: | | ||
set +o pipefail | ||
docker load -i /caches/app.tar | true | ||
- run: | ||
name: Build application Docker image | ||
command: | | ||
docker build --cache-from=app -t app -f Dockerfile . | ||
- run: | ||
name: Save Docker image layer cache | ||
command: | | ||
mkdir -p /caches | ||
docker save -o /caches/app.tar app | ||
- run: | ||
name: Check syntax | ||
command: | | ||
docker run app inst/bash/check_code_conventions.sh | ||
deploy_to_docker: | ||
<<: *defaults | ||
steps: | ||
- restore_cache: | ||
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }} | ||
- setup_remote_docker | ||
- run: | ||
name: Load Docker image layer cache | ||
command: | | ||
set +o pipefail | ||
docker load -i /caches/app.tar | true | ||
- run: | ||
name: Build application Docker image | ||
command: | | ||
docker build --cache-from=app -t app -f Dockerfile . | ||
- run: docker tag app roqua/autovarcore:staging | ||
- run: docker tag app roqua/autovarcore:production | ||
- run: docker tag app roqua/autovarcore:$(echo "$CIRCLE_TAG" | sed -e 's/v//g') | ||
- run: docker login --email=$DOCKER_EMAIL -u "$DOCKER_USER" -p "$DOCKER_PASS" | ||
- run: docker push roqua/autovarcore | ||
|
||
workflows: | ||
version: 2 | ||
commit: | ||
jobs: | ||
- run_tests | ||
- coverage | ||
- check_syntax | ||
deploy: | ||
jobs: | ||
- deploy_to_docker: | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v[0-9]+(\.[0-9]+)*/ |
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,22 @@ | ||
# How to test using OpenCPU: | ||
# 1. docker build -t autovarCore . | ||
# 2. docker run -p 80:80 autovarCore | ||
# 3. Go to <docker IP>/ocpu/test | ||
|
||
FROM compsy/opencpu-base | ||
|
||
WORKDIR /autovarCore | ||
|
||
RUN apt-get install -y git-core pandoc | ||
|
||
ADD ./inst/bash/install-package-dependencies.sh /autovarCore/inst/bash/install-package-dependencies.sh | ||
RUN /autovarCore/inst/bash/install-package-dependencies.sh | ||
|
||
ADD ./docker_configs/opencpu_server.conf.patch /docker_configs/opencpu_server.conf.patch | ||
RUN patch -p0 -d /etc/opencpu < /docker_configs/opencpu_server.conf.patch | ||
|
||
ADD ./ /autovarCore | ||
|
||
#RUN R -e 'library("devtools"); install.packages(build(".", path = "."));' | ||
RUN R CMD INSTALL --no-multiarch --with-keep.source /autovarCore | ||
RUN R CMD build /autovarCore |
This file was deleted.
Oops, something went wrong.
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,16 @@ | ||
--- server_old.conf 2015-02-16 18:54:47.066042000 +0100 | ||
+++ server.conf 2015-02-16 18:55:05.106042000 +0100 | ||
@@ -27,10 +27,10 @@ | ||
"appspaths": "/usr/local/lib/opencpu/apps-library", | ||
"repos": "http://cran.rstudio.com", | ||
"rlimit.as": 4e9, | ||
"rlimit.fsize": 1e9, | ||
"rlimit.nproc": 100, | ||
- "timelimit.get": 60, | ||
+ "timelimit.get": 4800, | ||
- "timelimit.post": 90, | ||
+ "timelimit.post": 4800, | ||
"timelimit.webhook": 900, | ||
"preload": ["lattice"] | ||
} | ||
|
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