Skip to content

Commit

Permalink
Merge pull request #15 from Cobollatin/feature/batch
Browse files Browse the repository at this point in the history
removed batch application
  • Loading branch information
Cobollatin authored May 2, 2024
2 parents 9261ee0 + 1076c71 commit 4c238d2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
1 change: 0 additions & 1 deletion infrastructure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ No modules.
| Name | Type |
|------|------|
| [azurerm_batch_account.use2_main_batch](https://registry.terraform.io/providers/hashicorp/azurerm/3.101.0/docs/resources/batch_account) | resource |
| [azurerm_batch_application.use2_main_batch_app](https://registry.terraform.io/providers/hashicorp/azurerm/3.101.0/docs/resources/batch_application) | resource |
| [azurerm_container_registry.use2_main_acr](https://registry.terraform.io/providers/hashicorp/azurerm/3.101.0/docs/resources/container_registry) | resource |
| [azurerm_network_security_group.use2_swa_nsg](https://registry.terraform.io/providers/hashicorp/azurerm/3.101.0/docs/resources/network_security_group) | resource |
| [azurerm_network_watcher.use2_main_nwwatcher](https://registry.terraform.io/providers/hashicorp/azurerm/3.101.0/docs/resources/network_watcher) | resource |
Expand Down
7 changes: 0 additions & 7 deletions infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,6 @@ resource "azurerm_batch_account" "use2_main_batch" {
}
}

resource "azurerm_batch_application" "use2_main_batch_app" {
name = "${var.app_name}-${var.location_short}-${var.environment_name}-batch-app"
resource_group_name = azurerm_resource_group.use2_main_rg.name
account_name = azurerm_batch_account.use2_main_batch.name
display_name = "${var.app_name}-${var.location_short}-${var.environment_name}-batch-app"
}

# resource "azurerm_batch_pool" "use2_main_batch_pool" {
# name = "${var.app_name}-${var.location_short}-${var.environment_name}-batch-pool"
# resource_group_name = azurerm_resource_group.use2_main_rg.name
Expand Down
12 changes: 12 additions & 0 deletions scripts/boostrap/booststrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ set -e
# It is assumed these scripts are located in the same directory as the current script.
CREATE_AZURE_CREDENTIALS_SCRIPT="./create_azure_credentials.sh"
CREATE_AZURE_STORAGE_ACCOUNT_SCRIPT="./create_azure_storage_account.sh"
CREATE_AZURE_SUBSCRIPTION_NAMESPACES_REGISTRATION_SCRIPT="./create_azure_subscription_namespaces_registration.sh"
CREATE_GITHUB_SECRET_SCRIPT="./create_github_secret.sh"

# Make sure both scripts that are necessary for setting up the environment
# are executable. This is a precaution to avoid run-time errors related to permissions.
Expand All @@ -27,5 +29,15 @@ echo "Creating Azure Storage Account..."
# Execute the script to create the Azure Storage Account.
$CREATE_AZURE_STORAGE_ACCOUNT_SCRIPT

# Inform the user that the registration of Azure subscription namespaces is starting.
echo "Registering Azure subscription namespaces..."
# Execute the script to register Azure subscription namespaces.
$CREATE_AZURE_SUBSCRIPTION_NAMESPACES_REGISTRATION_SCRIPT

# Inform the user that the creation of the GitHub secret is starting.
echo "Creating GitHub secret..."
# Execute the script to create the GitHub secret.
$CREATE_GITHUB_SECRET_SCRIPT

# Indicate to the user that the bootstrap process is complete.
echo "Bootstrap complete!"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

NAMESPACES=("Microsoft.Batch")

for NAMESPACE in "${NAMESPACES[@]}"
do
az provider register --namespace $NAMESPACE
done

echo "Azure subscription namespaces registered."
4 changes: 3 additions & 1 deletion scripts/boostrap/create_github_token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
GITHUB_REPO="Cobollatin/jw-semantic-searcher" # The format is: user/repo
GITHUB_TOKEN=$(gh auth status --show-token)

gh secret set GITHUB_TOKEN -b"$GITHUB_TOKEN" --repo $GITHUB_REPO
gh secret set GITHUB_TOKEN -b"$GITHUB_TOKEN" --repo $GITHUB_REPO

echo "GitHub token created successfully"

0 comments on commit 4c238d2

Please sign in to comment.