Skip to content

Commit

Permalink
Debian 9: Separate images for libssl 1.0 and 1.1
Browse files Browse the repository at this point in the history
Stretch uses libssl 1.1 by default. Box currently doesn't compile with
1.1 (GitHub issue boxbackup/boxbackup#16).

libssl 1.0 is available as a separate package - replacing libssl-dev, so
this creates two AMIs, one for each libssl version.

As part of this we need to use separate usernames for Buildbot. Packer
allows specifying a name value to each builder, so we use that builder
name as the Buildbot name. This requires passing the PACKER_BUILD_NAME
environment variable around.
  • Loading branch information
jamesog committed Dec 25, 2017
1 parent 867b4a1 commit 11aede8
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 9 deletions.
56 changes: 50 additions & 6 deletions debian9.json
Expand Up @@ -2,8 +2,7 @@
"variables": {
"subnet_id": "",
"vpc_id": "",
"bb_passwd": "",
"bb_user": ""
"bb_passwd": ""
},
"provisioners": [
{
Expand All @@ -16,12 +15,38 @@
"set -x",
"sleep 30",
"sudo apt-get update",
"sudo apt-get -y upgrade",
"sudo apt-get install -y git autoconf automake gcc g++ zlib1g-dev libssl-dev libdb-dev libreadline-dev libeditline-dev make xsltproc libwww-perl libboost-dev",
"sudo apt-get -y upgrade"
],
"type": "shell"
},
{
"inline": [
"set -x",
"sudo apt-get install -y git autoconf automake gcc g++ zlib1g-dev libssl1.0-dev libdb-dev libreadline-dev libeditline-dev make xsltproc libwww-perl libboost-dev"
],
"only": [
"debian9ssl10"
],
"type": "shell"
},
{
"inline": [
"set -x",
"sudo apt-get install -y git autoconf automake gcc g++ zlib1g-dev libssl-dev libdb-dev libreadline-dev libeditline-dev make xsltproc libwww-perl libboost-dev"
],
"only": [
"debian9ssl11"
],
"type": "shell"
},
{
"inline": [
"set -x",
"export PACKER_BUILD_NAME",
"sudo apt-get -y install python-pip python-virtualenv python-dev",
"sudo adduser --gecos Buildbot --disabled-password buildbot",
"sudo -i -u buildbot virtualenv buildbot",
"sudo -i -u buildbot bash -c 'source buildbot/bin/activate; pip install buildbot-slave; buildslave create-slave slave builds.boxbackup.org {{user `bb_user`}} {{user `bb_passwd`}}'",
"sudo -E -i -u buildbot PACKER_BUILD_NAME=\"$PACKER_BUILD_NAME\" bash -c 'echo PACKER_BUILD_NAME=$PACKER_BUILD_NAME; source buildbot/bin/activate; pip install buildbot-slave; buildslave create-slave slave builds.boxbackup.org ${PACKER_BUILD_NAME} {{user `bb_passwd`}}'",
"echo \"James O'Gorman <james+buildbot@netinertia.co.uk>\" | sudo tee /home/buildbot/slave/info/admin",
"echo \"Debian 9 (Stretch) running on Amazon EC2\" | sudo tee /home/buildbot/slave/info/host",
"sudo mv /tmp/buildslave.service /etc/systemd/system",
Expand All @@ -35,10 +60,29 @@
"builders": [
{
"source_ami": "ami-9fba3be6",
"name": "debian9ssl10",
"subnet_id": "{{user `subnet_id`}}",
"ssh_username": "admin",
"region": "eu-west-1",
"ami_name": "Debian 9 Buildbot 0.8 LibSSL 1.0 {{isotime \"2006-01-02\"}}-{{timestamp}}",
"instance_type": "t2.micro",
"vpc_id": "{{user `vpc_id`}}",
"launch_block_device_mappings": [
{
"delete_on_termination": true,
"volume_type": "gp2",
"device_name": "xvda"
}
],
"type": "amazon-ebs"
},
{
"source_ami": "ami-9fba3be6",
"name": "debian9ssl11",
"subnet_id": "{{user `subnet_id`}}",
"ssh_username": "admin",
"region": "eu-west-1",
"ami_name": "Debian 9 Buildbot 0.8 {{isotime \"2006-01-02\"}}",
"ami_name": "Debian 9 Buildbot 0.8 LibSSL 1.1 {{isotime \"2006-01-02\"}}-{{timestamp}}",
"instance_type": "t2.micro",
"vpc_id": "{{user `vpc_id`}}",
"launch_block_device_mappings": [
Expand Down
34 changes: 31 additions & 3 deletions debian9.yml
@@ -1,5 +1,4 @@
variables:
bb_user: ""
bb_passwd: ""
subnet_id: ""
vpc_id: ""
Expand All @@ -8,13 +7,29 @@ variables:
# aws_secret_key: ""
builders:
- type: amazon-ebs
name: debian9ssl10
#access_key: '{{user `aws_access_key`}}'
#secret_key: '{{user `aws_secret_key`}}'
region: eu-west-1
source_ami: ami-9fba3be6
instance_type: t2.micro
ssh_username: admin
ami_name: Debian 9 Buildbot 0.8 {{isotime "2006-01-02"}}
ami_name: Debian 9 Buildbot 0.8 LibSSL 1.0 {{isotime "2006-01-02"}}-{{timestamp}}
launch_block_device_mappings:
- device_name: xvda
volume_type: gp2
delete_on_termination: true
subnet_id: '{{user `subnet_id`}}'
vpc_id: '{{user `vpc_id`}}'
- type: amazon-ebs
name: debian9ssl11
#access_key: '{{user `aws_access_key`}}'
#secret_key: '{{user `aws_secret_key`}}'
region: eu-west-1
source_ami: ami-9fba3be6
instance_type: t2.micro
ssh_username: admin
ami_name: Debian 9 Buildbot 0.8 LibSSL 1.1 {{isotime "2006-01-02"}}-{{timestamp}}
launch_block_device_mappings:
- device_name: xvda
volume_type: gp2
Expand All @@ -31,11 +46,24 @@ provisioners:
- sleep 30
- sudo apt-get update
- sudo apt-get -y upgrade
- type: shell
inline:
- set -x
- sudo apt-get install -y git autoconf automake gcc g++ zlib1g-dev libssl1.0-dev libdb-dev libreadline-dev libeditline-dev make xsltproc libwww-perl libboost-dev
only: ["debian9ssl10"]
- type: shell
inline:
- set -x
- sudo apt-get install -y git autoconf automake gcc g++ zlib1g-dev libssl-dev libdb-dev libreadline-dev libeditline-dev make xsltproc libwww-perl libboost-dev
only: ["debian9ssl11"]
- type: shell
inline:
- set -x
- export PACKER_BUILD_NAME
- sudo apt-get -y install python-pip python-virtualenv python-dev
- sudo adduser --gecos Buildbot --disabled-password buildbot
- sudo -i -u buildbot virtualenv buildbot
- sudo -i -u buildbot bash -c 'source buildbot/bin/activate; pip install buildbot-slave; buildslave create-slave slave builds.boxbackup.org {{user `bb_user`}} {{user `bb_passwd`}}'
- sudo -E -i -u buildbot PACKER_BUILD_NAME="$PACKER_BUILD_NAME" bash -c 'echo PACKER_BUILD_NAME=$PACKER_BUILD_NAME; source buildbot/bin/activate; pip install buildbot-slave; buildslave create-slave slave builds.boxbackup.org ${PACKER_BUILD_NAME} {{user `bb_passwd`}}'
- echo "James O'Gorman <james+buildbot@netinertia.co.uk>" | sudo tee /home/buildbot/slave/info/admin
- echo "Debian 9 (Stretch) running on Amazon EC2" | sudo tee /home/buildbot/slave/info/host
- sudo mv /tmp/buildslave.service /etc/systemd/system
Expand Down

0 comments on commit 11aede8

Please sign in to comment.