mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-05-21 00:59:09 -07:00
Enabling working integration tests (#504)
Enabling tests that work without any further modification as an incremental step to enabling all integration tests. Enabling 22 / 64 tests. The following tests do not work today: - gcp_appengine_firewall_rule - gcp_bigtable_instance - gcp_cloudfunctions_cloud_function - gcp_cloudtasks_queue - gcp_compute_backend_service - gcp_compute_external_vpn_gateway - gcp_compute_forwarding_rule - gcp_compute_instance - gcp_compute_instance_group - gcp_compute_instance_group_manager - gcp_compute_instance_group_template - gcp_compute_node_group - gcp_compute_region_autoscaler - gcp_compute_region_instance_group_manager - gcp_compute_region_target_http_proxy - gcp_compute_region_target_https_proxy - gcp_compute_region_url_map - gcp_compute_route - gcp_compute_router - gcp_compute_ssl_certificate - gcp_compute_target_http_proxy - gcp_compute_target_https_proxy - gcp_compute_target_instance - gcp_compute_target_pool - gcp_compute_target_ssl_proxy - gcp_compute_target_tcp_proxy - gcp_compute_target_vpn_proxy - gcp_container_cluster - gcp_container_node_pool - gcp_iam_role - gcp_iam_service_account - gcp_iam_service_account_key - gcp_kms_key_ring - gcp_mlengine_version - gcp_redis_instance - gcp_resourcemanager_project - gcp_serviceusage_service - gcp_spanner_database - gcp_spanner_instance - gcp_sql_ssl_cert - gcp_storage_bucket - gcp_tpu_node
This commit is contained in:
parent
76677279f0
commit
c5723b214f
50 changed files with 121 additions and 87 deletions
60
scripts/bootstrap-project.sh
Executable file
60
scripts/bootstrap-project.sh
Executable file
|
@ -0,0 +1,60 @@
|
|||
#!/usr/bin/env bash
|
||||
# Bootstrap-project sets a project up so that ansible-test integration
|
||||
# can be run.
|
||||
#
|
||||
# dependencies:
|
||||
# - google-cloud-sdk (gcloud)
|
||||
#
|
||||
#
|
||||
PROJECT_ID="${1}"
|
||||
SERVICE_ACCOUNT_NAME="${2}"
|
||||
SERVICE_LIST=(
|
||||
"appengine"
|
||||
"bigtable"
|
||||
"cloudfunctions"
|
||||
"cloudkms.googleapis.com"
|
||||
"cloudresourcemanager.googleapis.com"
|
||||
"cloudscheduler.googleapis.com"
|
||||
"cloudtasks.googleapis.com"
|
||||
"container"
|
||||
"dns"
|
||||
"file.googleapis.com"
|
||||
"ml.googleapis.com"
|
||||
"runtimeconfig.googleapis.com"
|
||||
"sourcerepo.googleapis.com"
|
||||
"spanner.googleapis.com"
|
||||
"sqladmin.googleapis.com"
|
||||
"storage.googleapis.com"
|
||||
"tpu.googleapis.com"
|
||||
)
|
||||
|
||||
REQUIRED_ROLE_LIST=(
|
||||
"roles/storage.objectAdmin"
|
||||
"roles/source.admin"
|
||||
)
|
||||
|
||||
for SERVICE in "${SERVICE_LIST[@]}"; do
|
||||
echo "enabling service $SERVICE..."
|
||||
gcloud services enable "$SERVICE" --project="$PROJECT_ID"
|
||||
done
|
||||
|
||||
for ROLE in "${REQUIRED_ROLE_LIST[@]}"; do
|
||||
echo "enabling role $ROLE..."
|
||||
gcloud projects add-iam-policy-binding "$PROJECT_ID" \
|
||||
--member="serviceAccount:$SERVICE_ACCOUNT_NAME" \
|
||||
--role="$ROLE"
|
||||
done
|
||||
|
||||
if ! gcloud app describe --project="$PROJECT_ID" > /dev/null; then
|
||||
echo "creating appengine project..."
|
||||
gcloud app create --project="$PROJECT_ID" --region=us-central
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Add bindings
|
||||
|
||||
# roles/storage.objectAdmin
|
||||
|
||||
# The following is hard to automate, so echo
|
||||
echo "Done! It may take up to 10 minutes for some of the changes to fully propagate."
|
Loading…
Add table
Add a link
Reference in a new issue