Difference between revisions of "Provider Portal/Apps"

From Univention Wiki

Jump to: navigation, search
(Content moved to https://docs.software-univention.de/app-provider.html#upload-interface)
Line 1: Line 1:
[[Category:App Center Developer Guide]]
#REDIRECT [[App Center Developer Guide]]
After all that reading, you want to get your App into App Center? Great!
= Provider Portal: Apps =
Univention App Center Provider Portal has a module "Apps" where you can upload your App into the Test App Center. This is something like a beta channel where you can test your App before users can see it and install it in their production environments.
'''To get an account''', just send an e-mail to <appcenter@univention.de> and tell us your name, e-mail, organization. We will create an account for you. Your account's password is chosen by you. Just go to [https://provider-portal.software-univention.de/univention-self-service/?lang=de-DE#passwordreset password reset]. After that, you can log in to the [https://provider-portal.software-univention.de/univention-management-console/#module=appcenter-selfservice::0: App Provider Portal].
All your Apps across all UCS versions are listed in the module. You can also create a new App. Left clicking on an App will let you edit all options concerning your App, including logos, packages. Attributes of the ini file are put into a clear form. Right clicking will open a context menu with further options like editing an older version or adding a new version.
[[File:appcenter-self-service-add-app.png|thumb|Adding a first App to the Apps module]]
;''Note'': In fact, not across all UCS versions. This module only supports UCS 4.1 and higher; Apps for older releases are not managed.
;''Important'': See [[UCS Versions]] to decide which UCS version you want to add App versions for.
[[File:appcenter-self-service-upload.png|thumb|Actions on the top right of an App item in the Gallery. Hover effect shows version information]]
After editing the App version, you can save your changes directly on the Test App Center. This is done without any interaction from Univention. You may install and test your App immediately.
To actually install the App from the Test App Center, you need a running UCS (see [[Testing]]). You also need to activate the Test App Center and deactivate some security features (packages from the Test App Center are not signed by Univention!). Use
univention-install univention-appcenter-dev;
univention-app dev-use-test-appcenter
for this.
;''Note'': If you feel the module is not powerful enough, you can send feedback to appcenter@univention.de.
= Controlling the Apps module from the command line =
The module can be used by calling a script. This is great for integrating Univention App Center Provider Portal into your build chain.
One advantage of using the module is that it gives you easy access to the App as it would look like in the App Center. As good presentation is key to the success of an App, you should still use the module from time to time.
[[File:appcenter-self-service-preview.png|thumb|Actions for App management on the top, including version change, mailing Univention. The center contains the ini file abstraction]]
== Prerequisites ==
You need to download the latest version of the upload script here: https://provider-portal.software-univention.de/appcenter-selfservice/univention-appcenter-control
The script needs:
* Python 2.7 (https://www.python.org/downloads/)
* cURL (https://curl.haxx.se/download.html)
The script can then be used to control the Apps module. On Linux, type:
curl https://provider-portal.software-univention.de/appcenter-selfservice/univention-appcenter-control \
> ~/univention-appcenter-control
chmod +x ~/univention-appcenter-control
~/univention-appcenter-control --help
~/univention-appcenter-control list
== Commands ==
The script has several subcommands. Some actions are only supported in the web module (e.g., creating a completely new App, deleting one App version).
;list: Lists all Apps.
;status: Fetches the current status of an App. It lists all versions along with the information whether the App is in the App Center.
;get: Get the meta information about one particular App. Currently, only JSON is supported as output format; yet, you have to specify this via '''--json'''. The format follows the (rather internal) web call, so you may have to examine the output once to know how to extract the important bits.
;new-version: Add a new version for an existing App. Initially, the new version is an exact copy of the old App version (same ini file with reference to the same logos, same packages - well, except for '''Version''' in the ini file). You may edit the version afterwards. Either by the web module, or by the '''upload''' command. You can specify the "source app version" as well as the new version: ./univention-appcenter-control new-version 4.1/myapp=1.0 4.1/myapp=2.0. If you do not specify a second argument, the version will be set to that of the source version plus an additional "ucs-1" qualifier.
;set: Sets meta information. Currently, only JSON is supported as input format; yet, you have to specify this via '''--json'''. The format follows the (rather internal) web call, so you may have to examine the module with browser developer tools once or twice to know how to pass the correct parameters. (Although a look at the examples should cover most cases - or you read the '''--help''' of this subcommand)
;upload: Uploads files to the Apps module. These files replace the old files. You can upload [[Meta files/ini|ini files]], [[Meta files|logos]], READMEs, [[Docker Apps/Package Based|packages]] and [[Docker Apps/Files|other files]]. The filenames have to match the filename on the App Center server, e.g., a README_UPDATE_DE file has to be named ''README_UPDATE_DE'', an ini file needs to be named like ''myapp.ini''. Logos, thumbnails have to be named after a filename specified in the ini file. For packages, any other package version than the one you just uploaded is deleted. This keeps the repository clean, you can add '''--dont-clear''' to avoid this. You may also upload an archive. In this case, it needs to end with ''.tgz'' or ''.tar.gz''. Technically, every file is extracted and used separately, so you could also just upload every single file instead of the archive.
;''Warning'': Uploading an ini file is discouraged. If Univention changed something on your ini file (new attributes introduced some time ago or typos), these changes are overwritten. Normally you do not need to change anything in your ini file other than the version. And the version is changed automatically by '''new-version'''.
== Credentials ==
All subcommands take additionally '''--username''' and '''--pwdfile''' (a file containing nothing but the password, not even the a newline). This can be used for noninteractive scripts. However, it is even possible to create two files, ''~/.univention-appcenter-user'' and ''~/.univention-appcenter-pwd''. These contain nothing but the username / password. And they are used so that you do not have to type your credentials every time you use the script.
== Examples ==
# creates a new version based on the latest version of myapp
~/univention-appcenter-control new-version 4.2/myapp
# finds out which on which UCS versions this Docker App may be installed
# Note: jq is an external tool: apt-get install jq
# you may parse JSON without it, of course
~/univention-appcenter-control get --json 4.2/myapp | jq '._ini_vars.SupportedUCSVersions'
# creates version 2.0 of myapp based on the (formerly) latest version
~/univention-appcenter-control new-version 4.2/myapp 4.2/myapp=2.0
# sets the DockerImage of the new app
~/univention-appcenter-control set 4.2/myapp=2.0 --json '{"DockerImage": "mycompany/myimage:2.0"}'
# copies myapp Version 1.0 from UCS 4.2 to UCS 4.3.
~/univention-appcenter-control new-version 4.2/myapp=1.0 4.3/myapp=1.0
# uploads all README files in the current folder to the latest version
# myapp in UCS 4.2
~/univention-appcenter-control upload 4.2/myapp README*
# uploads myapp-server.deb. Any other myapp-server package will be deleted
~/univention-appcenter-control upload 4.2/myapp myapp-server.deb
# uploads an image. Will be rejected if this image is not specified somewhere
# in the ini file. Warning (/ Feature): This may overwrite the logo for other
# version using the same logo name, too.
~/univention-appcenter-control upload 4.2/myapp=1.0 myapp.svg
# uploads an archive. All files in this archive will be used. The folder
# structure does not matter.
~/univention-appcenter-control upload 4.2/myapp app.tar.gz 

Latest revision as of 07:55, 3 December 2018

Personal tools