README.md in aptly_cli-0.3.0 vs README.md in aptly_cli-0.3.1
- old
+ new
@@ -10,13 +10,13 @@
## Installation
### Install Gem:
$ gem install aptly_cli
-
-or...
-
+
+or...
+
### Install and run aptly-cli from Docker:
# Optional: If you don't pull explicitly, `docker run` will do it for you
$ docker pull sepulworld/aptly-cli
@@ -45,45 +45,141 @@
```yaml
:username: api-user
:password: api-password
```
+The username and password can also be configured for prompt entry using
+the following in `aptly-cli.conf`:
+
+```yaml
+:username: ${PROMPT}
+:password: ${PROMPT_PASSWORD}
+```
+
+The tool will prompt for the specified values, where `${PROMPT}` results
+in a regular prompt and `${PROMPT_PASSWORD}` results in a password
+prompt where the input is replaced by asterisks, e.g.:
+
+ $ aptly-cli version
+ Enter a value for username:
+ zane
+ Enter a value for password:
+ ********
+
+Another possibility for storing passwords is `${KEYRING}`. To use this feature,
+you must have the [`keyring` gem](https://github.com/jheiss/keyring) installed
+and also have a system that is set up to use one of the backends that the
+`keyring` gem supports, such as Mac OS X Keychain or GNOME 2 Keyring (Note:
+Only Mac OS X Keychain has been tested thus far):
+
+ $ gem install keyring
+
+Then you can put something like this in `aptly-cli.conf`:
+
+```yaml
+:username: zane
+:password: ${KEYRING}
+```
+
+The first time you run an `aptly-cli` command, you will be prompted to enter a
+password.
+
+ $ aptly-cli version
+ Enter a value for password:
+ ***************
+
+The entered password will be stored in your keyring so that future uses of
+`aptly-cli` can get the password from your keyring:
+
+ $ aptly-cli version
+ {"Version"=>"0.9.7"}
+
Also make sure that your config file isn't world readable (```chmod o-rw /etc/aptly-cli.conf```)
-If a configuration file is not found the defaults in the example configuration file above will be used
+If a configuration file is not found, the defaults in the example
+configuration file above will be used.
## Usage - available aptly-cli commands
- aptly-cli --help
+The `--config` (`-c`) option allows specifying an alternative config file, e.g.:
- file_delete Deletes all files in upload directory and directory itself. Or delete just a file
- file_list List all directories that contain uploaded files
- file_upload Parameter --directory is upload directory name. Directory would be created if it doesn’t exist.
- graph Download a graph of repository layout. Current options are "svg" and "png"
- help Display global or [command] help documentation
- publish_drop Delete published repository, clean up files in published directory.
- publish_list List published repositories.
- publish_repo Publish local repository or snapshot under specified prefix. Storage might be passed in prefix as well, e.g. s3:packages/. To supply empty prefix, just remove last part (POST /api/publish/:prefix/<:repos>or<:snapshots>
- publish_update Update published repository. If local repository has been published, published repository would be updated to match local repository contents. If snapshots have been been published, it is possible to switch each component to new snapshot
- repo_create Create a new repository, requires --name
- repo_delete Delete a local repository, requires --name
- repo_edit Edit a local repository metadata, requires --name
- repo_list Show list of currently available local repositories
- repo_package_query List all packages in local repository or perform search on repository contents and return result., requires --name
- repo_show Returns basic information about local repository
- repo_upload Import packages from files (uploaded using File Upload API) to the local repository. If directory specified, aptly would discover package files automatically.Adding same package to local repository is not an error. By default aptly would try to remove every successfully processed file and directory :dir (if it becomes empty after import).
- snapshot_create Create snapshot of current local repository :name contents as new snapshot with name :snapname
- snapshot_delete Delete snapshot. Snapshot can’t be deleted if it is published. aptly would refuse to delete snapshot if it has been used as source to create other snapshots, but that could be overridden with force parameter
- snapshot_diff Calculate difference between two snapshots --name (left) and --withsnapshot (right).
- snapshot_list Return list of all snapshots created in the system
- snapshot_search List all packages in snapshot or perform search on snapshot contents and return result
- snapshot_show Get information about snapshot by name
- snapshot_update Update snapshot’s description or name
- version Display aptly server
-
+ $ aptly-cli -c ~/.config/aptly-cli/aptly-cli.conf repo_list
+
+The `--server`, `--username`, and `--password` options allow specifying
+those things on the command-line and not even requiring a config file.
+
+ $ aptly-cli --server 10.3.0.46 --username marca --password '${PROMPT_PASSWORD}' repo_list
+
+Note that you can use `${PROMPT}`, `${PROMPT_PASSWORD}`, and `${KEYRING}` in
+the values of these options, just as you can in a config file. Note that you
+might have to quote them to prevent the shell from trying to expand them.
+
+ $ aptly-cli --help
+ NAME:
+
+ aptly-cli
+
+ DESCRIPTION:
+
+ Aptly repository API client
+
+ COMMANDS:
+
+ file_delete File delete
+ file_list List all directories
+ file_upload File upload
+ graph Download an svg or png graph of repository layout
+ help Display global or [command] help documentation
+ publish_drop Delete published repository
+ publish_list List published repositories
+ publish_repo Publish local repository or snapshot under specified prefix
+ publish_update Update published repository
+ repo_create Create a new repository, requires --name
+ repo_delete Delete a local repository, requires --name
+ repo_edit Edit a local repository metadata, requires --name
+ repo_list Show list of currently available local repositories
+ repo_package_query List all packages or search on repo contents, requires --name
+ repo_show Returns basic information about local repository
+ repo_upload Import packages from files
+ snapshot_create Create snapshot, require --name
+ snapshot_delete Delete snapshot, require --name
+ snapshot_diff Calculate difference between two snapshots
+ snapshot_list Return list of all snapshots created in the system
+ snapshot_search List all packages in snapshot or perform search
+ snapshot_show Get information about snapshot by name
+ snapshot_update Update snapshot’s description or name
+ version Display aptly server version
+
+ GLOBAL OPTIONS:
+
+ -c, --config FILE
+ Path to YAML config file
+
+ -s, --server SERVER
+ Host name or IP address
+
+ --username USERNAME
+ User name
+
+ --password PASSWORD
+ Password
+
+ --debug
+ Enable debug output
+
+ -h, --help
+ Display help documentation
+
+ -v, --version
+ Display version information
+
+ -t, --trace
+ Display backtrace when an error occurs
+
+
### To see more options for each command
- aptly-cli <command> --help
+ $ aptly-cli <command> --help
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.