Skip to main content

A command-line tool for uploading assets to an assets server.

Project description

A command-line tool for managing assets.ubuntu.com

This is intended to be a simple command-line tool for uploading assets to an https://assets.ubuntu.com-like assets server.

Installation

Snap install

On a snap-enabled system, you can simply:

sudo snap install upload-assets

Pip install

If you can't install the snap, you can install with pip.

First install python3 pip, then:

sudo pip3 install canonicalwebteam.upload-assets

Manual Install from this repo

  1. Create a virtual environment and activate it
python3 -m venv venv
source venv/bin/activate
  1. Install local pip packages
pip install .
  1. Install pip packages from requirements
pip install -r requirements.txt

Usage

You should now have access to the upload-assets command:

$ UPLOAD_ASSETS_API_TOKEN=XXXXXXXX upload-assets  \
    -d assets.EXAMPLE.com  \
    ~/EXAMPLE_DIRECTORY ./EXAMPLE_IMAGE.png
[
    {"url": "https://assets.ubuntu.com/v1/2071d161-EXAMPLE_IMAGE.png", "filepath": "/home/robin/EXAMPLE_IMAGE.png"},
    {"url": "https://assets.ubuntu.com/v1/2071d161-IMAGE1.png", "filepath": "/home/robin/EXAMPLE_DIRECTORY/IMAGE1.png"},
    {"url": "https://assets.ubuntu.com/v1/2071d161-IMAGE2.png", "filepath": "/home/robin/EXAMPLE_DIRECTORY/IMAGE2.png"}
]

Configuration

To avoid specifying them every time, you can store both the URL and the token for the assets API in environment variables:

$ export UPLOAD_ASSETS_API_TOKEN=<api-token>
$ export UPLOAD_ASSETS_API_DOMAIN=assets.example.com
$ upload-assets EXAMPLE_IMAGE.png

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

canonicalwebteam.upload-assets-0.4.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file canonicalwebteam.upload-assets-0.4.1.tar.gz.

File metadata

File hashes

Hashes for canonicalwebteam.upload-assets-0.4.1.tar.gz
Algorithm Hash digest
SHA256 b175eab8d4bb485c8188b3fd085284a8948730b1af308fda7764f59c8e39fcd4
MD5 73b24cc0a7e5b2ba0b8f42164ea8ede7
BLAKE2b-256 f5de89fa2806f5835fb505ff3c7f8371e8fd6e679a420d57a4ada9584c013a85

See more details on using hashes here.

File details

Details for the file canonicalwebteam.upload_assets-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for canonicalwebteam.upload_assets-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf299cce4e6b64c79af4da2e33f4aac80a090d1e9f36639f56fc6d633fec3d7f
MD5 e741ed6e79ad154f4b9ae0048d8694de
BLAKE2b-256 cc9074142d583d43a910767ea5d8bfa8c460ced6c0ab5d56cca31bb4298a43a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page