-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
find a way to track the most recent version of shiny server and subsequently update system command #9
Comments
I gave a go at this one. #XML is needed for this next chunk:
#Here we parse the xml of download3.rstudio.org/
#Using the rootsize we can extract the last entry which is the latest version of shiny server
if(!require(XML)){
install.packages("XML")
library(XML)
}
xml.url <- 'http://download3.rstudio.org/'
xmlParsed <- xmlParse(xml.url)
rootnode <- xmlRoot(xmlParsed)
rootsize <- xmlSize(rootnode)
latest_shiny_path <- xmlValue(rootnode[[rootsize]][[1]])
shiny_version <- unlist(strsplit(latest_shiny_path,'/'))[3]
# install latest Shiny server version
command <- c("\necho 'R installed'")
command <- append(command,"sudo apt-get install -y gdebi-core")
command <- append(command,paste0("wget https://download3.rstudio.org/",latest_shiny_path))
command <- append(command,paste0("sudo gdebi --non-interactive ",shiny_version)) |
nice and smooth, we'd better handle xml dependence within the package description, avoiding to employ require : http://r-pkgs.had.co.nz/description.html#dependencies what do you think @ScientistJake ? |
@AndreaCirilloAC That looks like the way to do it! I added: Imports:
XML To the DESCRIPTION file and changed the html parsing to call XML: xml.url <- 'http://download3.rstudio.org/'
xmlParsed <- XML::xmlParse(xml.url)
rootnode <- XML::xmlRoot(xmlParsed)
rootsize <- XML::xmlSize(rootnode)
latest_shiny_path <- XML::xmlValue(rootnode[[rootsize]][[1]])
shiny_version <- unlist(strsplit(latest_shiny_path,'/'))[3] I tested the install, and it loads XML. I also tested the XML function above. If you it looks good it's ready to push https://github.com/ScientistJake/ramazon |
closed with #10, thank you @ScientistJake ! |
within ramazon_mac function a call is made to https://download3.rstudio.org/ubuntu-12.04/x86_64 in order to download a shiny server version, which is set fixed to 1.5.3.838 ( thanks to the recent update from @ScientistJake ).
We should find a way to make amazon dinamically determine the last version and subsequently redirect himself toward the right url.
we could think about something similar to what is don within updateR function to detect last r version ( https://github.com/AndreaCirilloAC/updateR/blob/master/R/updateR.R)
The text was updated successfully, but these errors were encountered: