buildbot - how to fill project field in forcebuild form - field

I want to fill project field with list of projects . User will select one of the project and start Forcebuild. How can I do that?

You need to overwrite original templates.
You can user below code in master.cfg;
import jinja2
loader = [
jinja2.FileSystemLoader("YOUR_TEMPLATES_PATH"),
]
c['status'].append(html.WebStatus(http_port=8080, authz=authz_cfg, jinja_loaders=loader))

Related

How to Get a Clear PlayGround file Xcode 12.3

When I first create a playground page I get these lines of codes automatically. This is the default one.
//: [Previous](#previous)
import Foundation
var str = "Hello, playground"
//: [Next](#next)
But I want to get simply below rather than above, is that possible? Are there any preferences for that at Xcode?
import UIKit
You can edit the existing XCode template or copy the existing template, edit the template and make it your own one.
Option 1. Edit existing blank playground template.
Go to :
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/iOS/Playground/Blank___FileMenu.xctemplate
Double click to open ___FILEBASENAME___.playground
Edit this file (After open if the file not visible then the select file from the left sidebar).
And, in the last save file and restart Xcode.
Option 2. Copy Blank___FileMenu.xctemplate folder and give your own name and change as per your requirement.

ASP.NET MVC add translation in multiplanguage from screen/UI dynamically

In my website -- Add screen/UI from which user can add translation dynamically
for example:
I want to add translation for "Hello World!" in multiple language and want to fetch according to language selection
Key :
strHelloWorld
Value:
Hello World!
Language:
en (it can be anything english,spanish,german etc)
This above 3 field data we can add/enter from Scree/UI by superadmin and
store/save in whatever form is good it can be in database or in json file
Please suggest way to add translation from screen
Asp.Net has a special file called resource files (.resx) to define the default locale (English) and other language texts.
For that please follow the steps:
step 1: You need to create .resx(resource file) into Resource(new
folder). create the file for the default language and second file with other lang.
step 2: set access modifier to public otherwise the
variable value will not appear on the view side
step 3: enter the variable name in the same in both files but make value different related to language.
step 4: once you declare the same variable name in both languages resource file, you can use that variable name where ever you want to declare in .cshtml file.
ex. Resources.Global.APP_NAME
For reference :
http://www.codedigest.com/posts/53/create-multi-language-website-in-aspnet-mvc---localization
Please use below nuget package
It is really awesome thanks to nuget and their author
https://github.com/RickStrahl/Westwind.Globalization
Please note that In this solution they have provided solution for all .net framwork/platform like asp.net 4.5 also aspnet core
Thanks again

Is there a method to display dynamic information to the user BEFORE a build?

Within the Jenkins UI, on the project page, you can use the Description Setter plugin to set a description AFTER a build. Is there any way to dynamically set this before a build? I would want to pull information from a file in the workspace that shows information about files that will be changed when the user builds the project.
Edit: While I haven't found a way to dynamically set the project description, I did find that I can create an Active Choices Reactive Reference Parameter, give it a descriptive name that serves as a title, and then read the contents of a file containing HTML with a Groovy script like so..
// The contents of the file should be HTML
String contents = new File('/tmp/some_file.html').text
return contents
So I made this my last parameter, and it shows the information that I need to show, before the end user clicks the build button. Solves my problem.
I'm going to leave this question open though, in case someone has a better idea.
While I haven't found a way to dynamically set the project description, I did find that I can create an Active Choices Reactive Reference Parameter (this requires the Active Choices plugin),
Give it a descriptive name that serves as a title, and then read the contents of a file containing HTML with a Groovy script like so..
// The contents of the file should be HTML
String contents = new File('/tmp/some_file.html').text
return contents
You will need to select a Choice Type of: Formatted HTML.
So I made this my last parameter, and it shows the information that I need to show, before the end user clicks the build button. Solves my problem.

TFS 2012 Build Definition/Template - How to set Build Quality Automatically?

I thought this would be pretty straight forward, but it looks like the template has to be modified. Anyone have any idea what to do to add this piece to the default template?
I know how to edit the templates, I just don't know what I need to do to make this work.
This case already provided a solution for your requirement:
Copy the DefaultTemplate.xaml to DefaultTemplateCustom.xaml and open it
Click the Collapse All link in the top right corner
Open the toolbox and locate the Assign activity. It is located in the Primitives section
Drag the Assign activity to the end of the workflow, after the "Run MSBuild" activity
Go to the properties window. Set the "To" parameter to BuildDetail.Quality. Set "Value" to "xxx (Build Quality)"
Locate the InvokeMethod in the toolbox and drag it and drop it after the Assign activity
Set the "Target Object" to BuildDetail. Set "MethodName" to Save
Save the build definition xaml file and check it in, then build with the customized definition.
You can also consider to create a powershell script to set the build quality via TFS API and then invoke this powershell script in your build template. Refer to this link for details: PowerShell and TFS: The Basics and Beyond.
Here is a simple script to set the build quality:
$builduri = "vstfs:///Build/Build/1";
$collectionurl = "http://xxxx:8080/tfs/xxx/";
$tfs = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($collectionurl);
$buildservice = $tfs.GetService([Microsoft.TeamFoundation.Build.Client.IBuildServer]);
$build = $buildservice.GetBuild($builduri);
$build.Quality = "Released";
$build.Save()

Symfony - How can I change the filter title "Filters" in the admin generator?

i would like to know how i change the filters title in the admin generator.
I would like to change "Filters" to another word...
Thanks in advance!
The best way here is to go to your project's cache, find the autogenerated file '_filters.php'.
Copy this file to your admin templates dir
modules/mymodule/templates/
It should be empty if this is a fresh admin module.
edit the ...
echo __('filters')
to your liking..
This should not affect changes to filters defined in generator.yml going forward

Resources