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

Quicksilver Scripts #10

Merged
merged 10 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions pantheon.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Put overrides to your pantheon.upstream.yml file here.
# For more information, see: https://pantheon.io/docs/pantheon-yml/
api_version: 1

workflows:
create_cloud_development_environment:
after:
- type: webphp
description: Lock Multidevs on Creation
script: private/scripts/lock-multidevs.php
26 changes: 26 additions & 0 deletions private/scripts/lock-multidevs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
// Auto-lock new environments. Uses the site name, and site name + environment name as the username/password combo.

$pantheon_site = $_ENV['PANTHEON_SITE_NAME']; // The friendly name of your site, (ie: veeva-eu)
$pantheon_env = $_ENV['PANTHEON_ENVIRONMENT']; // The name of the multidev (ie: pr-10)


if ( isset( $pantheon_env ) && isset( $_POST['environment'] ) ) {

$data = json_encode(
[
'type' => 'lock_environment', // Workflow type.
'environment' => $pantheon_env,
'params' => [
"username" => $pantheon_site,
"password" => $pantheon_site . '-' . $pantheon_env,
]
]
);


echo "--- Start workflow: lock_environment -- \n\n";
$result = pantheon_curl('https://api.live.getpantheon.com/sites/self/environments/self/workflows', $data, 8443, 'POST');
echo "--- End workflow: lock_environment -- \n\n";

}
Loading