зеркало из https://github.com/Azure/AzureGraph.git
switch to Azure Pipelines
This commit is contained in:
Родитель
ac3dd247be
Коммит
dfc47feb1a
|
@ -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/AzureGraph)](https://cran.r-project.org/package=AzureGraph)
|
||||
![Downloads](https://cranlogs.r-pkg.org/badges/AzureGraph)
|
||||
[![Travis Build Status](https://travis-ci.org/Azure/AzureGraph.svg?branch=master)](https://travis-ci.org/Azure/AzureGraph)
|
||||
[![Build Status](https://asiadatascience.visualstudio.com/AzureR/_apis/build/status/Azure.AzureGraph?branchName=master)](https://asiadatascience.visualstudio.com/AzureR/_build/latest?definitionId=5&branchName=master)
|
||||
|
||||
A simple interface to the [Microsoft Graph API](https://docs.microsoft.com/en-us/graph/overview). The companion package to [AzureRMR](https://github.com/Azure/AzureRMR) and [AzureAuth](https://github.com/Azure/AzureAuth).
|
||||
|
||||
|
|
|
@ -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/AzureGraph +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
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
|
Загрузка…
Ссылка в новой задаче