可以从基于PowerShell的VSTS构建任务使用ExtensionDataService吗?(Can ExtensionDataService be used from a PowerShell-based VSTS build task?)
我为Visual Studio Team Services(以前称为Visual Studio Online)创建了基于PowerShell的构建任务。 我已经实现了我需要的大部分功能,但是对于最后一点功能,我需要能够在构建之间保留少量数据。
ExtensionDataService看起来就像我想要的那样(特别是setValue和getValue方法),但我发现的文档和示例都是基于node.js的构建任务:
VSS.getService(VSS.ServiceIds.ExtensionData).then(function(dataService) { // Set a user-scoped preference dataService.setValue("pref1", 12345, {scopeType: "User"}).then(function(value) { console.log("User preference value is " + value); });
上一页还有调用REST API的部分示例,但在尝试使用它来保存或检索值时,我遇到了404错误:
GET _apis/ExtensionManagement/InstalledExtensions/{publisherName}/{extensionName}/Data/Scopes/User/Me/Collections/%24settings/Documents { "id": "myKey", "__etag": -1, "value": "myValue" }
PowerShell可以通过使用库或直接调用REST API来访问ExtensionDataService吗?
I have created a PowerShell-based build task for Visual Studio Team Services (formerly Visual Studio Online). I have implemented the majority of the functionality I need, but for the last bit of functionality I need to be able to persist a small amount of data between builds.
The ExtensionDataService seems like exactly what I want (in particular, the setValue and getValue methods), but the documentation and examples I have found are for node.js-based build tasks:
VSS.getService(VSS.ServiceIds.ExtensionData).then(function(dataService) { // Set a user-scoped preference dataService.setValue("pref1", 12345, {scopeType: "User"}).then(function(value) { console.log("User preference value is " + value); });
The previous page also has a partial example of calling the REST API, but I have gotten 404 errors when trying to use it to either save or retrieve values:
GET _apis/ExtensionManagement/InstalledExtensions/{publisherName}/{extensionName}/Data/Scopes/User/Me/Collections/%24settings/Documents { "id": "myKey", "__etag": -1, "value": "myValue" }
Can PowerShell be used to access the ExtensionDataService, either by using a library or by calling the REST API directly?
原文:https://stackoverflow.com/questions/41253357
最满意答案
我在我的本地环境中重新创建了你的问题。 问题是您没有安装automake,autoconf和libtoolize。
这些是我的
install.R
和Dockerfile
脚本。install.R:
install.packages( c('RProtoBufLib', 'flowDensity'), dependencies = TRUE, repos = c('http://bioconductor.org/packages/3.6/bioc', 'https://cloud.r-project.org') )
Dockerfile:
FROM bioconductor/release_core2 RUN apt-get update \ && apt-get install -y --no-install-recommends \ libgeos-dev ed \ automake autoconf libtool \ && rm -rf /var/lib/apt/lists/* ADD install.R /tmp RUN Rscript /tmp/install.R \ && rm -rf /tmp/downloaded_packages/ /tmp/*.rds \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /usr/share/info/* \ && rm -rf /usr/share/man/* \ && rm -rf /usr/share/doc/* \ && rm -rf /var/lib/dpkg/info
为了构建项目,我执行了这个命令:
docker build -t rbiotest .
注意:建立时间似乎是永恒的。
I've recreated your issue on my local environment. The problem is that you don't have automake, autoconf and libtoolize installed.
These are my
install.R
andDockerfile
script.install.R:
install.packages( c('RProtoBufLib', 'flowDensity'), dependencies = TRUE, repos = c('http://bioconductor.org/packages/3.6/bioc', 'https://cloud.r-project.org') )
Dockerfile:
FROM bioconductor/release_core2 RUN apt-get update \ && apt-get install -y --no-install-recommends \ libgeos-dev ed \ automake autoconf libtool \ && rm -rf /var/lib/apt/lists/* ADD install.R /tmp RUN Rscript /tmp/install.R \ && rm -rf /tmp/downloaded_packages/ /tmp/*.rds \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /usr/share/info/* \ && rm -rf /usr/share/man/* \ && rm -rf /usr/share/doc/* \ && rm -rf /var/lib/dpkg/info
In order to build the project I've executed this command:
docker build -t rbiotest .
NOTE: Build time will seem eternal.
相关问答
更多-
刚刚得到它 正如Regan指出的那样,我不得不将用户添加到sudoers组。 但主要原因是我忘记更新存储库缓存,所以apt-get找不到sudo包。 它现在正在工作 以下是完成的代码: FROM ubuntu:12.04 RUN apt-get update && \ apt-get -y install sudo RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo USER doc ...
-
将其保存为类似package_check.R东西,然后有一个Docker行通过Rscript运行它: c("tidytext", "janitor", "corrr", "officer", "devtools", "pacman", "tidyquant", "timetk", "tibbletime", "sweep", "broom", "prophet", "forecast", "prophet", "lime", "sparklyr", "rsparkling", "formatta ...
-
正如@Murli所提到的,你应该使用pip3 。 但是,您应该记住的一件事是, helm用于管理k8s,即进入群集的内容应该是可追踪的。 所以我推荐你以下内容: $ helm get stable/superset 修改values.yaml。 就我而言,我将jenkins-job-builder添加到pip3: initFile: |- pip3 install jenkins-job-builder /usr/local/bin/superset-init --username admin - ...
-
您可能需要首先进行apt-get update - 这些包可能已更新(因此它们的显式包版本已更改),因为您的容器中的源列表已被写入(创建映像时,而不是实例化容器时) )。 更新后, apt-get install ...应该能够安装它们。 You probably need to do an apt-get update first - these packages have probably been updated (and thus their explicit package versions ha ...
-
好吧,没有“容器到容器”内部通信层,如“ssh”。 在这方面,容器与2个不同的VM一样独立(通常在网络部分旁边)。 您可以按常规方式在“接收”服务器上安装opensshd-server,仅将其配置为基于密钥的服务器。 您无需将端口导出到主机,只需使用docker-internal网络连接到端口。 在容器启动时(卷装入)期间,将“调用者服务器”上的ssh私钥和公钥放入“接收服务器”上的.ssh / authorized_keys,这样就不会在映像中保留秘密(构建时间)。 可能还会在.ssh / config中 ...
-
在docker容器中安装R包时,缺少“aclocal-1.14”('aclocal-1.14' is missing when installing R package in docker container)[2022-09-22]
我在我的本地环境中重新创建了你的问题。 问题是您没有安装automake,autoconf和libtoolize。 这些是我的install.R和Dockerfile脚本。 install.R: install.packages( c('RProtoBufLib', 'flowDensity'), dependencies = TRUE, repos = c('http://bioconductor.org/packages/3.6/bioc', 'https://cloud.r-project.org') ... -
我认为它失败了,因为你试图从连接到apache容器的localhost的apache容器访问memcached,而memcached容器可以访问不同IP地址上的apache。 这是我认为错误的路线: $mc->addServer("localhost", 11211); 当您链接容器时,Docker会将源容器的主机条目添加到/etc/hosts文件中(请参阅有关链接的文档 )。 因此,您应该能够使用此PHP命令从apache容器连接到memcached容器: $mc->addServer("memcach ...
-
我建议使用数据容器。 在图像构建和多个容器之间缓存bundler gem时,你可以实现rails类似的方法: 在您docker-compose.yml (我假设您使用的是docker-compose.yml compose)文件中,您可以添加一个可以挂载到其他容器中的数据容器: version: '2' services: web: build: . volumes: - .:/app - bundle:/bundle volumes: bundle: {} ...
-
我不得不在运行docker的fedora机器上禁用SELinux。 执行setenforce 0,编辑/ etc / selinux / conf以禁用并重新启动我的机器修复它。 我没有意识到我的docker容器会从运行它的机器继承权限问题。 I had to disable SELinux on my fedora machine running docker. Doing a setenforce 0, editing /etc/selinux/conf to disabled and rebootin ...
-
您需要重建映像当您尝试在docker中安装新包时 You need to rebuild your image When you try to install new package in docker