我正在尝试将管道设置为仅签出与项目相关的特定文件夹,以便减少签出时间。
我正在使用在许多其他问题上找到的以下代码,但我似乎无法让它工作。
- script: |
cd $(Build.SourcesDirectory)
git init
git remote set-url origin $(Build.Repository.Uri)
git config core.sparsecheckout true
echo STARS/Source/ >> .git/info/sparse-checkout
git pull origin $(Build.SourceBranch)
displayName: 'Project Specific Checkout'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
Run Code Online (Sandbox Code Playgroud)
我不断在日志中收到以下错误:
Reinitialized existing Git repository in C:/Agent001/_work/20/s/.git/
fatal: Cannot prompt because terminal prompts have been disabled.
fatal: could not read Password for 'https://organization@dev.azure.com/...': terminal prompts disabled
Run Code Online (Sandbox Code Playgroud)
我似乎无法弄清楚如何启用终端提示。
更新:
根据@Repcak 评论,我更新了代码,但仍然收到错误terminal prompts have been disabled。
我有一个位于我的应用栏中的下拉菜单。然而,它似乎有一个带下划线的默认值。颤振文档说默认为 0.0,但事实并非如此,我可以看到下划线。如何删除此下划线。
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(30)),
),
margin: EdgeInsets.all(10.0),
padding: EdgeInsets.all(5.0),
width: MediaQuery.of(context).size.width * 0.30,
child: Center(
child: DropdownButton(
items: _dropdownValues.map((value) => DropdownMenuItem(child: Text(value), value: value)).toList(),
onChanged: (String value) {
setState(() {
_currentlySelected = value;
});
},
isExpanded: false,
value: _currentlySelected,
)
)
);
Run Code Online (Sandbox Code Playgroud)
设计:
我在 Azure DevOps 中有一个管道,用于构建我的 iOS 应用程序,我想根据作业和条件将环境与我正在构建的应用程序分开。我已经设置了初始参数选择:
parameters:
- name: Environment
displayName: "Environment"
type: string
default: Dev
values:
- Dev
- Live
- name: Build
displayName: "Build"
type: string
default: iPhone
values:
- iPhone
- iPhoneSimulator
Run Code Online (Sandbox Code Playgroud)
然后我在设置不同的工作时添加了一个条件:
- job:
condition: and(succeeded(), eq(${{ parameters.Build }}, iPhone))
steps:
- checkout: none
Run Code Online (Sandbox Code Playgroud)
当我尝试运行此程序时,出现以下错误:
An error occurred while loading the YAML build pipeline. Unrecognized value: 'iPhone'. Located at position 21 within expression: and(succeeded(), eq(iPhone, iPhone)).
Run Code Online (Sandbox Code Playgroud) 我使用 NUnit 创建了一个硒测试框架,有一个测试来打开页面并断言页面标题。
但是,当我尝试运行测试时,它似乎启动和停止,甚至不执行任何操作,甚至使用调试运行。测试保持在该not run状态。
当我设置断点{并使用调试运行测试时,没有任何变化。它启动并立即停止,而不运行测试。
测试:
[Test]
[TestCase(Browser.Chrome)]
public void ValidateWebDriverLaunches(Browser browser)
{
Driver = StaticWebDriverFactory.GetLocalWebDriver(browser);
Driver.Url = "https://example.com/";
string title = Driver.Title;
Assert.AreEqual(true, title.Contains("Example Domain"), "Title is not matching");
}
Run Code Online (Sandbox Code Playgroud)
错误日志
'testhost.x86.exe' (CLR v4.0.30319: Domain 2): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'
'testhost.x86.exe' (CLR v4.0.30319: Dependency finder domain): Unloaded 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Extensions\TestPlatform\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll'
The thread 0xcc has exited with code 0 (0x0).
'testhost.x86.exe' (CLR v4.0.30319: Domain 3): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'
'testhost.x86.exe' (CLR v4.0.30319: Dependency finder domain): Unloaded 'C:\Program …Run Code Online (Sandbox Code Playgroud) 我有一些代码可以创建 7 个圆形的原材料按钮。但是我似乎无法改变圆圈的大小,或者将它们放置得更近一些。
页面.dart
Row(
children: <Widget>[
new ThemeButton(Colors.red, () => print("red")),
new ThemeButton(Colors.orange, () => print("orange")),
new ThemeButton(Colors.yellow, () => print("yellow")),
new ThemeButton(Colors.green, () => print("green")),
new ThemeButton(Colors.blue, () => print("blue")),
new ThemeButton(Colors.indigo, () => print("pink")),
new ThemeButton(Colors.purple, () => print("purple")),
],
),
Run Code Online (Sandbox Code Playgroud)
主题按钮.dart
@override
Widget build(BuildContext context) {
return RawMaterialButton (
shape: CircleBorder(),
fillColor: _themeColour,
elevation: 0.0,
highlightElevation: 0.0,
onPressed: () => _onPressed(),
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
);
}
Run Code Online (Sandbox Code Playgroud)
展示:
所以我面临的三个问题都是围绕元素的大小和定位。
我查看了原材料按钮的参数,但看不到我可以更改的内容。添加填充小部件并将其设置为 0 无济于事。
我有一个用于构建和发布 cs 项目的 YAML 管道。我尝试将预定义变量放入发布配置文件中,但它引发了错误。我希望将已发布的文件放入该$(Build.ArtifactStagingDirectory)位置,以便我可以使用“发布构建工件”任务。
我不确定为什么当在代理目录中运行时,发布配置文件中的变量无法按预期工作。
错误:
错误 MSB4184:无法计算表达式“””.ArtifactStagingDirectory”。未找到方法“System.String.ArtifactStagingDirectory”
yaml:
- task: MSBuild@1
displayName: '${{ parameters.Site }} - Publish'
inputs:
solution: '*${{ parameters.Location }}/${{ parameters.Site }}.csproj'
msbuildVersion: '15.0'
msbuildArchitecture: 'x64'
platform: 'anycpu'
configuration: '${{ parameters.Configuration }}'
msbuildArguments: '/p:PublishProfile=$(Build.SourcesDirectory)\${{ parameters.Location }}\Properties\PublishProfiles\STARS.Website.Publish.Profile.pubxml'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: '${{ parameters.Site }}'
Run Code Online (Sandbox Code Playgroud)
pubxml:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<PublishProvider>FileSystem</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<publishUrl>$(Build.ArtifactStagingDirectory)</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
</PropertyGroup>
</Project>
Run Code Online (Sandbox Code Playgroud) 我有打开一个窗口的代码,并且有第 1 页、第 2 页和第 3 页的三个按钮。但是我也有四个 .py 文件(仪表板、PageOne、PageTwo。PageThree)。仪表板将是用于运行应用程序的文件。我希望它使每个文件中的代码仅在用户单击相应的页面按钮时运行/显示。
仪表板.py:
import Tkinter as tk
import PageOne
import PageTwo
import PageThree
class Page(tk.Frame):
def __init__(self, *args, **kwargs):
tk.Frame.__init__(self, *args, **kwargs)
def show(self):
self.lift()
class MainView(tk.Frame):
def __init__(self, *args, **kwargs):
tk.Frame.__init__(self, *args, **kwargs)
p1 = Page1(self)
p2 = Page2(self)
p3 = Page3(self)
buttonframe = tk.Frame(self)
container = tk.Frame(self)
buttonframe.pack(side="top", fill="x", expand=False)
container.pack(side="top", fill="both", expand=True)
p1.place(in_=container, x=0, y=0, relwidth=1, relheight=1)
p2.place(in_=container, x=0, y=0, relwidth=1, relheight=1)
p3.place(in_=container, x=0, y=0, relwidth=1, relheight=1)
b1 = tk.Button(buttonframe, …Run Code Online (Sandbox Code Playgroud) 我有一个包含底部导航的应用程序,当应用程序加载时,它默认为第一页。如果我单击第二页,然后从第二页导航到另一个未链接到底部导航栏的单独页面。当我单击此页面中 Appbar 中的后退按钮时,我将再次转到第一页而不是第二页。
导航控制器:
import 'package:flutter/material.dart';
import '../pages/TaxCalcPage.dart';
import '../pages/TaxInfoPage.dart';
import '../pages/SettingsPage.dart';
class BottomNavigationBarController extends StatefulWidget {
@override
_BottomNavigationBarControllerState createState() =>
_BottomNavigationBarControllerState();
}
class _BottomNavigationBarControllerState extends State<BottomNavigationBarController> {
final List<Widget> pages = [
TaxCalcPage(
key: PageStorageKey('Page1'),
),
TaxInfoPage(
key: PageStorageKey('Page2'),
),
SettingsPage(
key: PageStorageKey('Page3'),
)
];
final PageStorageBucket bucket = PageStorageBucket();
int _selectedIndex = 0;
Widget _bottomNavigationBar(int selectedIndex) => BottomNavigationBar(
onTap: (int index) => setState(() => _selectedIndex = index),
currentIndex: selectedIndex,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home), title: Text('Tax Calculators')), …Run Code Online (Sandbox Code Playgroud) 我们有一个 Azure DevOps 管道,用于使用二头肌文件将基础设施部署到 Azure。在 Azure 中,我们创建了一个应用程序注册服务原则,并将其作为贡献者添加到我们的订阅中,我们将其用作 Azure DevOps 中的服务连接,以允许我们部署所需的基础设施。
在管道中,我们将创建一个密钥保管库并将服务原则添加到访问策略中。此外,在 Bicep 中,我试图获取一个秘密来用作另一个基础设施资源的密码,但我不断收到以下错误:
{
"status": "Failed",
"error": {
"code": "DeploymentFailed",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.",
"details": [
{
"code": "Forbidden",
"message": "{\r\n \"error\": {\r\n \"code\": \"KeyVaultParameterReferenceSecretRetrieveFailed\",\r\n \"message\": \"The secret of KeyVault parameter 'password' cannot be retrieved. Http status code: 'Forbidden'. Error message: 'Access denied to first party service.\\r\\nCaller: name=ARM;tid=f8cdef31...;appid=797f4846...;oid=f248a218...;iss=https://sts.windows.net/f8cdef31.../\\r\\nVault: kv-kf-web-shared-fea-ne;location=northeurope'. Please see https://aka.ms/arm-keyvault for usage …Run Code Online (Sandbox Code Playgroud) 我有一个 yml 管道,它是由合并到我们的开发分支触发的。这使用 PowerShell 脚本来检查合并中发生的更改,并创建应构建和部署的服务列表。在 PowerShell 中,我添加了名为 的手动触发器变量BuildQueueManual。我的问题不在于 yml 代码本身,而在于管道。
在 yml 中,我将此值添加为全局变量:
variables:
BuildQueueManual:
resources:
- repo: self
pool:
name: Windows
stages:
- stage: Prerequisites
jobs:
- job: GetBuildQueue
steps:
Run Code Online (Sandbox Code Playgroud)
但是,当我运行管道时,该变量不会出现。从下面的截图中可以看出,它没有定义变量:
我正在尝试使用 docker 设置我的 Plex 服务器。我已按照LinuxServer.io docker页面上的步骤操作。当我运行 docker 命令时,它说它正在运行 find 并且我没有收到任何错误。但是,当我尝试通过 访问 Web UI 时localhost:32400/web,我得到的只是“问题加载页面”
我正在使用 docker for windows 和 Linux 容器。
码头工人命令:
docker run -d --name=plex --net=host -e PUID=1000 -e PGID=1000 -e TZ=Europe/London -e VERSION=docker -v D:\plex\config:/config -v D:\media\tvseries:/data/tvshows -v D:\media\movies:/data/movies -v D:\media\transcode:/transcode --restart unless-stopped linuxserver/plex
Run Code Online (Sandbox Code Playgroud)
当我使用docker psplex 容器时,它看起来正在运行。
我是码头工人的新手。我环顾四周,找不到为什么我无法访问 UI。
如果您需要其他信息,请告诉我。
码头工人检查:
"NetworkMode": "host",
"PortBindings": {
"32400/tcp": [
{
"HostIp": "",
"HostPort": "32400"
}
]
},
Run Code Online (Sandbox Code Playgroud)
如果您需要更多信息,请告诉我
我有一个 PowerShell 脚本,它运行一些 API 请求,然后将测试信息导出到 Excel 中。
当我创建表时,我为结果添加了几列。但是,当我通过 Excel 导出表格时,有一堆我不想要的额外列。
$ResultsTable = New-Object System.Data.DataTable "ResultsTable"
$RTC1 = New-Object system.Data.DataColumn "Type",([string])
$RTC2 = New-Object system.Data.DataColumn "Endpoint",([string])
$RTC3 = New-Object system.Data.DataColumn "PassRate",([string])
$RTC4 = New-Object system.Data.DataColumn "AvgTime",([string])
$RTC5 = New-Object system.Data.DataColumn "MaxTime",([string])
$RTC6 = New-Object system.Data.DataColumn "AvgSize",([string])
$RTC7 = New-Object system.Data.DataColumn "MaxSize",([string])
$ResultsTable.Columns.Add($RTC1)
$ResultsTable.Columns.Add($RTC2)
$ResultsTable.Columns.Add($RTC3)
$ResultsTable.Columns.Add($RTC4)
$ResultsTable.Columns.Add($RTC5)
$ResultsTable.Columns.Add($RTC6)
$ResultsTable.Columns.Add($RTC7)
$Row = $ResultsTable.NewRow()
$Row.Type = "Direct"
$Row.Endpoint = $Uri
$Row.PassRate = "$PassRate%"
$Row.AvgTime = $AvgTime
$Row.MaxTime = $MaxTime
$Row.AvgSize = $AvgSize
$Row.MaxTime = …Run Code Online (Sandbox Code Playgroud) 我有一个 Django 过滤器,有 4 个选择。我想按照我在过滤器中写入的顺序在模板上对这些选项进行排序。
过滤器.py:
RarityChoices = {
('common', 'Common'),
('uncommon', 'Uncommon'),
('rare', 'Rare'),
('mythic', 'Mythic')
}
rarity = ChoiceFilter(field_name='rarity', empty_label='Any', choices=sorted(RarityChoices), widget=RadioSelect())
Run Code Online (Sandbox Code Playgroud)
模板.html:
<div>
<label class="mb-1" for="id_type">Rarity:</label>
{{ card_filter.form.rarity}}
</div>
Run Code Online (Sandbox Code Playgroud)
截屏:
如果我将过滤器更改为:
rarity = ChoiceFilter(field_name='rarity', empty_label='Any', choices=RarityChoices, widget=RadioSelect())
Run Code Online (Sandbox Code Playgroud)
过滤器在模板上看起来像这样:
两者都不是我想要的顺序,也不是filter.py文件中列出的顺序。
flutter ×3
yaml ×3
azure ×2
azure-devops ×2
python ×2
azure-bicep ×1
c# ×1
cmd ×1
csproj ×1
dart ×1
django ×1
docker ×1
excel ×1
git ×1
nunit ×1
plex ×1
powershell ×1
pubxml ×1
python-2.7 ×1
python-3.x ×1
tkinter ×1
variables ×1
windows ×1