I'm creating a Multibranch Pipeline job with JobDSL , and I want to specify my github url , but it's not working.
The job which I created it display "https://github.com/jackson/multibranch-Pipeline.git" ,
not https://mycompanygithub.com/jackson/multibranch-Pipeline.git
Any idea how theses other parameters can be added in ?
or other solution
multibranchPipelineJob('Jenkins/Multibranch-Pipeline/GitHub_Basic') {
branchSources {
branchSource {
source {
github {
repositoryUrl('https://mycompanygithub.com')
credentialsId('mycredentialsid')
repoOwner('jackson')
repository('multibranch-Pipeline.git')
configuredByUrl(true)
}
}
}
}
}
Actually your configuration is correct, your are just missing one parameter: apiUri
// The server to connect to.
apiUri(String value)
Without it, it takes the default github.com as the base domain for the repository regardless of what is configured in the repositoryUrl parameter.
Try the following:
multibranchPipelineJob('Jenkins/Multibranch-Pipeline/GitHub_Basic') {
branchSources {
branchSource {
source {
github {
apiUri('https://mycompanygithub.com/api/v3')
repositoryUrl('https://mycompanygithub.com')
credentialsId('mycredentialsid')
repoOwner('jackson')
repository('multibranch-Pipeline.git')
configuredByUrl(true)
}
}
}
}
}
By the way you can see the full documentation of the Job DSL of this plugin at the following URL on your own Jenkins server:
YOUR_JENKINS_URL/plugin/job-dsl/api-viewer/index.html#method/javaposse.jobdsl.dsl.DslFactory.multibranchPipelineJob
Related
My company is using the new GitHub projects beta and we're really enjoying the experience, but we're facing a problem and it is how to export the data from a specific view (or even all the data) with all the custom columns that we have.
The ideal solution for us is to get this same data as JSON using the API.
Using https://api.github.com/orgs/.../issues does not work because the issues does not have the custom columns that we create inside the project, and https://api.github.com/orgs/.../projects does not have the data of the issues.
Any idea or work-around to get this data easily using APIs?
After reading the feedback post on GitHub, it's not possible to do it with API, just GraphQL, at least for now.
So my problem was solved with this useful code.
To get the first 100 project from your organization and their ID:
query{
organization(login: "MY_ORG") {
projectsNext(first: 20) {
nodes {
id
title
}
}
}
}
To get the first 100 issues and drafts from a specific project:
{
node(id: "My_Project_ID") {
... on ProjectNext {
items(first: 100, after: null) {
edges {
cursor
}
nodes {
content {
... on Issue {
title
assignees(first: 1) {
nodes {
login
}
}
milestone {
title
}
labels(first: 5) {
nodes {
name
}
}
repository{
name
}
}
}
fieldValues(first: 15) {
nodes {
value
projectField {
name
settings
}
}
}
}
}
}
}
}
Those codes can be easily tested in THIS LINK
I am trying to publish a package on Github using the Gradle part in Android Studio. It is not my first one but I cannot find what the difference is to the previous ones and why I get this error.
I can successfully run the build step and the files are in the output folder. However, when I run the step "publish", I get the following error:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task
':config_properties_reader_android:publishBarPublicationToGitHubPackagesRepository'.
Failed to publish publication 'bar' to repository 'GitHubPackages'
-> Username must not be null!
The only difference I could find was that my module folder with the files to publish contains three instead of the usual two files:
Those two I would expect:
config_properties_reader_android/build/outputs/aar/config_properties_reader_android-debug.aar
config_properties_reader_android/build/outputs/aar/config_properties_reader_android-release.aar
And this one seems odd:
config_properties_reader_android/build/outputs/aar/configpropertiesreader-debug.aar
My gradle file looks like this:
apply plugin: 'maven-publish'
def githubProperties = new Properties()
githubProperties.load(new FileInputStream(rootProject.file("github.properties")))
def getVersionName = { ->
return "1.0.0"
}
def getArtificatId = { ->
return "config_properties_reader_android"
}
publishing {
publications {
bar(MavenPublication) {g
groupId 'com.MyGithubRepo'
artifactId getArtificatId()
version getVersionName()
artifact("$buildDir/outputs/aar/${getArtificatId()}-release.aar")
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/MyGithubRepo/ConfigPropertiesReader.Android")
credentials {
username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER")
password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY")
}
}
}
}
And my github.properties file also contains the usual:
gpr.user=myUser
gpr.key=myKey
Could the third file in the ouput folder be the problem? I do not see how the username should have anything to do with it but I have no idea where to look in order to find the error.
Try this in github.properties file
gpr.usr=myUser
gpr.key=myKey
Change gpr.user => gpr.usr
Also, use your git user-id in gpr.usr
and use git personal access token in gpr.key
i also have this issue this change solve mine problem
check the below line and replace the username and password it will work
file name is build.gradle
maven {
url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
credentials {
username 'braintree_team_sdk'
password 'AKCp8jQcoDy2hxSWhDAUQKXLDPDx6NYRkqrgFLRc3qDrayg6rrCbJpsKKyMwaykVL8FWusJpp'
}
}
I am trying to automate some stuff that will require to get the current images from a GitHub private repo.
Ideally, I'd iterate over the root directory and, for all images, get the URL for the RAW file.
For example:
For this image: https://github.com/Flow2015/logo/blob/master/flowImage01.jpg
I would like to get https://raw.githubusercontent.com/Flow2015/logo/master/flowImage01.jpg
If the URL is not available, I could get around with getting the binary content. However, I couldn't find a way to do that either.
As an example, this is basically how I am "finding" files that I want de details of.
{
repository(owner: "Flow2015", name: "logo") {
name
object(expression: "master:") {
... on Tree {
entries {
name
object{
... on Blob {
text
}
}
}
}
}
}
}
I understand that I could build the URL using Repo/branch/filename, I'm just trying to find a safe way if there is one.
I have been investigating the graphql API call these days.
I have completed the tutorial of GitHub.
My question is that there must be some starting point for each graphql call.
in https://developer.github.com/v4/guides/using-the-explorer/
# the starting point is the object viewer
query {
viewer {
login
name
}
}
in https://developer.github.com/v4/guides/forming-calls/
# the starting point is the object repository
query {
repository(owner:"octocat", name:"Hello-World") {
issues(last:20, states:CLOSED) {
edges {
node {
title
url
labels(first:5) {
edges {
node {
name
}
}
}
}
}
}
}
}
What is the set of the possible objects which can be the starting point of a "query" or "mutation" in GraphQl call in Github ?
It seems the whole documentation of Github didn't mention this.
Go to Github GraphQL API explorer in here
Login and click the Docs button in the top-right corner
Click the Query or Mutation and it will show you all the available fields of the root Query and Mutation (i.e. starting point in your terminology) :
Hi I'm new to F5 iRule.
I'm trying to redirect
https://website1.com/userid=1234
to
https://website2.com/userid=1234
such that whatever value the userid may have will be carried over after redirection.
I'm thinking userid value should be set to a variable.
Can someone share what code to use? Thanks!
So https://website1.com/userid=8888 should go to https://website2.com/userid=8888 and so on.
You shouldn't need a variable if that pattern is consistent. A simple rule would be:
when HTTP_REQUEST {
if { [HTTP::host] eq "website1.com" } {
HTTP::redirect https://websitesite2.com[HTTP::uri]
}
}
However, if you are on v11.4+, you really should use a local traffic policy for this as it is more performant as a built-in feature of TMOS.
ltm policy sample_site_redirect {
controls { forwarding }
last-modified 2018-12-20:09:33:02
requires { http }
rules {
full_uri_redirect {
actions {
0 {
http-reply
redirect
location tcl:https://website2.com[HTTP::uri]
}
}
conditions {
0 {
http-host
host
values { website1.com }
}
}
}
}
status published
strategy first-match
}
if all traffic to the virtual server this rule or policy is attached to is intended for website1 only, you can eliminate those conditions. I didn't want to assume. If it's only the URI starting with /user= that you want to match, and redirect on, you can do that this way:
when HTTP_REQUEST {
if { ([HTTP::host] eq "website1.com") && ([string tolower [HTTP::uri]] starts_with "/user=") } {
HTTP::redirect https://website2.com[HTTP::uri]
}
}