This commit is contained in:
Hong Ooi 2019-08-16 19:11:53 +10:00
Родитель f97e44288b
Коммит 3c1fb0ba5c
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/AzureStor)](https://cran.r-project.org/package=AzureStor)
![Downloads](https://cranlogs.r-pkg.org/badges/AzureStor)
[![Travis Build Status](https://travis-ci.org/Azure/AzureStor.svg?branch=master)](https://travis-ci.org/Azure/AzureStor)
[![Build Status](https://asiadatascience.visualstudio.com/AzureR/_apis/build/status/Azure.AzureStor?branchName=master)](https://asiadatascience.visualstudio.com/AzureR/_build/latest?definitionId=3&branchName=master)
This package implements both an admin- and client-side interface to [Azure Storage Services](https://docs.microsoft.com/en-us/rest/api/storageservices/). The admin interface uses R6 classes and extends the framework provided by [AzureRMR](https://github.com/Azure/AzureRMR). The client interface provides several S3 methods for efficiently managing storage and performing file transfers.

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

@ -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/AzureStor +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