This is a tool to use Packer on the remote server. This starts to build image(s) when this get http request.
The build process is below.
- Checkout from repository.
- Run
packer build
command.
- 1.9.3
- 2.0.0
You need install Packer before use this tool.
paker-remote support git only now.
- Git
-
Download gem file from here.
-
Install it yourself as:
$ gem install packer-remote.1.0.0.gem
$ mkdir packer-sample
$ vi packer.json
A configuration sample is below.
{
"builders": [{
"type": "amazon-ebs",
"region": "us-west-2",
"source_ami": "ami-de0d9eb7",
"instance_type": "t1.micro",
"ssh_username": "ec2-user",
"ssh_timeout": "5m",
"ami_name": "Packer-{{timestamp}}",
"access_key": "YOUR_ACCESS_KEY",
"secret_key": "YOUR_SECRET_KEY"
}],
"provisioners": [{
"type": "shell",
"inline": ["sudo yum install -y nginx"]
}]
}
$ git init
$ git add .
$ git commit -am "create packer-remote repository"
$ git push -u "YOUR_REPOSITORY_URI"
$ vi config.json
{
"port": 8080,
"vcs" : {
"url" : "_git_repository_url_",
"type": "git"
},
"packer": {
"path" : "./packer.json"
}
}
Config settings
Fields | Require | Type | Value |
---|---|---|---|
port | No | Int | server port number. Default = 8080 |
vcs | True | Map | vcs settinds. Detail is below. |
packer | No | Map | packer settinds. Detail is below. |
VCS Settings
Fields | Require | Type | Value |
---|---|---|---|
type | True | String | VCS type name. |
url | True | String | VCS repository url. |
Packer Settings
Fields | Require | Type | Value |
---|---|---|---|
path | No | String | The path of packer settings. Defailt = "./packer.json" |
Execute packer-remote run
to start a server.
$ packer-remote run
$ curl http://localhost:8080/build
If you use AWS EC2 and ELB, you can use /health
as helth check url.
PackerRemote returns status 200 when it is running.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request