1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

Merge pull request #1568 from YunoHost/drop-add-or-update-script

Remove add_or_update script, update README instructions about adding apps to the catalog
This commit is contained in:
Éric Gaspar 2023-01-03 18:19:36 +01:00 committed by GitHub
commit 6e0a5a9bb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 118 deletions

View file

@ -23,26 +23,36 @@ https://app.yunohost.org/default/.
N.B.: The YunoHost project will **NOT** integrate in its catalog applications that are not
based on free-software upstreams.
N.B.2: We strongly encourage you to transfer the ownership of your repository to
the YunoHost-Apps organization on GitHub, such that the community will help you
with keeping your app working and up to date with packaging evolutions.
To add your application to the catalog:
* Fork this repository and edit the [apps.json](https://github.com/YunoHost/apps/tree/master/apps.json) file
* Add your app's ID and git information at the right alphabetical place
* Indicate the app's functioning state: `notworking`, `inprogress`, or `working`
* *Do not* add the level entry by yourself. Our automatic test suite ("the CI") will handle it.
* Indicate the app category, which you can pick from `categories.yml`
* Indicate any anti-feature that your app may be subject to, see `antifeatures.yml` (or remove the `antifeatures` key if there's none)
* Indicate if your app can be thought of as an alternative to popular proprietary services (or remove the `potential_alternative_to` key if there's none)
* *Do not* add the `level` entry by yourself. Our automatic test suite ("the CI") will handle it.
* Create a [Pull Request](https://github.com/YunoHost/apps/pulls/)
App example addition:
```json
"wallabag": {
"url": "https://github.com/abeudin/wallabag_ynh",
"state": "working"
"your_app": {
"antifeatures": [
"deprecated-software"
],
"potential_alternative_to": [
"YouTube"
],
"category": "pick_the_appropriate_category",
"state": "working",
"url": "https://github.com/YunoHost-Apps/your_app_ynh"
}
```
N.B.: We strongly encourage you to transfer the ownership of your repository to
the YunoHost-Apps organization on GitHub, such that the community will help you
with keeping your app working and up to date with packaging evolutions.
N.B.2: Implicitly, the catalog publishes the `HEAD` of branch `master`
N.B: Implicitly, the catalog publishes the `HEAD` of branch `master`
(this can be overwritten by adding keys `branch` and `revision`).
Therefore, **be careful that any commit on the `master` branch will automatically be published**.
**We strongly encourage you to develop in separate branches**, and only
@ -50,28 +60,9 @@ merge changes that were carefully tested. Get in touch with the Apps group to
obtain an access to the developer CI where you'll be able to test your app
easily.
### Updating apps' level in the catalog
### Updating apps levels in the catalog
App packagers should *not* manually set their apps' level. The levels of all the apps are automatically updated once per week on Friday.
#### Helper script
You can use the <code>add_or_update.py</code> Python script to add or update
your app from one of the 2 JSON files.
Usage:
```bash
./add_or_update.py apps.json [github/gitlab url OR app name [github/gitlab url OR app name [github/gitlab url OR app name ...]]]
```
### How to help translating
Update on Nov. 2020: this part is broken / not maintained anymore for the
moment...
We invite you to use [translate.yunohost.org](https://translate.yunohost.org/)
instead of doing Pull Request for files in `locales` folder.
App packagers should *not* manually set their apps' level. The levels of all the apps are automatically updated once per week on Friday, according to the results from the official app CI.
### Apps flagged as not-maintained

View file

@ -1,88 +0,0 @@
#!/usr/bin/env python2
import os
import sys
import json
from urllib2 import urlopen
from urlparse import urlparse
states = {
1: "notworking",
2: "inprogress",
3: "working",
}
if __name__ == '__main__':
if not len(sys.argv[1:]):
print("I need a json file as first argument and a list of github urls")
sys.exit(0)
if len(sys.argv[1:]) < 2:
print("I need a list of github urls or app names after the json file")
sys.exit(0)
if not os.path.exists(sys.argv[1]):
print("The json file '%s' doesn't exist" % sys.argv[1])
content = json.load(open(sys.argv[1], "r"))
for url in sys.argv[2:]:
if not url.startswith("http"):
if url in content:
url = content[url]["url"]
else:
print "App name '%s' not in %s" % (url, sys.argv[1])
sys.exit(1)
if url.endswith("/"):
url = url[:-1]
if url.endswith(".git"):
url = url[:-len(".git")]
if not url.startswith("https://github.com"):
sys.stderr.write("WARNING: url '%s' doesn't starts with https://github.com, we will try with gitlab api\n" % url)
owner, repo = filter(None, url.split("/"))[-2:]
project_name = filter(None, url.split("/"))[-1].replace("_ynh", "")
if url.startswith("https://github.com"):
git_data = json.load(urlopen("https://api.github.com/repos/%(owner)s/%(repo)s/commits" % {"owner": owner, "repo": repo}))
revision = git_data[0]["sha"]
else:
parsed_uri = urlparse(url)
base_url = '{uri.scheme}://{uri.netloc}/'.format(uri=parsed_uri)
# Try with gitlab api
git_data = json.load(urlopen("%(base_url)sapi/v4/projects/%(owner)s%%2F%(repo)s/repository/commits/HEAD" % {"base_url": base_url, "owner": owner, "repo": repo}))
revision = git_data["id"]
if project_name not in content:
content[project_name] = {}
else:
print("INFO: project already in '%s', I'm updating it" % sys.argv[1])
content[project_name]["url"] = url
content[project_name]["revision"] = revision
content[project_name]["branch"] = "master"
if sys.argv[1] == "official.json":
content[project_name]["state"] = "validated"
else:
got_state = False
while not got_state:
answer = input("Give me a state for this repository (digit or name) in:\n%s\n\nState: " % "\n".join(["%s: %s" % x for x in sorted(states.items(), key=lambda x: x[0])]) + "\n")
if answer in states:
answer = states[answer]
got_state = True
elif answer in states.values():
got_state = True
else:
print("Invalid state.\n")
content[project_name]["state"] = answer
open(sys.argv[1], "w").write("\n".join(json.dumps(content, indent=4, sort_keys=True).split(" \n")) + "\n")
os.system("git diff")