Ghost Ship
raw JSON → 0.3.5 verified Sat May 09 auth: no python
Ghost Ship is a deployment tool for HashiCorp Nomad that builds Docker images and submits Nomad jobs. It wraps Packer and Nomad CLI commands. Current version: 0.3.5. Release cadence is irregular.
pip install ghost-ship Common errors
error ModuleNotFoundError: No module named 'ghostship' ↓
cause Incorrect import due to hyphen.
fix
Use 'import ghost_ship' instead of 'import ghostship'.
error AttributeError: 'GhostShip' object has no attribute 'ship' ↓
cause Method renamed in v0.3.0.
fix
Use .deploy() method instead of .ship().
Warnings
gotcha The package name is 'ghost-ship' (with hyphen), but Python imports use underscore: 'import ghost_ship'. ↓
fix Use 'ghost_ship' in import statements.
breaking Breaking change in v0.3.0: The 'ship' method renamed to 'deploy'. ↓
fix Replace ship.ship(...) with ship.deploy(...).
Imports
- GhostShip wrong
from ghostship import GhostShipcorrectfrom ghost_ship import GhostShip - Builder
from ghost_ship import Builder
Quickstart
import os
from ghost_ship import GhostShip
config = {
'nomad_addr': os.environ.get('NOMAD_ADDR', 'http://localhost:4646'),
'datacenter': 'dc1'
}
ship = GhostShip(config)
ship.deploy('my-job.nomad', image_tag='v1.0')