-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Internally we use a builder host which has all of the Chef and VMWare Workstation dependencies. This makes the build process faster and provides more resources for the build than most end-user workstations would. If you already have access to a host configured for Cypress builder then you can skip this step.
Our builder host is based on a Ubuntu 18.04 Server LTS, however other Linux distributions may be acceptable but untested.
- Install VMware Workstation Pro for Linux. At the time of writing the stable version was Workstation 15. Since we are building with packer the pro version is required.
- Install VMware ovftool and ensure it is in your path.
- Install Packer and place the binary at
/usr/local/bin/packer
. - Install the ChefDK.
- Clone a copy of cypress to
/opt/cypress
and a copy of cypress-recipe to/opt/cypress-recipe
-
Required only for AWS Builds: Setup an AWS environment config at
/opt/cypress/contrib/aws_env.json
with contents similar to the following:{ "aws_access_key": "<access-key-here>", "aws_secret_key": "<secret-key-here>", "vpc_id": "vpc-<id>", "subnet_id": "subnet-<id>" }
The initial steps above are only necessary if you are setting up a Cypress build host for the first time. Once your build host is setup you can run the actual build step multiple times without having to redo the setup.
-
Navigate to the
/opt/cypress-recipe
directory and make sure your copy of the source code there is up-to-date by running agit pull
. -
Run
berks vendor /opt/cypress/contrib/cookbooks/
to update the copy of the cookbooks located in the cypress contrib directory. The cookbooks located in this directory are the ones that will be used for the actual VM build. -
Navigate to the
/opt/cypress/contrib
directory, you are now ready to build the VM images. Depending on the which VM's you wish to build the command will change a bit. There are 6 VMs that will be built if you runpacker build -var-file=aws_env.json cypress.json
. In order to filter it down you can run specify which specific VMs you want to build. The-var-file
parameter is only necessary if you want to build AMI images.- cypress.amazonaws
- cypress.cvu.amazonaws
- cvu.amazonaws
- cypress.vmware
- cypress.cvu.vmware
- cvu.vmware
If you wish to only build only specific types of VMs you can specify then by making your command say something like
packer build -var-file=aws_env.json -only=cypress.vmware,cvu.vmware cypress.json
which would only build Cypress and CVU VMware images into your local directory. -
Once the build is complete the build artifacts will be left in the
/opt/cypress/contrib
directory in a directory calledoutput-<vm-name>
. AMI builds can be found by logging into the AWS console.