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
93aafeaf-992e-4c96-910a-7d01f46bd9e6 	 my-awesome-project-1 	 My awesome project
acd0c8a6-4ad6-4db2-a7ad-25be27daf958 	 my-test-project 	 My Test Project

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

List your applications

You can also list your applications like below:

$ rp-cli applications list

ID					 Name			 Slug			 Project
a3968638-58ae-41bd-9d9f-2e605fdceb87 	 Helloworld binding 	 helloworld-binding 	 my-awesome-project-1
b33d4559-02cd-48c1-8e12-0a9c2474b393 	 Mustach             	 mustach             	 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-1 -v

ID:                  a3968638-58ae-41bd-9d9f-2e605fdceb87
Name:                Helloworld binding
Package Name:        helloworld-binding
Slug:                helloworld-binding
Parent project:      my-awesome-project-1
Description:         A binding example for AGL, implemented in a redpesk® context
Source URL:          https://github.com/redpesk-samples/helloworld-binding.git
Source Revision:     master
External Specfile:   https://raw.githubusercontent.com/redpesk-samples/helloworld-binding/master/conf.d/packaging/helloworld-binding.spec
Distributions:       redpesk-devel-arz [Opt]
Autotests:           OFF
Creation time:       2021-09-17 09:28:02.715967 +0000 UTC
Update time:         2021-09-17 09:28:10.366422 +0000 UTC
Bookmarked:          false

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-1 -v

-- Application build requested by user --
Building the "helloworld-binding" application...

---------- Build event received ---------
Build ID:	 109585
Application ID:	 helloworld-binding
Distribution:	 redpesk-devel-arz
Status:		 open

Subtask:			 srpm
Subtask state:			 open
Subtask method:			 buildSRPMFromSCM
Subtask method description:	 Packaging sources into SRPM package
-----------------------------------------

[...]

Subtask method:			 buildArch
Subtask method description:	 Building native application
-----------------------------------------

--------- Application build done --------

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-1 -v

-- Application test requested by user --
No build ID specified, get the latest one...			109585
Testing the "helloworld-binding" application on build 109585...

---------- Test has been added ----------
Test ID:		 98
Application ID:		 helloworld-binding
Build ID:		 109585
Status:			 pending
Succeeded tests number:	 0
Failed tests number:	 0
Skipped tests number:	 0
Total tests number:	 0
-----------------------------------------

[...]

Status:			 success
Succeeded tests number:	 9
Failed tests number:	 0
Skipped tests number:	 1
Total tests number:	 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.