Skip to content

Commit

Permalink
doc and osgeo credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jul 23, 2019
1 parent 225a2df commit 2396fd3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 22 deletions.
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,40 @@
Contains scripts to perform automated testing and deployment for QGIS plugins.
These scripts are written for and tested on GitHub, Travis-CI and Transifex.

## Base functionality

- Deploy plugin releases on QGIS official plugin repository
- Publish plugin in Github releases, option to deploy a custom repository
- Easily integrated in Travis-CI
- Completely handle translations with Transifex: create the project and the languages, pull and push translations

# Quickstart guide
# Base functionality


# QRC and UI files
## QRC and UI files

- any .qrc file in the source top directory (plugin_path) will be compiled and output as filename_rc.py. You can then import it using ``import plugin_path.resources_rc``
- currently, qgis-plugin-ci does not compile any .ui file.

# Debug
## Publishing plugins

When releasing, you can publish the plugin :

1. In the official QGIS plugin repository. You need to provide user name and password for your Osgeo account.
2. As a custom repository in Github releases and which can be added later in QGIS. The address will be: https://github.com/__ORG__/__REPO__/releases/latest/download/plugins.xml

# Advanced functionality

## Debug

In any Python module, you can have a global variable as `DEBUG = True`, which will be changed to `False` when packaging the plugin.

# Excluding files in the plugin archive
## Excluding files in the plugin archive

If you want to avoid some files to be shipped with your plugin, create a ``.gitattributes`` file in which you can specify the files to ignore. For instance:
```
resources.qrc export-ignore
```



# Activating unit tests


# Sample plugins

* https://github.com/VeriVD/qgis_VeriVD


31 changes: 21 additions & 10 deletions scripts/qgis-plugin-ci
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,28 @@ if __name__ == "__main__":
# package
package_parser = subparsers.add_parser('package', help='creates an archive of the plugin')
package_parser.add_argument('release_version', help='The version to be released')
package_parser.add_argument('--transifex-token', help='The Transifex API token. '
'If specified translations will be pulled and compiled.')
package_parser.add_argument(
'--transifex-token',
help='The Transifex API token. If specified translations will be pulled and compiled.'
)

# release
release_parser = subparsers.add_parser('release', help='release the plugin')
release_parser.add_argument('release_version', help='The version to be released')
release_parser.add_argument('--transifex-token', help='The Transifex API token. '
'If specified translations will be pulled and compiled.')
release_parser.add_argument('--github-token', help='The Github API token. '
'If specified, the archive will be pushed to an already '
'existing release.')
release_parser.add_argument('--create-plugin-repo', action='store_true',
help='Will create a XML repo as a Github release asset. Github token is required.')
release_parser.add_argument(
'--transifex-token',
help='The Transifex API token. If specified translations will be pulled and compiled.'
)
release_parser.add_argument(
'--github-token',
help='The Github API token. If specified, the archive will be pushed to an already existing release.'
)
release_parser.add_argument(
'--create-plugin-repo', action='store_true',
help='Will create a XML repo as a Github release asset. Github token is required.'
)
release_parser.add_argument('--osgeo-username', help='The Osgeo user name to publish the plugin.')
release_parser.add_argument('--osgeo-password', help='The Osgeo password to publish the plugin.')

# pull-translation
pull_tr_parser = subparsers.add_parser('pull-translation', help='pull translations from Transifex')
Expand Down Expand Up @@ -72,7 +81,9 @@ if __name__ == "__main__":
release_version=args.release_version,
transifex_token=args.transifex_token,
github_token=args.github_token,
upload_plugin_repo_github=args.create_plugin_repo
upload_plugin_repo_github=args.create_plugin_repo,
osgeo_username=args.osgeo_username,
osgeo_password=args.osgeo_password
)
if not success:
exit_val = 1
Expand Down

0 comments on commit 2396fd3

Please sign in to comment.