-
Notifications
You must be signed in to change notification settings - Fork 25
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 #1 from rstudio/test-deploy
Update deploy
- Loading branch information
Showing
13 changed files
with
383 additions
and
45 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,24 +1,30 @@ | ||
Package: connectApiUtils | ||
Package: connectapi | ||
Type: Package | ||
Title: Utilities for Interacting with RStudio Connect's API | ||
Version: 0.1.0 | ||
Author: Sean Lopp | ||
Maintainer: Sean Lopp <[email protected]> | ||
Description: Helpful class for interacting with Connect's API and some example utility functions. | ||
Title: Utilities for Interacting with the RStudio Connect Server API | ||
Version: 0.1.0.9000 | ||
Authors@R: c( | ||
person("Sean", "Lopp", , "[email protected]", c("aut", "cre")), | ||
person("Cole", "Arendt", , "[email protected]", c("aut")), | ||
person("RStudio", role = c("cph", "fnd")) | ||
) | ||
Description: Helpful R6 class for interacting with the RStudio Connect Server API and some example utility functions. | ||
License: GPL-2 | ||
Encoding: UTF-8 | ||
Imports: | ||
R6, | ||
httr, | ||
rlang, | ||
fs | ||
RoxygenNote: 6.0.1 | ||
glue, | ||
fs, | ||
config | ||
RoxygenNote: 6.1.1 | ||
Suggests: | ||
rmarkdown, | ||
htmltools, | ||
flexdashboard, | ||
webshot, | ||
lubridate, | ||
ggplot2, | ||
gridExtra | ||
gridExtra, | ||
testthat | ||
Remotes: slopp/webshot |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# connectapi 0.1.0.9000 | ||
|
||
BREAKING: | ||
* Rename a handful of functions: | ||
- `connect$activate_bundle` to `connect$content_deploy` | ||
- `connect$create_app` to `connect$content_create` | ||
- `connect$upload_bundle` to `connect$content_upload` | ||
* Switch endpoints from using `app_id` to `guid` | ||
* `get_task$start` renamed to `get_task$first` | ||
* rename the package to `connectapi` | ||
|
||
OTHER: | ||
* Add some endpoints: | ||
- `get_content` | ||
- `get_audit_logs` | ||
- `get_server_settings` | ||
- `get_server_settings_r` | ||
- `inst_shiny_usage` | ||
- `inst_content_visits` | ||
* Add some helper functions: | ||
- `deploy_github`, `download_github` | ||
* Update `connect` R6 object to be compatible with Connect 1.7.0 APIs | ||
* Added a `NEWS.md` file to track changes to the package. |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#' @export | ||
download_github <- function(repo, ref = "master") { | ||
current_wd <- getwd() | ||
on.exit(setwd(current_wd), add = TRUE) | ||
|
||
temp_dir <- fs::dir_create(fs::path(fs::path_temp(), fs::file_temp("dir_")), recursive = TRUE) | ||
tar_file <- fs::path(temp_dir, "repo.tar.gz") | ||
setwd(temp_dir) | ||
|
||
req <- httr::GET( | ||
glue::glue( | ||
"https://api.github.com/repos/{repo}/tarball/{ref}" | ||
), | ||
httr::write_disk(tar_file) | ||
) | ||
|
||
# un-tar and enter the repo | ||
untar("repo.tar.gz") | ||
setwd(fs::dir_ls(type = "directory")) | ||
|
||
final_loc <- getwd() | ||
|
||
return(final_loc) | ||
} | ||
|
||
#' @export | ||
deploy_github <- function(connect, repo, ref = "master", filename = ".connect.yml") { | ||
download_dir <- download_github(repo = repo, ref = ref) | ||
current_wd <- getwd() | ||
on.exit(setwd(current_wd), add = TRUE) | ||
|
||
setwd(download_dir) | ||
yaml_content(connect = connect, filename = filename) | ||
} |
Oops, something went wrong.