-
Notifications
You must be signed in to change notification settings - Fork 54
Simplify image naming and packaging #690
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
Open
joshk
wants to merge
11
commits into
master
Choose a base branch
from
joshk/updated-naming-and-packaging
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f08fcdb
create a single ubuntu-1604 image
joshk 671d80b
corrections to the ubuntu 1604 config
joshk c26383d
updates to elixir and erlang
joshk 2cd2063
fix some specs
joshk db092d2
foundations for an ubuntu 18.04 image
joshk 4d266e5
foundations for an ubuntu 14.04 image
joshk 207fbf0
update the 14.04 packages list
joshk f9534ea
remove job board registration for now
joshk 919a44d
use source_image_family with all templates
joshk f9c09a3
don't install 3.7.1 on 14.04
joshk 30b4321
use the trusty-stable branch for 14.04
joshk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,211 @@ | ||
--- | ||
description: Travis CI Ubuntu 16.04 build environment template | ||
variables: | ||
docker_repository: travisci/ci-ubuntu-1604 | ||
docker_tag: packer-{{ timestamp }}-<%= git_desc %> | ||
gce_account_file: "{{ env `GCE_ACCOUNT_FILE` }}" | ||
gce_project_id: "{{ env `GCE_PROJECT_ID` }}" | ||
image_name: travis-ci-ubuntu-1604-{{ timestamp }}-<%= git_desc %> | ||
image_family: travis-ci-ubuntu-1604-edge | ||
openstack_source_image_name: "{{ env `OS_SOURCE_IMAGE_XENIAL` }}" | ||
travis_cookbooks_branch: "{{ env `TRAVIS_COOKBOOKS_BRANCH` }}" | ||
travis_cookbooks_edge_branch: master | ||
travis_cookbooks_sha: "{{ env `TRAVIS_COOKBOOKS_SHA` }}" | ||
travis_uid: "{{ env `TRAVIS_UID` }}" | ||
github_token: "{{ env `GITHUB_NOSCOPE_TOKEN` }}" | ||
openstack_zone: "{{ env `OS_ZONE` }}" | ||
openstack_key_path: "{{ env `OS_SSH_KEY_PATH`}}" | ||
openstack_key_name: "{{ env `OS_SSH_KEY` }}" | ||
builders: | ||
- type: googlecompute | ||
name: googlecompute | ||
communicator: ssh | ||
ssh_timeout: 10m | ||
ssh_port: 22 | ||
ssh_username: packer | ||
image_description: Travis CI Ubuntu 16.04 | ||
account_file: "{{ user `gce_account_file` }}" | ||
project_id: "{{ user `gce_project_id` }}" | ||
source_image_family: ubuntu-1604-lts | ||
image_licenses: ["projects/vm-options/global/licenses/enable-vmx"] | ||
zone: us-central1-a | ||
image_name: "{{ user `image_name` }}" | ||
image_family: "{{ user `image_family` }}" | ||
machine_type: n1-standard-4 | ||
disk_size: 20 | ||
tags: | ||
- ci | ||
- ubuntu-1604 | ||
- travis-ci-packer-templates | ||
- type: docker | ||
name: docker | ||
ssh_pty: true | ||
<% if RUBY_PLATFORM =~ /powerpc64/ %> | ||
image: "travisci/gce-parity:16.04-ppc64le" | ||
<% else %> | ||
image: "travisci/gce-parity:16.04" | ||
<% end %> | ||
run_command: | ||
- -d | ||
- -v | ||
- <%= Dir.pwd %>/tmp/packer-builder-tmp:/tmp | ||
- --privileged=true | ||
- --storage-opt=size=15G | ||
- "{{ .Image }}" | ||
- /sbin/init | ||
commit: true | ||
# Openstack builds disabled for failing with an error that's not possible to debug | ||
# until a fix for the Packer error reporting is released: | ||
# https://github.com/travis-ci/packer-templates/issues/555 | ||
- type: openstack | ||
name: openstack | ||
flavor: m1.large | ||
insecure: true | ||
image_name: "{{ user `image_name` }}" | ||
ssh_username: ubuntu | ||
networks: | ||
<% ENV['OS_NETWORKS'].to_s.split(',').map(&:strip).each do |network| %> | ||
- <%= network %> | ||
<% end %> | ||
source_image_name: "{{ user `openstack_source_image_name` }}" | ||
availability_zone: "{{ user `openstack_zone` }}" | ||
ssh_keypair_name: "{{ user `openstack_key_name` }}" | ||
ssh_private_key_file: "{{ user `openstack_key_path` }}" | ||
provisioners: | ||
- type: shell | ||
inline: sleep 10 | ||
only: | ||
- googlecompute | ||
- type: shell | ||
inline: apt-get update -yqq && apt-get install sudo -yqq | ||
# Delay script execution until after /sbin/init has cleared out /tmp, | ||
# otherwise the uploaded script gets deleted before it can be run. | ||
# TODO: Decide if the container startup command should be /bin/bash and the | ||
# /sbin/init call made the first provision step instead of this workaround: | ||
# https://github.com/travis-ci/packer-templates/issues/544#issuecomment-344971947 | ||
pause_before: 5s | ||
only: | ||
- docker | ||
- type: file | ||
source: tmp/git-meta | ||
destination: /var/tmp/git-meta | ||
- type: file | ||
source: packer-assets/ubuntu-1604-normal-purge.txt | ||
destination: /var/tmp/purge.txt | ||
- type: file | ||
source: packer-assets/ubuntu-1604-ci-packages.txt | ||
destination: /var/tmp/packages.txt | ||
only: | ||
- googlecompute | ||
- openstack | ||
- type: file | ||
source: packer-assets/ubuntu-xenial-ci-sardonyx-docker-packages.txt | ||
destination: /var/tmp/packages.txt | ||
only: | ||
- docker | ||
- type: shell | ||
scripts: | ||
- packer-scripts/packer-env-dump | ||
execute_command: "{{ .Vars }} exec sudo -E -S bash '{{ .Path }}'" | ||
- type: shell | ||
scripts: | ||
- packer-scripts/remove-default-users | ||
execute_command: "{{ .Vars }} exec sudo -E -S bash '{{ .Path }}'" | ||
only: | ||
- docker | ||
- googlecompute | ||
- type: shell | ||
scripts: | ||
- packer-scripts/pre-chef-bootstrap | ||
- packer-scripts/clone-travis-cookbooks | ||
environment_vars: | ||
- SKIP_APT_UPGRADE=1 | ||
- TRAVIS_COOKBOOKS_BRANCH={{ user `travis_cookbooks_branch` }} | ||
- TRAVIS_COOKBOOKS_SHA={{ user `travis_cookbooks_sha` }} | ||
- TRAVIS_UID={{ user `travis_uid` }} | ||
execute_command: "{{ .Vars }} exec sudo -E -S bash '{{ .Path }}'" | ||
- type: file | ||
source: packer-assets/ubuntu-1604-system-info-commands.yml | ||
destination: /var/tmp/ubuntu-1604-system-info-commands.yml | ||
- type: shell | ||
inline: chmod 0644 /var/tmp/ubuntu-1604-system-info-commands.yml | ||
- type: chef-solo | ||
version: 13.8.5 | ||
config_template: chef-solo.rb.tmpl | ||
<% if ENV['CHEF_PROFILING'] %> | ||
execute_command: "{{if .Sudo}}sudo {{end}}CI=yes chef-solo -F doc --no-color -c {{.ConfigPath}} -j {{.JsonPath}}" | ||
<% end %> | ||
cookbook_paths: | ||
- cookbooks | ||
<% if ENV['COOKBOOKS_LOCAL'] && ENV['TRAVIS_COOKBOOKS_DIR'] %> | ||
- <%= ENV['TRAVIS_COOKBOOKS_DIR'] %>/cookbooks | ||
- <%= ENV['TRAVIS_COOKBOOKS_DIR'] %>/community-cookbooks | ||
<% else %> | ||
remote_cookbook_paths: | ||
- /tmp/chef-stuff/travis-cookbooks/cookbooks | ||
- /tmp/chef-stuff/travis-cookbooks/community-cookbooks | ||
<% end %> | ||
json: | ||
travis_packer_build: | ||
github_token: "{{ user `github_token` }}" | ||
run_list: | ||
- recipe[travis_ci_ubuntu_1604] | ||
<% if ENV['CHEF_PROFILING'] %> | ||
- recipe[poise-profiler] | ||
<% end %> | ||
- type: shell | ||
scripts: | ||
- packer-scripts/ensure-travis-user | ||
- packer-scripts/purge | ||
- packer-scripts/disable-apparmor | ||
- packer-scripts/run-serverspecs | ||
- packer-scripts/test-system-info-output | ||
- packer-scripts/dump-dpkg-manifest | ||
- packer-scripts/create-bin-lib-checksums | ||
- packer-scripts/cleanup | ||
# - packer-scripts/minimize | ||
environment_vars: | ||
- DISPLAY=:99.0 | ||
- SPEC_SUITES=travis_packer_templates | ||
- TRAVIS_OBFUSCATE_PASSWORD=1 | ||
- TRAVIS_UID={{ user `travis_uid` }} | ||
execute_command: "{{ .Vars }} exec sudo -E -S bash '{{ .Path }}'" | ||
- type: shell | ||
scripts: | ||
- packer-scripts/create-image-metadata-tarball | ||
environment_vars: | ||
- IMAGE_METADATA_TARBALL=/var/tmp/image-metadata-{{ user `image_name` }}.tar.bz2 | ||
execute_command: "{{ .Vars }} exec sudo -E -S bash '{{ .Path }}'" | ||
- type: file | ||
source: /var/tmp/image-metadata-{{ user `image_name` }}.tar.bz2 | ||
destination: tmp/image-metadata-{{ user `image_name` }}.tar.bz2 | ||
direction: download | ||
post-processors: | ||
- | ||
- type: docker-tag | ||
repository: "{{ user `docker_repository` }}" | ||
tag: "{{ user `docker_tag` }}" | ||
only: | ||
- docker | ||
- type: shell-local | ||
scripts: bin/docker-push | ||
environment_vars: | ||
- DOCKER_DEST={{ user `docker_repository` }}:{{ user `docker_tag` }} | ||
only: | ||
- docker | ||
- | ||
- type: shell-local | ||
script: bin/job-board-register | ||
environment_vars: | ||
- IMAGE_NAME={{ user `image_name` }} | ||
only: | ||
- googlecompute | ||
- type: shell-local | ||
script: bin/job-board-register | ||
environment_vars: | ||
- IMAGE_NAME={{ user `docker_repository` }}:{{ user `docker_tag` }} | ||
only: | ||
- docker | ||
- | ||
- type: shell-local | ||
script: bin/write-latest-image-name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--color | ||
--format documentation | ||
--require support | ||
--order rand |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
travis_ci_ubuntu_1604 Cookbook | ||
========================= | ||
|
||
A wrapper cookbook for the "ubuntu_1604" CI image. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: what about naming this file
travis-ci-ubuntu-1604.yml
to go with the name of the sub directory in the cookbooks i.e.cookbooks/travis_ci_ubuntu_1604
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was mostly following the previous naming conventions, I can look into this renaming.