Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Nomad packer template for Azure, updated versions #61

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,4 @@ fi
| 0.1.1 | 1.2.0-ent | 0.10.3-ent | 0.8.4-ent |
| 0.1.2 | 1.2.1 | 0.10.3 | 0.8.4 |
| 0.1.3 | 1.2.1-ent | 0.10.3-ent | 0.8.4-ent |
| 0.1.4 | 1.2.2 | 0.11.0 | 0.8.4 |
2 changes: 1 addition & 1 deletion azure-local-env.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export CONSUL_ENT_URL=$(AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}" \
AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}" \
aws s3 presign \
--region="us-east-1" \
s3://${S3BUCKET}/consul-enterprise/${CONSUL_VERSION}/consul-enterprise_${CONSUL_VERSION}+ent_linux_amd64.zip \
s3://${S3BUCKET}/consul/ent/${CONSUL_VERSION}/consul-enterprise_${CONSUL_VERSION}+ent_linux_amd64.zip \
--expires-in 600)
export VAULT_ENT_URL=$(AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}" \
AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}" \
Expand Down
8 changes: 4 additions & 4 deletions consul/consul-azure.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"builders": [
{
"name": "azure-manaaged-image-ubuntu-16.04-systemd",
"name": "azure-managed-image-ubuntu-16.04-systemd",
"type": "azure-arm",
"client_id": "{{ user `azure_client_id` }}",
"client_secret": "{{ user `azure_client_secret` }}",
Expand Down Expand Up @@ -57,7 +57,7 @@
{
"type": "shell",
"only": [
"azure-manaaged-image-ubuntu-16.04-systemd"
"azure-managed-image-ubuntu-16.04-systemd"
],
"inline": [
"bash /tmp/shared/scripts/base-azure.sh"
Expand Down Expand Up @@ -88,7 +88,7 @@
{
"type": "shell",
"only": [
"azure-manaaged-image-ubuntu-16.04-systemd"
"azure-managed-image-ubuntu-16.04-systemd"
],
"inline": [
"bash /tmp/consul/scripts/install-consul-systemd.sh"
Expand All @@ -97,7 +97,7 @@
{
"type": "shell",
"only": [
"azure-manaaged-image-ubuntu-16.04-systemd"
"azure-managed-image-ubuntu-16.04-systemd"
],
"inline": [
"cd /tmp/shared/scripts && bash setup-testing.sh",
Expand Down
148 changes: 148 additions & 0 deletions nomad/nomad-azure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"variables": {
"azure_client_id": "{{ env `ARM_CLIENT_ID` }}",
"azure_client_secret": "{{ env `ARM_CLIENT_SECRET` }}",
"azure_subscription_id": "{{ env `ARM_SUBSCRIPTION_ID` }}",
"azure_resource_group": "{{ env `AZURE_RESOURCE_GROUP` }}",
"azure_location": "{{ env `AZURE_LOCATION` }}",
"environment": "{{ env `PACKER_ENVIRONMENT` }}",
"vcs_name": "{{ env `VCS_NAME` }}",
"consul_version": "{{ env `CONSUL_VERSION` }}",
"consul_ent_url": "{{ env `CONSUL_ENT_URL` }}",
"consul_group": "consul",
"consul_user": "consul",
"consul_comment": "Consul",
"consul_home": "/srv/consul",
"nomad_version": "{{ env `NOMAD_VERSION` }}",
"nomad_release": "{{ env `NOMAD_RELEASE` }}",
"nomad_ent_url": "{{ env `NOMAD_ENT_URL` }}",
"nomad_group": "root",
"nomad_user": "root"
},
"builders": [
{
"name": "azure-managed-image-ubuntu-16.04-systemd",
"type": "azure-arm",
"client_id": "{{ user `azure_client_id` }}",
"client_secret": "{{ user `azure_client_secret` }}",
"subscription_id": "{{ user `azure_subscription_id` }}",
"managed_image_resource_group_name": "{{ user `azure_resource_group` }}",
"location": "{{ user `azure_location` }}",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "16.04-LTS",
"os_type": "Linux",
"ssh_username": "packer",
"managed_image_name": "{{ user `environment` }}-nomad-server-{{ user `nomad_version` }}-Ubuntu_16.04",
"azure_tags": {
"Name": "Nomad Ubuntu 16.04 Image {{ user `release_version` }}: Nomad v{{ user `nomad_version` }} Consul v{{ user `consul_version` }}",
"System": "Nomad",
"Product": "Nomad",
"Built-By": "{{ user `vcs_name` }}",
"Release-Version": "{{ user `release_version` }}",
"Consul-Version": "{{ user `consul_version` }}",
"Vault-Version": "nil",
"Nomad-Version": "{{ user `nomad_version` }}",
"OS": "ubuntu",
"OS-Version": "16.04"
}
}
],
"provisioners": [
{
"type": "file",
"source": "../",
"destination": "/tmp"
},
{
"type": "shell",
"inline": [
"bash /tmp/shared/scripts/base.sh"
]
},
{
"type": "shell",
"only": ["azure-managed-image-ubuntu-16.04-systemd"],
"inline": [
"bash /tmp/shared/scripts/base-azure.sh"
]
},
{
"type": "shell",
"environment_vars": [
"GROUP={{ user `consul_group` }}",
"USER={{ user `consul_user` }}",
"COMMENT={{ user `consul_comment` }}",
"HOME={{ user `consul_home` }}"
],
"inline": [
"bash /tmp/shared/scripts/setup-user.sh"
]
},
{
"type": "shell",
"environment_vars": [
"VERSION={{ user `consul_version` }}",
"URL={{ user `consul_ent_url` }}",
"USER={{ user `consul_user` }}",
"GROUP={{ user `consul_group` }}"
],
"inline": [
"bash /tmp/consul/scripts/install-consul.sh"
]
},
{
"type": "shell",
"only": ["azure-managed-image-ubuntu-16.04-systemd"],
"inline": [
"bash /tmp/consul/scripts/install-consul-systemd.sh"
]
},
{
"type": "shell",
"environment_vars": [
"VERSION={{ user `nomad_version` }}",
"URL={{ user `nomad_ent_url` }}",
"USER={{ user `nomad_user` }}",
"GROUP={{ user `nomad_group` }}"
],
"inline": [
"bash /tmp/nomad/scripts/install-nomad.sh"
]
},
{
"type": "shell",
"only": ["azure-managed-image-ubuntu-16.04-systemd"],
"inline": [
"bash /tmp/nomad/scripts/install-nomad-systemd.sh"
]
},
{
"type": "shell",
"only": ["azure-managed-image-ubuntu-16.04-systemd"],
"inline": [
"bash /tmp/nomad/scripts/install-docker.sh"
]
},
{
"type": "shell",
"inline": [
"bash /tmp/nomad/scripts/install-java.sh"
]
},
{
"type": "shell",
"only": ["azure-managed-image-ubuntu-16.04-systemd"],
"inline": [
"cd /tmp/shared/scripts && bash /tmp/shared/scripts/setup-testing.sh",
"cd /tmp && rake nomad:spec"
]
},
{
"type": "shell",
"inline": [
"bash /tmp/shared/scripts/cleanup.sh"
]
}
]
}
18 changes: 9 additions & 9 deletions versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ export TERRAFORM_VERSION="0.11.1"
# Release candidate: X.Y.Z-rcX (e.g. 0.1.0-rc1)
# Beta release: X.Y.Z-betaX (e.g. 0.1.0-beta1)
# Development branch: X.Y.Z-f-branch (e.g. 0.1.0-f-branch)
export RELEASE_VERSION="0.1.3"
export RELEASE_VERSION="0.1.4"

# X.Y.Z or X.Y.Z-ent for Enterprise binary (e.g. 1.0.6 or 1.0.6-ent)
export CONSUL_VERSION="1.2.1-ent"
export CONSUL_VERSION="1.2.2"

# X.Y.Z or X.Y.Z-ent for Enterprise binary (e.g. 0.10.0 or 0.10.0-ent)
export VAULT_VERSION="0.10.3-ent"
export VAULT_VERSION="0.11.0"

# X.Y.Z or X.Y.Z-ent for Enterprise binary (e.g. 0.8.0 or 0.8.0-ent)
export NOMAD_VERSION="0.8.4-ent"
export NOMAD_VERSION="0.8.4"

# The below are aggregate lists of product versions to be published. Any
# time a product version above is updated, that new version _must_ be
Expand All @@ -38,11 +38,11 @@ export NOMAD_VERSION="0.8.4-ent"
# To make a `release_versions` images public, set the version map value to
# `true` or `false`. Enterprise images will _not_ be set to public even if
# `true` is set.
export RELEASE_VERSIONS='release_versions=[{"0.1.0"=true},{"0.1.1"=false},{"0.1.2"=true},{"0.1.3"=false},]'
export CONSUL_VERSIONS='consul_versions=["1.2.0","1.2.0-ent","1.2.1","1.2.1-ent",]'
export VAULT_VERSIONS='vault_versions=["0.10.3","0.10.3-ent","0.10.3","0.10.3-ent",]'
export NOMAD_VERSIONS='nomad_versions=["0.8.4","0.8.4-ent","0.8.4","0.8.4-ent",]'
export RELEASE_VERSIONS='release_versions=[{"0.1.0"=true},{"0.1.1"=false},{"0.1.2"=true},{"0.1.3"=false},{"0.1.4"=true},]'
export CONSUL_VERSIONS='consul_versions=["1.2.0","1.2.0-ent","1.2.1","1.2.1-ent","1.2.2",]'
export VAULT_VERSIONS='vault_versions=["0.10.3","0.10.3-ent","0.10.3","0.10.3-ent","0.11.0",]'
export NOMAD_VERSIONS='nomad_versions=["0.8.4","0.8.4-ent","0.8.4","0.8.4-ent","0.8.4"]'

# Force build or run on feature branch
export RUN_BUILD=false
export RUN_BUILD=true
export RUN_PUBLISH=false