Skip to content

Instantly share code, notes, and snippets.

@colearendt
Created January 14, 2021 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colearendt/35fdec0f8a5ea37606e4c7ceef653595 to your computer and use it in GitHub Desktop.
Save colearendt/35fdec0f8a5ea37606e4c7ceef653595 to your computer and use it in GitHub Desktop.
Build Connect Programmatically
library(connectapi)
# TODO: use a real password. This user will _actually_ get created on your instance
# you can delete the user afterwards using the Connect usermanager CLI if you want
client <- connectapi:::create_first_admin("http://localhost:55011", "admin", "admin0", "admin@example.com", provider = "password")
# a directory with a manifest.json
bnd <- bundle_dir("./tests/testthat/examples/static")
content1 <- client %>%
deploy(bnd, name = "application-1", title = "Awesome Application", access_type = "all")
content1 %>%
set_vanity_url("/awesome-application") %>%
set_image_path("./test.png")
# in case you do not want parallelism in the builds. this will wait for the deployment to complete
content1 %>% poll_task()
# add additional content...
# create R markdown reports and schedule them...
# set ACLs...
# etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment