Basic usage of rp-cli

Example helloworld-binding with rp-cli

After following the “getting started for a developer” chapter, you will have at least one project with one application. The application choosen for the example is helloworld-binding.

List your projects

You can list your projects with rp-cli:

# List the projects available for the user on redpesk infrastructure
$ rp-cli projects list

ID                                       Slug                                    Name                                    Version         Type
bfdcddbd-120c-41b2-b5e7-f53b6f0cf292     my-awesome-project                      my-awesome-project                      [Not set]       standard-applications
ea5cbf8c-7b6f-4063-b236-4eb70b2be1ce     my-test-project                         My Test Project                         [Not set]       standard-applications
98a31932-6077-4bdb-b5bd-1099a55931eb     my-image-project                        My Image Project                        [Not set]       standard-images

The project created before in the “getting started for a developer” part is named My awesome project, with the slug my-awesome-project.

List your applications

You can also list your applications like below:

$ rp-cli applications list

ID                                       Name                    Slug                    Type            Project
986e735c-4b46-4ab2-8be1-7e67ea833317     Helloworld binding      helloworld-binding      standard        my-awesome-project
6abde310-c253-4209-b901-d65905d4972f     Mustach                 mustach                 standard        my-test-project

This command shows your application Helloworld binding in the project described before.

Get informations about an application

To have informations about this application, just use the following command:

$ rp-cli applications get helloworld-binding --project my-awesome-project -v

ID:                          986e735c-4b46-4ab2-8be1-7e67ea833317
Name:                        Helloworld binding
Package Name:                helloworld-binding
Slug:                        helloworld-binding
Type:                        standard
Parent project:              my-awesome-project
Description:                 A binding example, implemented in a redpesk® context
Distributions:               redpesk-lts-arz-1.0-update [Mand]
Auto on board tests:         OFF [Opt]
Ignore missing redtest RPM:  OFF
Auto security audits tests:  OFF [Opt]
AutoRSrpmBuild:              "dist_branch":true,"meta_changes":true,"no_srpm_bld":true,"pkg_changes":true
Audits settings:             [Not set]
Ignore check deps result:    OFF
Creation time:               2023-06-20 10:21:53.269993 +0000 UTC
Update time:                 2023-06-20 14:33:31.084615 +0000 UTC
Bookmarked:                  false
Build type:                  standard_build_cross
Source URL:                  https://github.com/redpesk-samples/helloworld-binding.git
Source Revision:             master-next
Specfile type:               relative_path
External Specfile:           conf.d/packaging/helloworld-binding.spec
Services:

 - Name: setverrel
 - Parameters:
    release:     true
    version:     true

 - Name: specfile_linter
 - Parameters:
    enable:      true

Build an application

To build the application Helloworld binding in the project My awesome project, just execute this command:

$ rp-cli applications build helloworld-binding --project my-awesome-project
-- Application build requested by user --
Building the "helloworld-binding" application...
[STATUS CHANGE] Build: 60   [redpesk-lts-arz-1.0-update] -- open     -- Subtasks: x86_64 [open    ], aarch64 [open    ]
[STATUS CHANGE] Build: 60   [redpesk-lts-arz-1.0-update] -- open     -- Subtasks: x86_64 [open    ], aarch64 [open    ]
[STATUS CHANGE] Build: 60   [redpesk-lts-arz-1.0-update] -- open     -- Subtasks: x86_64 [closed  ], aarch64 [open    ]
[STATUS CHANGE] Build: 60   [redpesk-lts-arz-1.0-update] -- open     -- Subtasks: x86_64 [closed  ], aarch64 [closed  ]
[STATUS CHANGE] Build: 60   [redpesk-lts-arz-1.0-update] -- done     -- Subtasks: x86_64 [closed  ], aarch64 [closed  ]
[RESULT][SUCCESS ] Build: 60   [redpesk-lts-arz-1.0-update] -- done     -- Subtasks: x86_64 [closed  ], aarch64 [closed  ]

Test an application

After building the application, you may want to launch some tests. The command to launch the tests is the following:

$ rp-cli applications test helloworld-binding --project my-awesome-project
-- Application test requested by user --
Testing the application on build 10...

[STATE CHANGE] pending      -- TOTAL => 0   
[STATE CHANGE] deploying    -- TOTAL => 0   
[STATE CHANGE] started      -- TOTAL => 0   
[STATE CHANGE] started      -- TOTAL => 0   
[STATE CHANGE] success      -- TOTAL => 10 
------- Application test succeeded ------

Other usages of rp-cli

In the previous part, you retrieved a project with its application from the redpesk infrastructure, in order to build it. With the rp-cli tool, it is also possible to add projects and applications without going through the user interface, and many other things. If you want more information about rp-cli, use the help with:

$ rp-cli help

You may also find an advanced documentation more detailed than this previous example, as well as a list of commands available with rp-cli.