Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

civicrm.drush.inc - Add 'civicrm-pipe' subcommand #652

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

totten
Copy link
Member

@totten totten commented Jan 14, 2022

Add support for subcommand drush civicrm-pipe (drush cvpipe)

Complements civicrm/civicrm-core#22262. Similar to civicrm/cv#110.

Before

Longer commands:

drush ev 'civicrm_initialize(); Civi::pipe();'
drush ev 'civicrm_initialize(); Civi::pipe("vlu");'

After

Shorter commands:

drush cvpipe
drush cvpipe vlu

Comment

If the command is successful, it will show a welcome/header line, e.g.

{"Civi::pipe":{"v":"5.47.alpha1","l":["nologin"],"u":"untrusted"}}

You may then send JSON-RPC 2.0 requests, e.g.

// Send request for `echo("hello world")`
{"jsonrpc":"2.0","method":"echo","params":["hello world"],"id":null}
// Receive response "hello world"
{"jsonrpc":"2.0","result":["hello world"],"id":null}

Add support for subcommand `drush civicrm-pipe` (`drush cvpipe`)

Before
------------

Longer commands:

```bash
drush ev 'civicrm_initialize(); Civi::pipe();'
drush ev 'civicrm_initialize(); Civi::pipe("vlu");'
````

After
-------------

Shorter commands:

```bash
drush cvpipe
drush cvpipe vlu
```

Comment
--------------

If the command is successful, it will show a welcome/header line, e.g.

```javascript
{"Civi::pipe":{"v":"5.47.alpha1","l":["nologin"],"u":"untrusted"}}
```

You may then send JSON-RPC 2.0 requests, e.g.

```javascript
// Send request for `echo("hello world")`
{"jsonrpc":"2.0","method":"echo","params":["hello world"],"id":null}
// Receive response "hello world"
{"jsonrpc":"2.0","result":["hello world"],"id":null}
```
@civibot
Copy link

civibot bot commented Jan 14, 2022

(Standard links)

@totten
Copy link
Member Author

totten commented Jan 14, 2022

@seamuslee001 The test-output here looks OK (ie all ok 123... and EXITCODES=""). Is the failure something to do with the job-configuration?

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@colemanw colemanw merged commit 842afd7 into civicrm:7.x-master Mar 9, 2022
@totten totten deleted the 7.x-master-pipe branch March 9, 2022 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants