Skip to content

Commit b916c6c

Browse files
authored
Merge pull request #2 from hatappi/readme-sample
Add Readme.md and sample
2 parents e9b20e0 + 36302a6 commit b916c6c

3 files changed

Lines changed: 70 additions & 0 deletions

File tree

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
This is [Packer Provisioner Plugin](https://www.packer.io/docs/extending/custom-provisioners.html) for use [MItamae](https://github.com/itamae-kitchen/mitamae).
2+
3+
## Installation
4+
5+
```sh
6+
# require go, git
7+
$ go get github.com/hatappi/packer-provisioner-mitamae
8+
```
9+
10+
## Usage
11+
12+
Add the provisioner to packer file.
13+
14+
```json
15+
{
16+
"builders": [ ... ],
17+
"provisioners": [{
18+
"type": "mitamae",
19+
"recipe_path": "/tmp/recipe.rb"
20+
}]
21+
}
22+
```
23+
24+
sample is [here](./sample)
25+
26+
## Configuration
27+
**Required**
28+
29+
- recipe_path (string) : recipe path of remote server.
30+
31+
**Optional**
32+
33+
- mitamae_version (string) : MItamae version. By default this is v1.4.5.
34+
- bin_dir (string) : bin_dir is is the path to download MItamae. By default this is `/usr/local/bin`
35+
- option (string) : It is an option when execute `mitamae local`. For example '-l debug'

sample/docker.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"builders":[{
3+
"type": "docker",
4+
"image": "ubuntu",
5+
"export_path": "image.tar"
6+
}],
7+
"provisioners": [
8+
{
9+
"type": "file",
10+
"source": "./recipe.rb",
11+
"destination": "/tmp/recipe.rb"
12+
},
13+
{
14+
"type": "shell",
15+
"inline": ["apt-get update -y", "apt-get install wget -y"]
16+
},
17+
{
18+
"type": "mitamae",
19+
"recipe_path": "/tmp/recipe.rb"
20+
}
21+
],
22+
"post-processors": [
23+
[
24+
{
25+
"type": "docker-import",
26+
"repository": "packer-provisioner-mitamae/sample"
27+
}
28+
]
29+
]
30+
}

sample/recipe.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
directory '/tmp/etc'
2+
3+
file '/tmp/etc/hello' do
4+
content "Welcome to packer-provisioner-mitamae\n"
5+
end

0 commit comments

Comments
 (0)