Skip to content
Robert Clark edited this page Mar 20, 2019 · 3 revisions

Cypress build process

Setup a Cypress Build Host

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.

  1. 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.
  2. Install VMware ovftool and ensure it is in your path.
  3. Install Packer and place the binary at /usr/local/bin/packer.
  4. Install the ChefDK.
  5. Clone a copy of cypress to /opt/cypress and a copy of cypress-recipe to /opt/cypress-recipe
  6. 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>"
    }
    

Run the Build

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.

  1. Navigate to the /opt/cypress-recipe directory and make sure your copy of the source code there is up-to-date by running a git pull.

  2. 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.

  3. 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 run packer 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.

  4. Once the build is complete the build artifacts will be left in the /opt/cypress/contrib directory in a directory called output-<vm-name>. AMI builds can be found by logging into the AWS console.

Clone this wiki locally