Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.3
14 changes: 11 additions & 3 deletions R/use_gitlab_ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
#' Set gitlab continuous integration
#'
#' @param image Docker image used as basis. See \url{https://github.com/rocker-org/rocker}
#' @param repo_name Deprecated. Kept for backward compatibility but ignored: as of
#' gitlabr 2.1, the CRAN mirror is set via the `REPO_NAME` GitLab CI/CD variable
#' (see \code{inst/gitlab-ci/bookdown-production.yml} in gitlabr) rather than as
#' an argument to `gitlabr::use_gitlab_ci()`.
#' @param project_path Path of the project to add CI in.
#' @param bookdown_output_format If type="bookdown" it corresponds to the function used to output the bookdown
#' @inheritParams gitlabr::use_gitlab_ci
#' @importFrom cli cli_alert_info
#' @importFrom cli cli_alert_info cli_alert_warning
#'
#' @details See \code{\link[gitlabr]{use_gitlab_ci}}
#'
Expand All @@ -21,7 +25,6 @@
#' withr::with_tempdir({
#' use_gitlab_ci(
#' image = "rocker/verse",
#' repo_name = "https://packagemanager.rstudio.com/all/__linux__/focal/latest",
#' type = "check-coverage-pkgdown"
#' )
#' })
Expand All @@ -33,6 +36,12 @@ use_gitlab_ci <- function(
bookdown_output_format = c("lozen::paged_template", "lozen::bs4_book_template"),
overwrite = TRUE
) {
if (!missing(repo_name)) {
cli_alert_warning(
"Argument `repo_name` is deprecated and ignored: gitlabr 2.1+ takes the CRAN mirror from the REPO_NAME CI/CD variable, not from a function argument."
)
}

ci_file <- file.path(project_path, ".gitlab-ci.yml")

if (
Expand Down Expand Up @@ -62,7 +71,6 @@ use_gitlab_ci <- function(

gitlabr::use_gitlab_ci(
image = image,
repo_name = repo_name,
path = ci_file,
type = type
)
Expand Down
14 changes: 11 additions & 3 deletions dev/flat_init_gitlab_ci.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ pkgload::load_all(export_all = FALSE)
#' Set gitlab continuous integration
#'
#' @param image Docker image used as basis. See \url{https://github.com/rocker-org/rocker}
#' @param repo_name Deprecated. Kept for backward compatibility but ignored: as of
#' gitlabr 2.1, the CRAN mirror is set via the `REPO_NAME` GitLab CI/CD variable
#' (see \code{inst/gitlab-ci/bookdown-production.yml} in gitlabr) rather than as
#' an argument to `gitlabr::use_gitlab_ci()`.
#' @param project_path Path of the project to add CI in.
#' @param bookdown_output_format If type="bookdown" it corresponds to the function used to output the bookdown
#' @inheritParams gitlabr::use_gitlab_ci
#' @importFrom cli cli_alert_info
#' @importFrom cli cli_alert_info cli_alert_warning
#'
#' @details See \code{\link[gitlabr]{use_gitlab_ci}}
#'
Expand All @@ -40,6 +44,12 @@ use_gitlab_ci <- function(
bookdown_output_format = c("lozen::paged_template", "lozen::bs4_book_template"),
overwrite = TRUE
) {
if (!missing(repo_name)) {
cli_alert_warning(
"Argument `repo_name` is deprecated and ignored: gitlabr 2.1+ takes the CRAN mirror from the REPO_NAME CI/CD variable, not from a function argument."
)
}

ci_file <- file.path(project_path, ".gitlab-ci.yml")

if (
Expand Down Expand Up @@ -69,7 +79,6 @@ use_gitlab_ci <- function(

gitlabr::use_gitlab_ci(
image = image,
repo_name = repo_name,
path = ci_file,
type = type
)
Expand Down Expand Up @@ -150,7 +159,6 @@ withr::with_tempdir({
withr::with_tempdir({
use_gitlab_ci(
image = "rocker/verse",
repo_name = "https://packagemanager.rstudio.com/all/__linux__/focal/latest",
type = "check-coverage-pkgdown"
)
})
Expand Down
6 changes: 4 additions & 2 deletions man/use_gitlab_ci.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading