X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=packer%2FREADME.md;fp=packer%2FREADME.md;h=b31fa9537e5a65d030768636d5c8c371fa2d4d8e;hb=a7986d559ecdea646434ecb97a4035fe2c518353;hp=0000000000000000000000000000000000000000;hpb=f737dfd3b34dfa6a27c2d9b2fc723ddbd7897f38;p=ci-management.git diff --git a/packer/README.md b/packer/README.md new file mode 100644 index 00000000..b31fa953 --- /dev/null +++ b/packer/README.md @@ -0,0 +1,35 @@ +# CI Packer + +[Packer][1] is a tool for automatically creating VM and container images, +configuring them and post-processing them into standard output formats. + +## Building + +You'll need to [install Packer][2], of course. + +The Packer configuration is divided into build-specific variables, +output-specific templates and a set of shared provisioning scripts. To do a +specific build, combine the template for the desired output artifact type with +a variable file. To build a new basebuild instance the following would be done: + +``` +packer build -var-file=vars/cloud-env.json -var-file=vars/centos.json templates/basebuild.json +``` + +**NOTE:** vars/cloud-env.json is a gitignored file as it contains private +information. There is a vars/cloud-env.json.example file that may be used as a +base for creating the one needed. + +This would build a bootable image in the project's CI cloud environment. + +From a high level, the builds: + +* Boot a specified base image in the cloud +* Run a set of shell scripts, listed in the template's shell provisioner + section, to do any configuration required by the builder. +* Execute a shutdown of the running instance +* Execute a 'nova image-create' operation against the shutdown instance. +* Perform a 'nova delete' operation against the shutdown instance. + +[1]: https://www.packer.io/ +[2]: https://www.packer.io/intro/getting-started/install.html