我们刚刚开始一个新项目,并试图通过 Appveyor 让 CI 工作。
它是一个Aurelia
网络应用程序所以我们需要jspm
在构建服务器上。
在我的工作站上我手动配置jspm https://github.com/jspm/jspm-cli/blob/master/docs/registries.md#creating-a-private-jspm-registry正如 @guybedford 在下面的回答中所建议的,并在 appveyor.yml 脚本中配置了我的 authtoken:
- jspm config registries.github.auth %JSPM_GITHUB_AUTH_TOKEN%
目前我的 appveyor.yml 看起来像这样,基于JSPM 的自动配置部分 https://github.com/jspm/jspm-cli/blob/master/docs/registries.md#auto-configuring-registries
version: 1.0.{build}
os: Visual Studio 2015
build:
verbosity: detailed
environment:
JSPM_GITHUB_AUTH_TOKEN:#token from jspm registry export github (locally)#
install:
- ps: Set-Culture nl-NL
- ps: Install-Product node $env:nodejs_version
- cd src\Web
- npm uninstall jspm -g
- npm install -g jspm
- npm install -g gulp
- npm install
- jspm config registries.github.auth %JSPM_GITHUB_AUTH_TOKEN%
- jspm config registries.github.maxRepoSize 0
- jspm registry export github #output to see what the registry looks like
- jspm install -y
- gulp build
- cd ..\..
nuget:
account_feed: true
before_build:
- dnvm install -r clr -arch x86 1.0.0-rc1-update1
- dnu restore
- nuget restore
The jspm install - y
命令失败并出现错误:Unauthorized response for GitHub API
.
如何使用 AppVeyor 上的 JSPM 正确配置 Github 凭据?
最好从以下位置获取此令牌jspm registry export github
在本地配置凭据之后,以便使用与 jspm 完全相同的算法,而不是进行手动编码。
如果您确实想要手动编码,则身份验证令牌实际上采用的值new Buffer(encodeURIComponent(username) + ':' + encodeURIComponent(password)).toString('base64')
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)