This commit is contained in:
Hong Ooi 2019-08-15 18:54:38 +10:00
Родитель 17971ba1a1
Коммит dcf4e5ba5a
4 изменённых файлов: 51 добавлений и 34 удалений

Просмотреть файл

@ -1,8 +0,0 @@
language: r
sudo: false
cache: packages
r_packages:
- drat
after_success:
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash drat.sh

Просмотреть файл

@ -2,7 +2,7 @@
[![CRAN](https://www.r-pkg.org/badges/version/AzureVM)](https://cran.r-project.org/package=AzureVM)
![Downloads](https://cranlogs.r-pkg.org/badges/AzureVM)
[![Travis Build Status](https://travis-ci.org/Azure/AzureVM.svg?branch=master)](https://travis-ci.org/Azure/AzureVM)
[![Build Status](https://asiadatascience.visualstudio.com/AzureR/_apis/build/status/Azure.AzureVM?branchName=master)](https://asiadatascience.visualstudio.com/AzureR/_build/latest?definitionId=7&branchName=master)
AzureVM is a package for interacting with [virtual machines](https://azure.microsoft.com/services/virtual-machines/) and [virtual machine scalesets](https://azure.microsoft.com/services/virtual-machine-scale-sets/) in Azure. You can deploy, start up, shut down, run scripts, deallocate and delete VMs and scalesets from the R command line. It uses the tools provided by the [AzureRMR package](https://github.com/Azure/AzureRMR) to manage VM resources and templates. Version 2.0 of AzureVM is a complete rewrite of the package, aiming to make it a truly generic and flexible interface to VMs.

Просмотреть файл

@ -1,9 +1,55 @@
trigger:
- master
variables:
- group: GH
- name: R_LIBS_USER
value: '$(Agent.BuildDirectory)/R/library'
pool:
vmImage: 'ubuntu-latest'
container: $[variables['rockerImage']]
steps:
- script: 'git push --prune https://$(ghPat)@github.com/cloudyr/AzureVM +refs/remotes/origin/*:refs/heads/* +refs/tags/*:refs/tags/*'
displayName: 'copy to cloudyr'
- bash: |
export CLOUDYR_REPO=$(echo $(Build.Repository.Name) | sed "s/Azure/cloudyr/")
git push --prune https://$(ghPat)@github.com/$CLOUDYR_REPO +refs/remotes/origin/*:refs/heads/* +refs/tags/*:refs/tags/*
displayName: 'Copy to Cloudyr'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- bash: |
echo "options(repos = '$(cranRepo)')" > ~/.Rprofile
echo ".libPaths(c('$R_LIBS_USER', .libPaths()))" >> ~/.Rprofile
mkdir -p $R_LIBS_USER
displayName: 'Setup R library directory'
- task: CacheBeta@0
inputs:
key: ./DESCRIPTION | "$(rockerImage)" | "$(cranRepo)"
path: $(R_LIBS_USER)
displayName: 'Caching packages'
- bash: |
Rscript -e "pkgs <- c('remotes', 'rcmdcheck', 'drat'); if(length(find.package(pkgs, quiet=TRUE)) != length(pkgs)) install.packages(pkgs)"
Rscript -e "remotes::install_deps(dependencies=TRUE)"
displayName: 'Installing package dependencies'
- bash: |
Rscript -e "f <- pkgbuild::build(dest_path='$(Build.ArtifactStagingDirectory)'); rcmdcheck::rcmdcheck(f, args='--no-manual', error_on='warning', check_dir='check')"
displayName: 'Checking package'
- bash: |
export PKGBUILD_GZ=$(ls $(Build.ArtifactStagingDirectory)/*.gz)
mkdir drat
cd drat
git init
git config user.email "dummy@example.com"
git config user.name "Azure Pipelines"
git remote add upstream "https://$(ghPat)@github.com/cloudyr/cloudyr.github.io.git"
git fetch upstream
git checkout master
Rscript -e "drat::insertPackage('$PKGBUILD_GZ', repodir='./drat')"
git add --all
git commit -m "add $PKGBUILD_GZ (build $(Build.BuildId))"
git push
displayName: 'Update Cloudyr drat'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))

21
drat.sh
Просмотреть файл

@ -1,21 +0,0 @@
#!/bin/bash
set -o errexit -o nounset
addToDrat(){
mkdir drat; cd drat
## Set up Repo parameters
git init
git config --global push.default simple
## Get drat repo
git remote add upstream "https://$ghPat@github.com/cloudyr/cloudyr.github.io.git"
git fetch upstream
git checkout master
Rscript -e "drat::insertPackage('../$PKG_TARBALL', repodir = './drat')"
git add --all
git commit -m "add $PKG_TARBALL (build $TRAVIS_BUILD_ID)"
git push
}
addToDrat