I have gone through numerous post on triggering Jenkins build when a PR is raised in github.
I have checked Git hub Pull Request Builder Option in jenkins job and also provided ${sha1} as branch.
Apart from above , I have added webhook and jenkins Github plugin as service in my repo.
Anything else being missed here . I dont see build getting triggered when PR is raised.
You can use Generic Webhook Trigger Plugin to do that.
Setup a webhook in GitHub.
Configure Generic Webhook Trigger Plugin with variable action with expression $.action
Configure the filter text as $action and the filter regexp as: ^(opened|reopened|synchronize)$
Now this job will run any time a PR is opened, re-opened or new commits are pushed.
You can also pick other values from the webhook like:
| variable | expression | expressionType | defaultValue | regexpFilter |
| action | $.action | JSONPath | | |
| pr_id | $.pull_request.id | JSONPath | | |
| pr_state | $.pull_request.state | JSONPath | | |
| pr_title | $.pull_request.title | JSONPath | | |
| pr_from_ref | $.pull_request.head.ref | JSONPath | | |
| pr_from_sha | $.pull_request.head.sha | JSONPath | | |
| pr_from_git_url | $.pull_request.head.repo.git_url | JSONPath | | |
| pr_to_ref | $.pull_request.base.ref | JSONPath | | |
| pr_to_sha | $.pull_request.base.sha | JSONPath | | |
| pr_to_git_url | $.pull_request.base.repo.git_url | JSONPath | | |
| repo_git_url | $.repository.git_url | JSONPath | | |
There is a test case showing this feature here: https://github.com/jenkinsci/generic-webhook-trigger-plugin/blob/master/src/test/resources/org/jenkinsci/plugins/gwt/bdd/github/github-pull-request.feature
Related
cant add name of the authorized network whie using gcloud sql patch command
stage("Editing Authorized Networks of ${instance_name} CloudSQL") {
steps {
sh "gcloud sql instances patch ${instance_name} --authorized-networks ${network_name}=${ip_range}"
}
}
tried this
gcloud sql instances patch instanceid --authorized-networks Rajeev-Home=0.0.0.0/0
getting this
ERROR: (gcloud.sql.instances.patch) argument --authorized-networks: Bad value [Rajeev-Home=0.0.0.0/0]: Must be specified in CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24).
Usage: gcloud sql instances patch INSTANCE [optional flags]
optional flags may be --activation-policy | --active-directory-domain |
--assign-ip | --async | --audit-bucket-path |
--audit-retention-interval | --audit-upload-interval |
--authorized-gae-apps | --authorized-networks |
--availability-type | --no-backup | --backup-location |
--backup-start-time | --clear-authorized-networks |
--clear-database-flags | --clear-gae-apps |
--clear-password-policy | --connector-enforcement |
--cpu | --database-flags | --database-version |
--deletion-protection |
--deny-maintenance-period-end-date |
--deny-maintenance-period-start-date |
--deny-maintenance-period-time | --diff |
--enable-bin-log | --enable-database-replication |
--enable-google-private-path |
--enable-password-policy |
--enable-point-in-time-recovery | --follow-gae-app |
--gce-zone | --help |
--insights-config-query-insights-enabled |
--insights-config-query-plans-per-minute |
--insights-config-query-string-length |
--insights-config-record-application-tags |
--insights-config-record-client-address |
--maintenance-release-channel | --maintenance-version |
--maintenance-window-any | --maintenance-window-day |
--maintenance-window-hour | --memory | --network |
--password-policy-complexity |
--password-policy-disallow-username-substring |
--password-policy-min-length |
--password-policy-password-change-interval |
--password-policy-reuse-interval | --pricing-plan |
--remove-deny-maintenance-period | --replication |
--require-ssl | --retained-backups-count |
--retained-transaction-log-days | --secondary-zone |
--storage-auto-increase | --storage-size | --tier |
--zone
I am working on a mobile CI/CD and using Fastlane for the scripting / actions support. The organization wants to put the Android and IOS artifacts in the Nexus Repository Manager, so I looked for an action and/or plugin for FastLane. Sure enough there is an action: Fastlane action for nexus upload and a plugin (source) in GitHub: Source for nexus_upload plugin to Fastlane.
I am unable to get the action to work and it throws a mysterious error:
$ bundle exec fastlane uploadToServer
[✔] 🚀
+----------------------------------+---------+------------------+
| Used plugins |
+----------------------------------+---------+------------------+
| Plugin | Version | Action |
+----------------------------------+---------+------------------+
| fastlane-plugin-upload_to_server | 0.1.6 | upload_to_server |
+----------------------------------+---------+------------------+
[13:30:01]: ------------------------------
[13:30:01]: --- Step: default_platform ---
[13:30:01]: ------------------------------
[13:30:01]: Lane name 'env' is invalid! Invalid names are run, init, new_action, lanes, list, docs, action, actions, enable_auto_complete, new_plugin, add_plugin, install_plugins, update_plugins, search_plugins, help, env, update_fastlane.
[!] Lane name 'env' is invalid
Try the following to get the parameters.
enter $ fastlane action nexus_upload
[✔] 🚀
[13:35:41]: fastlane detected a Gemfile in the current directory
[13:35:41]: However, it seems like you didn't use `bundle exec`
[13:35:41]: To launch fastlane faster, please use
[13:35:41]:
[13:35:41]: $ bundle exec fastlane action nexus_upload
[13:35:41]:
[13:35:41]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
+----------------------------------+---------+------------------+
| Used plugins |
+----------------------------------+---------+------------------+
| Plugin | Version | Action |
+----------------------------------+---------+------------------+
| fastlane-plugin-upload_to_server | 0.1.6 | upload_to_server |
+----------------------------------+---------+------------------+
Loading documentation for nexus_upload:
+--------------------------------------------------------------------------+
| nexus_upload |
+--------------------------------------------------------------------------+
| Upload a file to "Sonatype Nexus platform" (https://www.sonatype.com 🔗) |
| |
| Created by xfreebird, mdio |
+--------------------------------------------------------------------------+
+----------------------+-----------------------------------------------+-------------------------------+---------+
| nexus_upload Options |
+----------------------+-----------------------------------------------+-------------------------------+---------+
| Key | Description | Env Var | Default |
+----------------------+-----------------------------------------------+-------------------------------+---------+
| file | File to be uploaded to Nexus | FL_NEXUS_FILE | |
| repo_id | Nexus repository id e.g. artefacts | FL_NEXUS_REPO_ID | |
| repo_group_id | Nexus repository group id e.g. com.company | FL_NEXUS_REPO_GROUP_ID | |
| repo_project_name | Nexus repository commandect name. Only | FL_NEXUS_REPO_PROJECT_NAME | |
| | letters, digits, underscores(_), hyphens(-), | | |
| | and dots(.) are allowed | | |
| repo_project_version | Nexus repository commandect version | FL_NEXUS_REPO_PROJECT_VERSION | |
| repo_classifier | Nexus repository artifact classifier | FL_NEXUS_REPO_CLASSIFIER | |
| | (optional) | | |
| endpoint | Nexus endpoint e.g. http://nexus:8081 | FL_NEXUS_ENDPOINT | |
| mount_path | Nexus mount path (Nexus 3 instances have | FL_NEXUS_MOUNT_PATH | /nexus |
| | this configured as empty by default) | | |
| username | Nexus username | FL_NEXUS_USERNAME | |
| password | Nexus password | FL_NEXUS_PASSWORD | |
| ssl_verify | Verify SSL | FL_NEXUS_SSL_VERIFY | true |
| nexus_version | Nexus major version | FL_NEXUS_MAJOR_VERSION | 2 |
| verbose | Make detailed output | FL_NEXUS_VERBOSE | false |
| proxy_username | Proxy username | FL_NEXUS_PROXY_USERNAME | |
| proxy_password | Proxy password | FL_NEXUS_PROXY_PASSWORD | |
| proxy_address | Proxy address | FL_NEXUS_PROXY_ADDRESS | |
| proxy_port | Proxy port | FL_NEXUS_PROXY_PORT | |
+----------------------+-----------------------------------------------+-------------------------------+---------+
* = default value is dependent on the user's system
More information can be found on https://docs.fastlane.tools/actions/nexus_upload here
Missing parameters will result in a dialog for the needed parameters:
$ bundle exec fastlane run nexus_upload username:"mobibob" password:"secretpassword" file:"./app/build/outputs/apk/debug/app-debug.apk"
[✔] 🚀
+----------------------------------+---------+------------------+
| Used plugins |
+----------------------------------+---------+------------------+
| Plugin | Version | Action |
+----------------------------------+---------+------------------+
| fastlane-plugin-upload_to_server | 0.1.6 | upload_to_server |
+----------------------------------+---------+------------------+
[13:34:22]: --------------------------
[13:34:22]: --- Step: nexus_upload ---
[13:34:22]: --------------------------
[13:34:22]: To not be asked about this value, you can specify it using 'repo_id'
[13:34:22]: Nexus repository id e.g. artefacts:
The GitHub page for web-interactive issue filtering describes commenter and an involved filters.
However, the GitHub issues API page lists the following parameters, which don't seem to include commenter:
+-----------+-------------------+
| Name | Type |
+-----------+-------------------+
| milestone | integer or string |
| state | string |
| assignee | string |
| creator | string |
| mentioned | string |
| labels | string |
| sort | string |
| direction | string |
| since | string |
+-----------+-------------------+
I'd like to build a Flow such as represented in the following asciiFlow :
Custom Flow
+-------------------------------------------------------------+
| |
| +------------------+ |
| | | |
| | +---------------------------------------------->
| | | |
+---------> CustomFanOut2 | +--------------------+ |
| | | | | |
| | +-------> CustomSink | |
| +------------------+ | | |
| +--------------------+ |
| |
+-------------------------------------------------------------+
Of course, I can use GraphDSL, but it boils down to just putting a sink on one of the outlets for CustomFanOut2, so it seems that there could be a method
Graph[FanOutShape2[I, O0, O1], Mat1].to1(sink: Sink[O1, Any]: Flow[I, O0, Mat1]
or equivalents on other inlets and outlets, for other graphs than Source, Flow, Sink and Bidi.
Does such a method exist, or could it exist in some future version of akka-stream? In the case where it would not be possible, why is it so?
I can see that it is possible to add metadata to a Rackspace virtual machine instance.
I want to get a list of running instances, filtered by a particular metatag value.
I can't see how to do so in the documentation however.
is it possible?
You should be able to do so using the openstack client... but it depends on which metatag you're interested in.
You can get a list of all servers:
openstack server list
Will spit something like
+--------------------------------------+------------------+--------+-----------------------------------------------------------------------------------------------------------+
| ID | Name | Status | Networks |
+--------------------------------------+------------------+--------+-----------------------------------------------------------------------------------------------------------+
| 97606ae9-7f18-4a3c-903a-1583d446119b | trysmallwin | ERROR | |
| cb78b8d5-2f03-4a3f-ab26-f389acbd0b76 | Win-try again | ERROR | public=2607:f298:5:101d:f816:3eff:fe9e:5cd4, 208.113.133.90, 2607:f298:5:101d:f816:3eff:fe36:da45, |
| | | | 208.113.133.93, 2607:f298:5:101d:f816:3eff:fe40:57d5, 208.113.133.95 |
| 040751d1-c4c5-47aa-8dec-1d69a468be1c | hnxhdkwskrvwvdwr | ACTIVE | public=2607:f298:5:101d:f816:3eff:fe60:324, 208.113.130.52 |
+--------------------------------------+------------------+--------+-----------------------------------------------------------------------------------------------------------+
note the ID of the server and investigate deeper:
openstack server show 040751d1-c4c5-47aa-8dec-1d69a468be1c
+--------------------------------------+------------------------------------------------------------+
| Field | Value |
+--------------------------------------+------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | iad-2 |
| OS-EXT-STS:power_state | Running |
| OS-EXT-STS:task_state | None |
| OS-EXT-STS:vm_state | active |
| OS-SRV-USG:launched_at | 2016-07-26T17:32:01.000000 |
| OS-SRV-USG:terminated_at | None |
| accessIPv4 | |
| accessIPv6 | |
| addresses | public=2607:f298:5:101d:f816:3eff:fe60:324, 208.113.130.52 |
| config_drive | True |
| created | 2016-07-26T17:31:51Z |
| flavor | gp1.semisonic (50) |
| hostId | e1efd75d1e8f6a7f5bb228a35db13647281996087d39c65af8ce83d9 |
| id | 040751d1-c4c5-47aa-8dec-1d69a468be1c |
| image | Ubuntu-14.04 (03f89ff2-d66e-49f5-ae61-656a006bbbe9) |
| key_name | stef |
| name | hnxhdkwskrvwvdwr |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| project_id | d2fb6996496044158cf977c2129c8660 |
| properties | |
| security_groups | [{u'name': u'default'}] |
| status | ACTIVE |
| updated | 2016-07-26T17:32:01Z |
| user_id | 5b2ca246f39a425f9a833460bf322603 |
+--------------------------------------+------------------------------------------------------------+
openstack --f json will output the same stuff but in json format that you can more easily manipulate programmatically.
HTH