-
Notifications
You must be signed in to change notification settings - Fork 54
/
ci-freebsd-12.yml
108 lines (108 loc) · 3.51 KB
/
ci-freebsd-12.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
description: Travis CI freebsd build env template!
variables:
docker_repository: travisci/ci-freebsd
docker_tag: packer-{{ timestamp }}-<%= git_desc %>
gce_account_file: "{{ env `GCE_ACCOUNT_FILE` }}"
gce_project_id: "{{ env `GCE_PROJECT_ID` }}"
image_name: travis-ci-freebsd-12-{{ timestamp }}-<%= git_desc %>
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` }}"
builders:
- type: googlecompute
name: googlecompute
communicator: ssh
ssh_timeout: 20m
state_timeout: 10m
ssh_port: 22
ssh_username: packer
image_description: Travis CI freebsd
account_file: "{{ user `gce_account_file` }}"
project_id: "{{ user `gce_project_id` }}"
source_image_project_id: freebsd-org-cloud-dev
source_image: freebsd-12-0-release-amd64
zone: us-central1-a
image_name: "{{ user `image_name` }}"
machine_type: n1-standard-4
disk_size: 30
tags:
- ci
- freebsd
- travis-ci-packer-templates
provisioners:
- type: shell
inline: sleep 10
only:
- googlecompute
- type: file
source: tmp/git-meta
destination: /var/tmp/git-meta
- type: file
source: packer-assets/travis_rsa.pub
destination: /var/tmp/travis_rsa.pub
- type: shell
scripts:
- packer-scripts/freebsd-update
- packer-scripts/pre-chef-bootstrap-bsd
- packer-scripts/clone-travis-cookbooks-bsd
- packer-scripts/freebsd-install-pkgs
- packer-scripts/freebsd-cleanup
environment_vars:
- 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 sh '{{ .Path }}'"
- 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 %>
run_list:
- recipe[travis_ci_freebsd_12]
<% if ENV['CHEF_PROFILING'] %>
- recipe[poise-profiler]
<% end %>
- type: shell
scripts:
- packer-scripts/create-freebsd-job-board-data
- packer-scripts/create-image-metadata-tarball-bsd
environment_vars:
- JOB_BOARD_REGISTER_FILE=/.job_board_register.yml
- JOB_BOARD_IMAGE_DIST={{ user `dist_name` }}
- PACKER_ENV_DIR=/.packer-env
- SYSTEM_INFO_JSON=/c/travis_system_info.json
- NODE_ATTRIBUTES_YML=/.node-attributes.yml
- RSPEC_JSON_DIR=/home/travis
- DPKG_MANIFEST_JSON=/.dpkg-manifest.json
- BIN_LIB_CHECKSUMS=/.bin-lib.SHA256SUMS
- IMAGE_METADATA_TARBALL=/var/tmp/image-metadata-{{ user `image_name` }}.tar.bz2
execute_command: "{{ .Vars }} exec sudo -E -S sh '{{ .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: shell-local
script: bin/job-board-register
environment_vars:
- IMAGE_NAME={{ user `image_name` }}
only:
- googlecompute
-
- type: shell-local
script: bin/write-latest-image-name