Skip to content

Commit

Permalink
Merge cef6e01 into 6d132d6
Browse files Browse the repository at this point in the history
  • Loading branch information
slevenick authored Oct 4, 2018
2 parents 6d132d6 + cef6e01 commit 9cd4fe7
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .ci/vars.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set chef_modules = ['_bundle', 'auth', 'compute', 'sql', 'storage', 'spanner', 'container', 'dns', 'iam'] %}
{% set chef_modules = ['_bundle', 'auth', 'bigquery', 'compute', 'sql', 'storage', 'spanner', 'container', 'dns', 'iam'] %}
{% set puppet_modules = ['_bundle', 'auth', 'bigquery', 'compute', 'sql', 'storage', 'spanner', 'container', 'dns', 'pubsub', 'resourcemanager'] %}
{% set puppet_no_release = ['bigquery'] %}
{% macro names_as_list(repo, names) -%}
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,6 @@
[submodule "build/chef/iam"]
path = build/chef/iam
url = [email protected]:GoogleCloudPlatform/chef-google-iam.git
[submodule "build/chef/bigquery"]
path = build/chef/bigquery
url = https://github.com/GoogleCloudPlatform/chef-google-bigquery
1 change: 1 addition & 0 deletions build/chef/bigquery
Submodule bigquery added at 582fa4
43 changes: 43 additions & 0 deletions products/bigquery/chef.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

--- !ruby/object:Provider::Chef::Config
manifest: !ruby/object:Provider::Chef::Manifest
version: '0.1.0'
source: 'https://github.com/GoogleCloudPlatform/chef-google-bigquery'
issues: 'https://github.com/GoogleCloudPlatform/chef-google-bigquery/issues'
summary: 'A Chef cookbook to manage Google Cloud BigQuery resources'
description: |
This cookbook provides the built-in types and services for Chef to manage
Google Cloud BigQuery resources, as native Chef types.
depends:
<%= indent(compile('provider/chef/common~depends.yaml'), 4) %>
operating_systems:
<%= indent(include('provider/chef/common~operating_systems.yaml'), 4) %>
overrides: !ruby/object:Provider::ResourceOverrides
examples: !ruby/object:Api::Resource::HashArray
Dataset:
- dataset.rb
files: !ruby/object:Provider::Config::Files
copy:
<%= indent(compile('provider/chef/common~copy.yaml'), 4) %>
compile:
<%= indent(include('provider/chef/common~compile~before.yaml'), 4) %>
<%= indent(include('provider/chef/common~compile~after.yaml'), 4) %>
<% # common~compile~after.yaml should be the last line of compile: section -%>
style:
changelog:
- !ruby/object:Provider::Config::Changelog
version: '0.1.0'
date: 2018-09-15T09:00:00-0700
general: 'Initial release'
31 changes: 31 additions & 0 deletions products/bigquery/examples/chef/dataset.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<%# The license inside this block applies to this file
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-%>
<% unless name == 'README.md' -%>
<%= compile 'templates/license.erb' -%>
<%= lines(autogen_notice :chef) -%>

<% end -%>
<%= compile 'templates/chef/example~auth.rb.erb' -%>
gbigquery_dataset <%= example_resource_name('example_dataset') -%> do
action :create
dataset_reference ({
dataset_id: 'example_dataset'
})
project ENV['PROJECT'] # e.g. 'my-test-project'
credential 'mycred'
end
27 changes: 27 additions & 0 deletions products/bigquery/examples/chef/delete_dataset.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<%# The license inside this block applies to this file
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-%>
<% unless name == "README.md" -%>
<%= compile 'templates/license.erb' -%>
<%= lines(autogen_notice :chef) -%>

<%= compile 'templates/chef/example~auth.rb.erb' -%>
<% end # name == README.md -%>
gbigquery_dataset '<%= example_resource_name('example_dataset') -%>' do
action :delete
project ENV['PROJECT'] # e.g. 'my-test-project'
credential 'mycred'
end
31 changes: 31 additions & 0 deletions products/bigquery/examples/chef/readme.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<%# The license inside this block applies to this file
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-%>
<% unless name == 'README.md' -%>

<%= compile 'templates/license.erb' -%>
<%= lines(autogen_notice :chef) -%>

<% end -%>
<%= compile 'templates/chef/example~auth.rb.erb' -%>
gbigquery_dataset <%= example_resource_name('example_dataset') -%> do
action :create
dataset_reference ({
dataset_id: 'example_dataset'
})
project ENV['PROJECT'] # e.g. 'my-test-project'
credential 'mycred'
end
43 changes: 43 additions & 0 deletions products/bigquery/examples/chef/table.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<%# The license inside this block applies to this file
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-%>
<% unless name == 'README.md' -%>
<%= compile 'templates/license.erb' -%>
<%= lines(autogen_notice :chef) -%>

<% end -%>
<%= compile 'templates/chef/example~auth.rb.erb' -%>
gbigquery_dataset <%= example_resource_name('example_dataset') -%> do
action :create
dataset_reference ({
dataset_id: 'example_dataset'
})
project ENV['PROJECT'] # e.g. 'my-test-project'
credential 'mycred'
end
gbigquery_table <%= example_resource_name('example_table') -%> do
action :create
dataset <%= example_resource_name('example_dataset') -%>
table_reference ({
dataset_id: <%= example_resource_name('example_dataset') -%>,
project_id: ENV['PROJECT'],
table_id: <%= example_resource_name('example_table') -%>
})
project ENV['PROJECT'] # e.g. 'my-test-project'
credential 'mycred'
end

0 comments on commit 9cd4fe7

Please sign in to comment.