pushsnapscript
Main script that is aimed to be run with scriptworker (but runs perfectly fine as a standalone script).
Get the code
First, you need python>=3.5.0
.
virtualenv3 venv3 # create the virtualenv in ./venv3
. venv3/bin/activate # activate it
git clone https://github.com/mozilla-releng/pushsnapscript
cd pushsnapscript
git submodule init # Needed to import the necessary bits of snapcraft
git submodule update
pip install pushsnapscript
Configure
config.json
cp examples/config.example.json config.json
# edit it with your favorite text editor
There are many values to edit. Example values should give you a hint about what to provide. If not, please see signingscript's README for more details about allowing URLs, or contact the author for other unclear areas.
directories and file naming
If you aren't running through scriptworker, you need to manually create the directories that work_dir
and artifact_dir
point to. It's better to use new directories for these rather than cluttering and potentially overwriting an existing directory. Once you set up scriptworker, the work_dir
and artifact_dir
will be regularly wiped and recreated.
task.json
cp examples/task.example.json /path/to/work_dir
# edit it with your favorite text editor
Ordinarily, scriptworker would get the task definition from TaskCluster, and write it to a task.json
in the work_dir
. Since you're initially not going to run through scriptworker, you need to put this file on disk yourself.
The important entries to edit are the:
-
upstreamArtifacts
: point to the file(s) to publish to Google Play -
dependencies
: need to match thetaskId
s of the URLs unless you modify thevalid_artifact_*
config items as specified above -
scopes
: the first and only scope,project:releng:snapcraft:*
, tells which channel on Snap store should be updated. For more details about scopes. Seescopes.md
run
You're ready to run pushsnapscript!
pushsnapscript CONFIG_FILE
where CONFIG_FILE
is the config json you created above.
running through scriptworker
Follow the scriptworker readme to set up scriptworker, and use ["path/to/pushsnapscript", "path/to/script_config.json"]
as your task_script
.
work_dir
and artifact_dir
point to the same directories between the scriptworker config and the pushsnapscript config!