-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
60 lines (54 loc) · 2.12 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
image: artifactory.wma.chs.usgs.gov/docker-official-mirror/julia:latest
variables:
CONNECT_API_KEY: "$CONNECT_API_KEY"
CONNECT_SERVER: "$CONNECT_SERVER"
stages:
- build
- deploy
- validate
build:
stage: build
script:
- julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.test()'
- julia --project=. -e 'using Pkg; Pkg.add("Documenter"); using Documenter; include("docs/make.jl")'
artifacts:
paths:
- docs/build
expire_in: 1 week
deploy-dev:
image: artifactory.wma.chs.usgs.gov/docker-official-mirror/rocker/rstudio:4.1.2
stage: deploy
script:
# install packages
- Rscript -e "install.packages(c('rsconnect', 'connectapi'))"
# create manifest file for deployment
- Rscript -e "rsconnect::writeManifest(appDir='$CI_PROJECT_DIR/docs/build')"
# deploy docs to RStudio Connect
- Rscript -e "task <- connectapi::deploy(connectapi::connect(), connectapi::bundle_dir('$CI_PROJECT_DIR/docs/build'), name='DataRetrieval-jl-dev'); connectapi::poll_task(task)"
rules:
- if: '$CI_COMMIT_BRANCH == "dev" && $CONNECT_API_KEY != null && $CONNECT_SERVER != null'
deploy-main:
image: artifactory.wma.chs.usgs.gov/docker-official-mirror/rocker/rstudio:4.1.2
stage: deploy
script:
# install packages
- Rscript -e "install.packages(c('rsconnect', 'connectapi'))"
# create manifest file for deployment
- Rscript -e "rsconnect::writeManifest(appDir='$CI_PROJECT_DIR/docs/build')"
# deploy docs to RStudio Connect
- Rscript -e "task <- connectapi::deploy(connectapi::connect(), connectapi::bundle_dir('$CI_PROJECT_DIR/docs/build'), name='DataRetrieval-jl'); connectapi::poll_task(task)"
rules:
- if: '$CI_COMMIT_BRANCH == "main" && $CONNECT_API_KEY != null && $CONNECT_SERVER != null'
Validate Inventory:
stage: validate
image: ${INTERNAL_REGISTRY}software/software-management:latest
script:
- software-management review
--project "${CI_PROJECT_PATH}"
--ref "${CI_COMMIT_BRANCH}"
--type "provisional"
--token "${GIT_TOKEN_CUSTOM}"
tags:
- chs-shared
rules:
- if: '$CI_COMMIT_BRANCH == "main"'