-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
defa2ca
commit b8ba16f
Showing
14 changed files
with
151 additions
and
123 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 |
---|---|---|
|
@@ -3,6 +3,7 @@ docs | |
inst/doc | ||
dev | ||
!dev/Makefile | ||
!dev/extract_irods_services_yaml.R | ||
*.irods | ||
/doc/ | ||
/Meta/ | ||
|
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 |
---|---|---|
|
@@ -33,7 +33,8 @@ Imports: | |
stats, | ||
testthat (>= 3.0.0), | ||
utils, | ||
withr | ||
withr, | ||
yaml | ||
Suggests: | ||
httptest2, | ||
kableExtra, | ||
|
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,25 @@ | ||
get_docker_compose_path <- function() { | ||
system.file("irods_demo/docker-compose.yml", package = "rirods") | ||
} | ||
|
||
get_docker_yaml <- function() { | ||
docker_compose_file <- yaml::read_yaml(get_docker_compose_path(), handlers = list( | ||
# make sure that sequences of size one are read as list | ||
# (defaults to vector of length one) | ||
seq = function(x) { | ||
x <- as.list(x) | ||
x | ||
} | ||
)) | ||
} | ||
|
||
is_irods_service_in_yaml <- function(services, docker_compose_file) { | ||
docker_compose_service_names <- names(docker_compose_file[["services"]]) | ||
irods_services_pattern <- paste0(services, collapse = "|") | ||
grepl(irods_services_pattern, docker_compose_service_names) | ||
} | ||
|
||
extract_irods_services_names <- function(services) { | ||
docker_compose_file <- get_docker_yaml() | ||
names(docker_compose_file[["services"]])[is_irods_service_in_yaml(services, docker_compose_file)] | ||
} |
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
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
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
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
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,19 +1,19 @@ | ||
# prepare for CRAN by removing unneeded irods_demo bagage | ||
.ONESHELL: | ||
SHELL = /bin/bash | ||
PATH_MODULES := ../inst/irods_demo | ||
DOCKER_MODULES := $(addprefix $(PATH_MODULES)/,irods_client_nfsrods irods_client_zone_management_tool metalnx-db metalnx minio-data) | ||
PATH_MODULES := ../inst/irods_demo/. | ||
IRODS_MODULES := nginx http icommands catalog | ||
SPACE = $(eval) $(eval) | ||
DOCKER_MODULES = $(subst $(SPACE),\|,$(IRODS_MODULES)) | ||
DOCKER_MODULES_REGEX = ".*\($(DOCKER_MODULES)\).*" | ||
|
||
all: update remove clean | ||
.PHONY: update clean | ||
|
||
all: update clean | ||
|
||
# update modules | ||
update: | ||
git submodule sync --recursive | ||
git submodule update --init --force --recursive --remote | ||
# delete unnecessary docker modules | ||
remove: | ||
rm -rf $(DOCKER_MODULES) | ||
# remove lines docker-compose | ||
clean: | ||
head -n 65 '$(PATH_MODULES)/docker-compose.yml' > temp.yml | ||
mv temp.yml '$(PATH_MODULES)/docker-compose.yml' | ||
$(shell find $(PATH_MODULES) -type d ! -regex $(DOCKER_MODULES_REGEX) -exec rm -rf {} +) | ||
Rscript extract_irods_services_yaml.R $(DOCKER_MODULES) |
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,15 @@ | ||
#!/usr/bin/env Rscript --vanilla | ||
|
||
args <- commandArgs(trailingOnly = TRUE) | ||
|
||
devtools::load_all() | ||
|
||
extract_irods_services <- function(services = args[1]) { | ||
new_docker_compose_file <- docker_compose_file <- get_docker_yaml() | ||
grep_services <- is_irods_service_in_yaml(services, docker_compose_file) | ||
new_docker_compose_file[["services"]] <- docker_compose_file[["services"]][grep_services] | ||
yaml::write_yaml(new_docker_compose_file, get_docker_compose_path()) | ||
invisible(NULL) | ||
} | ||
|
||
extract_irods_services() |
Submodule irods_demo
updated
22 files
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,8 +1,7 @@ | ||
#!/bin/sh | ||
|
||
DIR="$(dirname "$(realpath "$0")")" | ||
DIR=$(realpath $1) | ||
|
||
cd $DIR | ||
cd ../irods_demo | ||
|
||
docker exec irods-demo-irods-client-icommands-1 ils |
Oops, something went wrong.