I would like to know where people do get information about such Jenkins scripted pipeline syntax as, for example:
1.
properties([
pipelineTriggers([cron('*/5 * * * *')]),
])
2.
git(
poll: true,
url: 'ssh://<URL>/<repo>.git',
credentialsId: 'XXX',
branch: 'XXX'
)
I tried to use https://jenkins.io/doc/book/ and search with Ctrl+F like in html as in the PDF version of the book (https://jenkins.io/user-handbook.pdf) as well and found nothing! Searching in Google for "pipelineTriggers" points to stackoverflow or articles of other persons, but not to some official Jenkins sources.
I need a tutorial where I could search for the description of every element of scripted pipeline with all its possible options and their values.
Could someone please refer where everybody read about this?
You can find all documented pipeline steps in Pipeline Steps Reference
Also you can use Snippet Generator.
Related
I have a gradle build and want to make some text files a bit more dynamic, in the sense that they would always contain the current build's version number. This should be easy peasy once the files are treated as templates and the version number comes as a variable from gradle.
I have tried using Aaron Nies' template plugin like so:
plugins {
id 'application'
id "dev.anies.gradle.template" version "0.0.2"
}
...
tasks.register("template", TemplateTask) {
data += [key: "value"]
from('src/templates')
into('build/templates')
}
But Gradle always complains
Could not get unknown property 'TemplateTask' for project ':app' of type org.gradle.api.Project.
I thought to have stuck to the documentation. What may be wrong here?
BTW, I do not have to use Freemarker Templates at this point. If someone shows how to use the builtin template engine that can replace variables I would accept that as answer as well.
Ok, so I got off the ground using Ant's ReplaceTokenFilter. After all I found the relevant line in the documentation:
https://docs.gradle.org/current/userguide/working_with_files.html#sec:copying_files
Example 36 (Filtering files as they are copied) uses the ReplaceTokenFilter. But unlike so many examples I found on the web it also contains the line
import org.apache.tools.ant.filters.ReplaceTokens
which ultimately made it work for me.
As for the FreeMarkerTemplates I still do not know, but my case is solved.
What is the value in adding YAML atop an Azure DevOps Wiki page's markdown, as supported by its markdown syntax: Syntax guidance for Markdown usage in Wiki, YAML tags?
It seems to offer nothing more than an alternative syntax with which to specify tables. Perhaps more elaborate tables but they'll only render atop the page. What am I missing?
As the introduction in the document,
Any file that contains a YAML block in a Wiki is processed by a table with one head and one row.
So, I think the value of YAML tags in the Wiki markdown is to convert the abstract YAML statements into a visual table on the Wiki page to increase readability and quick understanding.
Especially for a complex YAML block that may contain multiple items or multiple sub-items, the YAML tags should be very helpful.
[UPDATE]
I find an issue ticket (MicrosoftDocs/azure-devops-docs#9976) reported by another user on the GitHub repository "MicrosoftDocs/azure-devops-docs". This issue has reported a similar question.
And in this issue ticket, you also can see #amitkumariiit has given an explanation:
Yaml tags are used for general search engine optimisation. Our plan was to add the basic support for it first and then ingest this in the azure devops wiki search for optimise search. However we could not prioritise the search side of work.
If you need more detailed explanation, you can follow this issue ticket and add your comments to it.
I am going to propose my own answer. It just occurred to me that this is likely intended to replace markdown, not to be used with markdown. That is to say, to support documentation written purely in YAML. That could make some sense, add value for some, and explain why it's ONLY supported atop the page. You use it instead of the markdown, not with the markdown.
The documentation just doesn't make it clear why/how you might want to use this feature.
I find myself unable to use the ruby-nmap documentation at
http://www.rubydoc.info/gems/ruby-nmap/Nmap
There are simply no code examples and therefore I quite can't figure out on how to use & read the documentation properly. Can somebody give me an overview on how to get started and what for example "#address" means?
You could look at the github page, that seems to have some usage examples.
E.g.
require 'nmap/program'
Nmap::Program.scan(targets: '192.168.0.1', verbose: true)
Follow Nmap::Program.scan documentation and choose your options from Nmap::Task. Experiment a bit :)
I'm trying to pull a series of notes out of salesforce, I really just need the body of those notes and I'd really rather avoid copying those manually.
I've got the URLs of the notes into a Google Docs spreadsheet and I'm trying to use ImportXML function to pull specific information out, however I can't seem to get the xpath query right.
After some attempts of my own and a fair bit of research (I am a complete beginner so I might jut be searching for the wrong things) I came up with an xpath query like so:
//div[#class="pbSubsection"]//td[#class="data2Col"][5]//text
This results in a parsing error.
I also found that I can open up the Note in Chrome and in developer tools, find the table and right-click to select Copy XPath, which gives me:
//*[#id="ep"]/div[2]/div[2]/table/tbody/tr[5]/td[2]
Even if I append //text onto the end. Obviously this is not as fool-proof as I require; is there something I'm missing here or some tool I can use to figure out the problem with these queries? I tried XMLQuire without much luck.
Then again, if some kind soul wants to take a look at the page code (hastily altered to remove sensitive information) and tell me specifically what I'm missing, I'll settle for that:
https://www.dropbox.com/s/peo5i47du1vtsmu/test.html
The text I'm trying to pull is:
teamviewer 12345
Server: Customer Name, ST
Username: administrator
Password: password1
Any ideas? Thanks in advance for your time.
"//div[#class='pbSubsection']//td[#class='data2Col']/text()"
yields
['Connection Details',
'teamviewer 12345 \r',
'\r',
'Server: Customer Name, ST\r',
'Username: administrator\r',
'Password: password1']
I'm on a project working with SonarQube and the given analysis. Can anyone tell me if I can add an own metric which SonarQube uses to analyse my code? For example (I know this one already exists "Comments Balance"):
Tharmar's Metric 00 = "Commented Lines of Code" / "Lines of Code" - OR -Tharmar's Metric 01 = Count the word "Tharmar" used in "Lines of Code"
I tried to find something usefull in the documentation. But the only thing I found was about Manual Measures. I was able to create a new column within the analysis. (proved with the csv-plugin) Understandably, it contains no data.
Is there a way how I can tell SonarQube how to find that data? Or how to calculate that Metric with the given data.
Thanks for any help :)
Manual measure won't answer your need: they are only used to push "simple" data at project level.
What you need to do is to write your own SonarQube plugin to compute your own metrics. Here's the material that will be useful to you:
Coding a Plugin documentation
Sample Plugin that you can use to bootstrap your plugin. Most notably, check the Sensor and Decorator classes.