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

MM updates #280

Merged
merged 38 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
59d32bb
fix typo (#3369) (#413)
modular-magician Jun 19, 2020
6300d63
Fix check for serial port disabled (#3695) (#415)
modular-magician Jun 19, 2020
b34219f
Add mode enum and scale down controls for Compute AutoScaler (#3693) …
modular-magician Jun 23, 2020
495a08f
added support for shielded nodes in container (#3639) (#417)
modular-magician Jul 7, 2020
2eb472b
fix memcache_parameters (#3733) (#418)
modular-magician Jul 8, 2020
b9fd5a0
add tiers and nfs_export_options (#3766) (#419)
modular-magician Jul 22, 2020
92356e2
Add skip enum value generation (#3767) (#420)
modular-magician Jul 23, 2020
b4396e6
Backend service support for internet NEG backend (#3782) (#421)
modular-magician Jul 25, 2020
3a9f29a
add firewall logging controls (#3780) (#422)
modular-magician Jul 28, 2020
932ef02
Fix colon in doc notes (#3796) (#423)
modular-magician Jul 29, 2020
9ee8357
Add persistence_iam_identity to Redis Instance (#3805) (#424)
modular-magician Aug 3, 2020
64ec4dc
Org Security Policies (Hierarchical Firewalls) (#3626) (#425)
modular-magician Aug 4, 2020
660eaf7
Adding Missing Cloud Build Attributes (#3627) (#426)
modular-magician Aug 5, 2020
55b6655
Add additional fields to Memcached Instance (#3821) (#427)
modular-magician Aug 5, 2020
bd1fe66
Convert inboundServices to an enum. (#3820) (#428)
modular-magician Aug 6, 2020
8baa33b
add source_image and source_snapshot to google_compute_image (#3799) …
modular-magician Aug 7, 2020
a60496e
Collection fixes for release (#3831) (#430)
modular-magician Aug 10, 2020
b4e8635
Add new field filter to pubsub. (#3759) (#431)
modular-magician Aug 11, 2020
b8772a7
Add archive class to gcs (#3867) (#432)
modular-magician Aug 14, 2020
706f919
Add support for gRPC healthchecks (#3825) (#433)
modular-magician Aug 17, 2020
5ae9667
Add enableMessageOrdering to Pub/Sub Subscription (#3872) (#434)
modular-magician Aug 17, 2020
8f497d6
Specify possible values for arg only once (#3874) (#435)
modular-magician Aug 17, 2020
aef0355
use {product}.googleapis.com endpoints (#3755) (#436)
modular-magician Aug 17, 2020
97d1dd4
Add vpcAccessConnector property on google_app_engine_standard_app_ver…
modular-magician Aug 19, 2020
62c0823
retrypolicy attribute added (#3843) (#438)
modular-magician Aug 21, 2020
4740dc9
add discovery endpoint (#3891) (#439)
modular-magician Aug 24, 2020
a7532ad
Advanced logging config options in google_compute_subnetwork (#3603) …
modular-magician Aug 25, 2020
5e860a3
Add Erase Windows VSS support to compute disk (#3898) (#441)
modular-magician Aug 27, 2020
7173605
Add Snapshot location to compute snapshot (#3896) (#442)
modular-magician Sep 4, 2020
054a8cd
Added missing 'all' option for protocol firewall rule (#3962) (#443)
modular-magician Sep 9, 2020
76663bb
Revert `eraseWindowsVssSignature` field and test (#3959) (#444)
modular-magician Sep 9, 2020
40c7ac9
Added support GRPC for google_compute_(region)_backend_service.protoc…
modular-magician Sep 11, 2020
f722276
Added properties of options & artifacts on google_cloudbuild_trigger …
modular-magician Sep 16, 2020
a5798d0
products/container: Add datapath provider field (#3956) (#447)
modular-magician Sep 16, 2020
3edd18f
Add SEV_CAPABLE option to google_compute_image (#3994) (#448)
modular-magician Sep 21, 2020
da36f4c
Add network peerings for inspec (#4002) (#449)
modular-magician Sep 22, 2020
37f3853
Update docs for pubsub targets in cloud scheduler (#4008) (#450)
modular-magician Sep 23, 2020
e08a6b8
Merge branch 'master' into master
skpaterson Sep 29, 2020
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
Prev Previous commit
Next Next commit
Adding Missing Cloud Build Attributes (#3627) (#426)
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Aug 5, 2020
commit 660eaf77ed3ad6442028487325ec8dbe7db58be9
42 changes: 42 additions & 0 deletions docs/resources/google_cloudbuild_trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Properties that can be accessed from the `google_cloudbuild_trigger` resource:

* `description`: Human-readable description of the trigger.

* `tags`: Tags for annotation of a BuildTrigger

* `disabled`: Whether the trigger is disabled or not. If true, the trigger will never result in a build.

* `create_time`: Time when the trigger was created.
Expand Down Expand Up @@ -87,12 +89,52 @@ Properties that can be accessed from the `google_cloudbuild_trigger` resource:

* `build`: Contents of the build template. Either a filename or build template must be provided.

* `source`: The location of the source files to build.

* `storage_source`: Location of the source in an archive file in Google Cloud Storage.

* `bucket`: Google Cloud Storage bucket containing the source.

* `object`: Google Cloud Storage object containing the source. This object must be a gzipped archive file (.tar.gz) containing source to build.

* `generation`: Google Cloud Storage generation for the object. If the generation is omitted, the latest generation will be used
Copy link

@rmoles rmoles Sep 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a bunch of instances of double-spacing throughout the resource documentation, this would probably need to be updated upstream though right?
It's not a huge issue at all though.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest we proceed with what's here but you're right, the spacing could be tweaked in a future MM PR to ensure consistency.


* `repo_source`: Location of the source in a Google Cloud Source Repository.

* `project_id`: ID of the project that owns the Cloud Source Repository. If omitted, the project ID requesting the build is assumed.

* `repo_name`: Name of the Cloud Source Repository.

* `dir`: Directory, relative to the source root, in which to run the build. This must be a relative path. If a step's dir is specified and is an absolute path, this value is ignored for that step's execution.

* `invert_regex`: Only trigger a build if the revision regex does NOT match the revision regex.

* `substitutions`: Substitutions to use in a triggered build. Should only be used with triggers.run

* `branch_name`: Regex matching branches to build. Exactly one a of branch name, tag, or commit SHA must be provided. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax

* `tag_name`: Regex matching tags to build. Exactly one a of branch name, tag, or commit SHA must be provided. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax

* `commit_sha`: Explicit commit SHA to build. Exactly one a of branch name, tag, or commit SHA must be provided.

* `tags`: Tags for annotation of a Build. These are not docker tags.

* `images`: A list of images to be pushed upon the successful completion of all build steps. The images are pushed using the builder service account's credentials. The digests of the pushed images will be stored in the Build resource's results field. If any of the images fail to be pushed, the build status is marked FAILURE.

* `substitutions`: Substitutions data for Build resource.

* `queue_ttl`: TTL in queue for this build. If provided and the build is enqueued longer than this value, the build will expire and the build status will be EXPIRED. The TTL starts ticking from createTime. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

* `logs_bucket`: Google Cloud Storage bucket where logs should be written. Logs file names will be of the format ${logsBucket}/log-${build_id}.txt.

* `timeout`: Amount of time that this build should be allowed to run, to second granularity. If this amount of time elapses, work on the build will cease and the build status will be TIMEOUT. This timeout must be equal to or greater than the sum of the timeouts for build steps within the build. The expected format is the number of seconds followed by s. Default time is ten minutes (600s).

* `secrets`: Secrets to decrypt using Cloud Key Management Service.

* `kms_key_name`: Cloud KMS key name to use to decrypt these envs.

* `secret_env`: Map of environment variable name to its encrypted value. Secret environment variables must be unique across all of a build's secrets, and must be used by at least one build step. Values can be at most 64 KB in size. There can be at most 100 secret values across all of a build's secrets.

* `steps`: The operations to be performed on the workspace.

* `name`: The name of the container image that will run this particular build step. If the image is available in the host's Docker daemon's cache, it will be run directly. If not, the host will attempt to pull the image first, using the builder service account's credentials if necessary. The Docker daemon's cache will already have the latest versions of all of the officially supported build steps (https://github.com/GoogleCloudPlatform/cloud-builders). The Docker daemon will also have cached many of the layers for some popular images, like "ubuntu", "debian", but they will be refreshed at the time you attempt to use them. If you built an image in a previous build step, it will be stored in the host's Docker daemon's cache and is available to use as the name for a later build step.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/google_cloudbuild_triggers.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ See [google_cloudbuild_trigger.md](google_cloudbuild_trigger.md) for more detail
* `ids`: an array of `google_cloudbuild_trigger` id
* `names`: an array of `google_cloudbuild_trigger` name
* `descriptions`: an array of `google_cloudbuild_trigger` description
* `tags`: an array of `google_cloudbuild_trigger` tags
* `disableds`: an array of `google_cloudbuild_trigger` disabled
* `create_times`: an array of `google_cloudbuild_trigger` create_time
* `substitutions`: an array of `google_cloudbuild_trigger` substitutions
Expand Down
19 changes: 19 additions & 0 deletions libraries/google/cloudbuild/property/trigger_build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,44 @@
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/cloudbuild/property/trigger_build_secrets'
require 'google/cloudbuild/property/trigger_build_source'
require 'google/cloudbuild/property/trigger_build_source_repo_source'
require 'google/cloudbuild/property/trigger_build_source_storage_source'
require 'google/cloudbuild/property/trigger_build_steps'
module GoogleInSpec
module CloudBuild
module Property
class TriggerBuild
attr_reader :source

attr_reader :tags

attr_reader :images

attr_reader :substitutions

attr_reader :queue_ttl

attr_reader :logs_bucket

attr_reader :timeout

attr_reader :secrets

attr_reader :steps

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@source = GoogleInSpec::CloudBuild::Property::TriggerBuildSource.new(args['source'], to_s)
@tags = args['tags']
@images = args['images']
@substitutions = args['substitutions']
@queue_ttl = args['queueTtl']
@logs_bucket = args['logsBucket']
@timeout = args['timeout']
@secrets = GoogleInSpec::CloudBuild::Property::TriggerBuildSecretsArray.parse(args['secrets'], to_s)
@steps = GoogleInSpec::CloudBuild::Property::TriggerBuildStepsArray.parse(args['steps'], to_s)
end

Expand Down
45 changes: 45 additions & 0 deletions libraries/google/cloudbuild/property/trigger_build_secrets.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module CloudBuild
module Property
class TriggerBuildSecrets
attr_reader :kms_key_name

attr_reader :secret_env

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@kms_key_name = args['kmsKeyName']
@secret_env = args['secretEnv']
end

def to_s
"#{@parent_identifier} TriggerBuildSecrets"
end
end

class TriggerBuildSecretsArray
def self.parse(value, parent_identifier)
return if value.nil?
return TriggerBuildSecrets.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| TriggerBuildSecrets.new(v, parent_identifier) }
end
end
end
end
end
39 changes: 39 additions & 0 deletions libraries/google/cloudbuild/property/trigger_build_source.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/cloudbuild/property/trigger_build_source_repo_source'
require 'google/cloudbuild/property/trigger_build_source_storage_source'
module GoogleInSpec
module CloudBuild
module Property
class TriggerBuildSource
attr_reader :storage_source

attr_reader :repo_source

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@storage_source = GoogleInSpec::CloudBuild::Property::TriggerBuildSourceStorageSource.new(args['storageSource'], to_s)
@repo_source = GoogleInSpec::CloudBuild::Property::TriggerBuildSourceRepoSource.new(args['repoSource'], to_s)
end

def to_s
"#{@parent_identifier} TriggerBuildSource"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module CloudBuild
module Property
class TriggerBuildSourceRepoSource
attr_reader :project_id

attr_reader :repo_name

attr_reader :dir

attr_reader :invert_regex

attr_reader :substitutions

attr_reader :branch_name

attr_reader :tag_name

attr_reader :commit_sha

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@project_id = args['projectId']
@repo_name = args['repoName']
@dir = args['dir']
@invert_regex = args['invertRegex']
@substitutions = args['substitutions']
@branch_name = args['branchName']
@tag_name = args['tagName']
@commit_sha = args['commitSha']
end

def to_s
"#{@parent_identifier} TriggerBuildSourceRepoSource"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module CloudBuild
module Property
class TriggerBuildSourceStorageSource
attr_reader :bucket

attr_reader :object

attr_reader :generation

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@bucket = args['bucket']
@object = args['object']
@generation = args['generation']
end

def to_s
"#{@parent_identifier} TriggerBuildSourceStorageSource"
end
end
end
end
end
6 changes: 6 additions & 0 deletions libraries/google_cloudbuild_trigger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
# ----------------------------------------------------------------------------
require 'gcp_backend'
require 'google/cloudbuild/property/trigger_build'
require 'google/cloudbuild/property/trigger_build_secrets'
require 'google/cloudbuild/property/trigger_build_source'
require 'google/cloudbuild/property/trigger_build_source_repo_source'
require 'google/cloudbuild/property/trigger_build_source_storage_source'
require 'google/cloudbuild/property/trigger_build_steps'
require 'google/cloudbuild/property/trigger_github'
require 'google/cloudbuild/property/trigger_github_pull_request'
Expand All @@ -31,6 +35,7 @@ class CloudBuildTrigger < GcpResourceBase
attr_reader :id
attr_reader :name
attr_reader :description
attr_reader :tags
attr_reader :disabled
attr_reader :create_time
attr_reader :substitutions
Expand All @@ -52,6 +57,7 @@ def parse
@id = @fetched['id']
@name = @fetched['name']
@description = @fetched['description']
@tags = @fetched['tags']
@disabled = @fetched['disabled']
@create_time = parse_time_string(@fetched['createTime'])
@substitutions = @fetched['substitutions']
Expand Down
2 changes: 2 additions & 0 deletions libraries/google_cloudbuild_triggers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class CloudBuildTriggers < GcpResourceBase
filter_table_config.add(:ids, field: :id)
filter_table_config.add(:names, field: :name)
filter_table_config.add(:descriptions, field: :description)
filter_table_config.add(:tags, field: :tags)
filter_table_config.add(:disableds, field: :disabled)
filter_table_config.add(:create_times, field: :create_time)
filter_table_config.add(:substitutions, field: :substitutions)
Expand Down Expand Up @@ -77,6 +78,7 @@ def transformers
'id' => ->(obj) { return :id, obj['id'] },
'name' => ->(obj) { return :name, obj['name'] },
'description' => ->(obj) { return :description, obj['description'] },
'tags' => ->(obj) { return :tags, obj['tags'] },
'disabled' => ->(obj) { return :disabled, obj['disabled'] },
'createTime' => ->(obj) { return :create_time, parse_time_string(obj['createTime']) },
'substitutions' => ->(obj) { return :substitutions, obj['substitutions'] },
Expand Down