Skip to content

Commit

Permalink
Stop CGC Sample generation (#6505)
Browse files Browse the repository at this point in the history
  • Loading branch information
c2thorn authored Sep 2, 2022
1 parent ddca05e commit 9153424
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 52 deletions.
28 changes: 0 additions & 28 deletions .ci/gcb-push-downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,34 +136,6 @@ steps:
- -c
- git push https://modular-magician:$$GITHUB_TOKEN@github.com/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tf-oics-sync

# TF-CLOUD-DOCS
- name: 'gcr.io/graphite-docker-images/downstream-waiter'
id: tf-cloud-docs-sync
secretEnv: ["GITHUB_TOKEN"]
waitFor: ["checkout"]
args:
- 'tf-cloud-docs-sync'
- $BRANCH_NAME
- $COMMIT_SHA

- name: 'gcr.io/graphite-docker-images/downstream-builder'
secretEnv: ["GITHUB_TOKEN"]
id: tf-cloud-docs-push
waitFor: ["tf-cloud-docs-sync"]
args:
- 'downstream'
- 'tf-cloud-docs'
- 'beta'
- $COMMIT_SHA

- name: 'gcr.io/cloud-builders/git'
waitFor: ["tf-cloud-docs-push"]
secretEnv: ["GITHUB_TOKEN"]
entrypoint: 'bash'
args:
- -c
- git push https://modular-magician:$$GITHUB_TOKEN@github.com/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tf-cloud-docs-sync

- name: 'gcr.io/graphite-docker-images/vcr-cassette-merger'
secretEnv: ["GITHUB_TOKEN", "GOOGLE_PROJECT"]
waitFor: ["tpg-push"]
Expand Down
25 changes: 1 addition & 24 deletions mmv1/provider/terraform_cloud_docs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,7 @@ def generate(output_folder, types, _product_path, _dump_yaml, generate_code, gen
end

# Create a directory of examples per resource
def generate_resource(pwd, data, _generate_code, generate_docs)
return unless generate_docs

examples = data.object.examples

examples.each do |example|
target_folder = data.output_folder
target_folder = File.join(target_folder, example.name)
FileUtils.mkpath target_folder

data.example = example

File.open(pwd + '/' + example.config_path).each_line do |line|
next unless line.include? '# [START'

Google::LOGGER.info "Found CGC sample #{example.name}"
data.generate(pwd,
'templates/terraform/examples/base_configs/cloud_docs_example_file.tf.erb',
File.join(target_folder, 'main.tf'),
self)
break
end
end
end
def generate_resource(pwd, data, _generate_code, generate_docs) end

# We don't want to generate anything but the resource.
def generate_resource_tests(pwd, data) end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# [START cloud_sql_postgres_instance_80_db_n1_s2]
# Testing CGC-only change
resource "google_sql_database_instance" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['database_instance_name'] %>"
region = "us-central1"
Expand Down

0 comments on commit 9153424

Please sign in to comment.