-
Notifications
You must be signed in to change notification settings - Fork 25
Feature/GitHub AKS Provisioning #160
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
Open
prathibhapadma
wants to merge
54
commits into
devonfw:master
Choose a base branch
from
prathibhapadma:feature/github_aks_provision
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
318f1f8
updated with AKS provision workflow in github action
prathibhapadma 069c94a
updated with AKS provision workflow in github action
prathibhapadma 7d28403
automatic commit dor docs
prathibhapadma 5ea4d24
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma f70b423
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma ec02564
automatic commit dor docs
prathibhapadma 81cb809
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma 412c2a7
Merge branch 'master' into feature/github_aks_provision
prathibhapadma 9008087
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma be22db0
Automatic generation of documentation
prathibhapadma d81e5ab
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma 22f0704
Automatic generation of documentation
prathibhapadma 5c30817
Create setup-aks-provisioning-pipeline.asciidoc
prathibhapadma 74f6b58
Delete documentation/src directory
prathibhapadma 2488464
Merge branch 'devonfw:master' into feature/github_aks_provision
prathibhapadma 8fc8de7
updating aks provision document
prathibhapadma 62f4add
Automatic generation of documentation
prathibhapadma 1a486b6
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma 2df5177
Automatic generation of documentation
prathibhapadma 4002c10
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma 9927dd8
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma 6008fd0
Automatic generation of documentation
prathibhapadma b87f5e7
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma 43d0a9c
Automatic generation of documentation
prathibhapadma dd01418
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma 895e452
Automatic generation of documentation
prathibhapadma 4ac04d0
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma 1250980
Automatic generation of documentation
prathibhapadma 24d98ed
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma c5554a1
Automatic generation of documentation
prathibhapadma e95872b
Merge branch 'devonfw:master' into feature/github_aks_provision
prathibhapadma e27a753
updated cluster name in azure devops pipeline
prathibhapadma 5a20455
Automatic generation of documentation
prathibhapadma f2b19b1
Update aks-provisioning.yml.template
prathibhapadma 26b457f
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma e62c914
Automatic generation of documentation
prathibhapadma 21868f9
Update terraform.tfvars
prathibhapadma 821c228
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma 42b78f3
Automatic generation of documentation
prathibhapadma be8d44d
Merge branch 'devonfw:master' into feature/github_aks_provision
prathibhapadma ae6d73a
Update aks-provisioning.yml.template
prathibhapadma aa8a072
Update aks-provisioning.yml.template
prathibhapadma efbd4df
Merge branch 'master' into feature/github_aks_provision
prathibhapadma c05d1a2
updated with common variable group
prathibhapadma 30f9517
Update aks-provisioning.yml.template
prathibhapadma 89cd9b5
fixed end of the lines
prathibhapadma 58929fd
cluster name in help for aks
ultymatom 15e22f9
Merge branch 'master' into feature/github_aks_provision
ultymatom 8f5029a
Update aks-provisioning.yml.template
prathibhapadma d97e86a
Update setup-aks-provisioning-pipeline.asciidoc
prathibhapadma 3843096
Automatic generation of documentation
prathibhapadma 8d551bb
Merge branch 'devonfw:master' into feature/github_aks_provision
prathibhapadma 6e8cb73
Merge branch 'master' into feature/github_aks_provision
prathibhapadma 1f8e2e0
Automatic generation of documentation
prathibhapadma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
97 changes: 8 additions & 89 deletions
97
documentation/azure-devops/setup-aks-provisioning-pipeline.asciidoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,89 +1,8 @@ | ||
| = Setting up a Azure AKS provisioning pipeline on Azure DevOps | ||
|
|
||
| In this section we will create a pipeline which will provision an Azure AKS cluster. This pipeline will be configured to be manually triggered by the user. As part of AKS cluster provisioning, a NGINX Ingress controller is deployed and a variable group with the name `aks-variables` is created, which contains, among others, the DNS name of the Ingress controller, that you you will need to add as CNAME record on the domains used in your application Ingress manifest files. Refer to the appendix to retrieve the DNS name of the Ingress controller independently. | ||
|
|
||
| The creation of the pipeline will follow the project workflow, so a new branch named `feature/aks-provisioning` will be created, the YAML file for the pipeline and the terraform files for creating the cluster will be pushed to it. | ||
|
|
||
| Then, a Pull Request (PR) will be created in order to merge the new branch into the appropiate branch (provided in `-b` flag). The PR will be automatically merged if the repository policies are met. If the merge is not possible, either the PR URL will be shown as output, or it will be opened in your web browser if using `-w` flag. | ||
|
|
||
| The script located at `/scripts/pipelines/azure-devops/pipeline_generator.sh` will automatically create this new branch, create the AKS provisioning pipeline based on the YAML template, create the Pull Request and, if it is possible, merge this new branch into the specified branch. | ||
|
|
||
| == Prerequisites | ||
|
|
||
| * Install the https://marketplace.visualstudio.com/items?itemName=ms-devlabs.custom-terraform-tasks[Terraform extension] for Azure DevOps. | ||
| * Create a https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml#create-a-service-connection[service connection] to Azure Resource Manager and name it `aks-connection`. If you already have a service connection available or you need a specific connection name, please update `aks-pipeline.cfg` accordingly. | ||
| * An Azure resource group in the desired cluster location (e.g. `westeurope`). You can use an existing one or create a new one with the following command: | ||
|
|
||
| ``` | ||
| az group create -n <resource group name> -l <location> | ||
| ``` | ||
|
|
||
| * An Azure storage account within the previous resource group. You can use an existing one or create a new one with the following command: | ||
|
|
||
| ``` | ||
| az storage account create -n <storage account name> -g <resource group name> -l <location> | ||
| ``` | ||
|
|
||
| * An Azure storage container in Azure within the previous storage account. You can use an existing one or create a new one with the following command: | ||
|
|
||
| ``` | ||
| az storage container create -n <storage container name> --account-name <storage account name> | ||
| ``` | ||
|
|
||
| * This script will commit and push the corresponding YAML template into your repository, so please be sure your local repository is up-to-date (i.e you have pulled the latest changes with `git pull`). | ||
|
|
||
| == Creating the pipeline using provided script | ||
|
|
||
| Before executing the script you will need to customize some input variables about the environment. To do so, you can either edit `terraform.tfvars` file or take advantage of the `set-terraform-variables.sh` script located at `/scripts/environment-provisioning/azure/aks`, which allows you to create or update values for the required variables, passing them as flags. As a full example: | ||
|
|
||
| ``` | ||
| ./set-terraform-variables.sh --cluster_name <cluster name> --location <location> --resource_group_name <resource group name> --instance_type <worker instance type> --worker_node_count <number of worker nodes> --dns_prefix <dns prefix> | ||
| ``` | ||
|
|
||
| === Usage | ||
| ``` | ||
| pipeline_generator.sh \ | ||
| -c <config file path> \ | ||
| -n <pipeline name> \ | ||
| -d <project local path> \ | ||
| --resource-group <resource group name> \ | ||
| --storage-account <storage account name> \ | ||
| --storage-container <storage container name> \ | ||
| [-b <branch>] \ | ||
| [-w] | ||
| ``` | ||
|
|
||
| NOTE: The config file for the AKS provisioning pipeline is located at `/scripts/pipelines/azure-devops/templates/aks/aks-pipeline.cfg`. | ||
|
|
||
| === Flags | ||
| ``` | ||
| -c, --config-file [Required] Configuration file containing pipeline definition. | ||
| -n, --pipeline-name [Required] Name that will be set to the pipeline. | ||
| -d, --local-directory [Required] Local directory of your project (the path should always be using '/' and not '\'). | ||
| --resource-group [Required] Name of the resource group for the cluster. | ||
| --storage--account [Required] Name of the storage account for the cluster. | ||
| --storage-container [Required] Name of the storage container where the Terraform state of the cluster will be stored. | ||
| -b, --target-branch Name of the branch to which the Pull Request will target. PR is not created if the flag is not provided. | ||
| -w Open the Pull Request on the web browser if it cannot be automatically merged. Requires -b flag. | ||
| ``` | ||
|
|
||
| === Example | ||
|
|
||
| ``` | ||
| ./pipeline_generator.sh -c ./templates/aks/aks-pipeline.cfg -n aks-provisioning -d C:/Users/$USERNAME/Desktop/quarkus-project --resource-group devonfw --storage-account hangar --storage-container aks-state -b develop -w | ||
| ``` | ||
|
|
||
| === Appendix: Interacting with the cluster | ||
|
|
||
| NOTE: Make sure you have https://kubernetes.io/docs/tasks/tools/#kubectl[kubectl] installed. | ||
|
|
||
| In order to interact with your cluster you will need to download the artifact `kubeconfig` generated by the cluster provisioning pipeline on the location it is expected by default (`~/.kube/config`) or either: | ||
|
|
||
| ``` | ||
| # via environment variable (you can add this on your profile) | ||
| export KUBECONFIG=<path to downloaded kubeconfig> | ||
| kubectl <command> | ||
|
|
||
| # via command-line flag | ||
| kubectl <command> --kubeconfig=<path to downloaded kubeconfig> | ||
| ``` | ||
| :provider: Azure Devops | ||
| :pipeline_type: Pipeline | ||
| :trigger_sentence: * Install the https://marketplace.visualstudio.com/items?itemName=ms-devlabs.custom-terraform-tasks[Terraform extension] for Azure DevOps. * Create a https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml#create-a-service-connection[service connection] to Azure Resource Manager and name it `aks-connection`. If you already have a service connection available or you need a specific connection name, please update `aks-pipeline.cfg` accordingly. | ||
| :pipeline_type2: pipeline | ||
| :path_provider: azure-devops | ||
| :cmd_add: ./pipeline_generator.sh -c ./templates/aks/aks-pipeline.cfg -n aks-provisioning -d C:/Users/$USERNAME/Desktop/quarkus-project --resource-group devonfw --storage-account hangar --storage-container aks-state --rancher -b develop -w | ||
| :aks_variables: Azure DevOps > Pipelines > Library > `aks-variables` | ||
| Unresolved directive in setup-aks-provisioning-pipeline.asciidoc - include::../common_templates/setup-build-pipeline.asciidoc[] |
8 changes: 8 additions & 0 deletions
8
documentation/github/setup-aks-provisioning-pipeline.asciidoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| :provider: Github | ||
| :pipeline_type: workflow | ||
| :trigger_sentence: * Add AZURE credentials as https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository[Github Secrets] in your repository and name it `AZURE_USERNAME`,`AZURE_PASSWORD`. If you already have a available credentials or you need a specific credentials connection, please update `aks-provisioning.yml` accordingly. | ||
| :pipeline_type2: Github action | ||
| :path_provider: github | ||
| :cmd_add: ./pipeline_generator.sh -c ./templates/aks/aks-pipeline.cfg -n aks-provisioning -d C:/Users/$USERNAME/Desktop/quarkus-project --cluster-name devon-hangar --resource-group devonfw --storage-account hangar --storage-container aks-state --rancher -b develop -w | ||
| :aks_variables: .github > vars > `aks-variables.env` | ||
| Unresolved directive in setup-aks-provisioning-pipeline.asciidoc - include::../common_templates/setup-build-pipeline.asciidoc[] |
8 changes: 8 additions & 0 deletions
8
documentation/src/azure-devops/setup-aks-provisioning-pipeline.asciidoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| :provider: Azure Devops | ||
| :pipeline_type: Pipeline | ||
| :trigger_sentence: * Install the https://marketplace.visualstudio.com/items?itemName=ms-devlabs.custom-terraform-tasks[Terraform extension] for Azure DevOps. * Create a https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml#create-a-service-connection[service connection] to Azure Resource Manager and name it `aks-connection`. If you already have a service connection available or you need a specific connection name, please update `aks-pipeline.cfg` accordingly. | ||
| :pipeline_type2: pipeline | ||
| :path_provider: azure-devops | ||
| :cmd_add: ./pipeline_generator.sh -c ./templates/aks/aks-pipeline.cfg -n aks-provisioning -d C:/Users/$USERNAME/Desktop/quarkus-project --resource-group devonfw --storage-account hangar --storage-container aks-state --rancher -b develop -w | ||
| :aks_variables: Azure DevOps > Pipelines > Library > `aks-variables` | ||
| include::../common_templates/setup-build-pipeline.asciidoc[] |
105 changes: 105 additions & 0 deletions
105
documentation/src/common_templates/setup-aks-provisioning-pipeline.asciidoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| = Setting up a Azure AKS provisioning {pipeline_type} on {provider} | ||
|
|
||
| In this section we will create a {pipeline_type} which will provision an Azure AKS cluster. This pipeline will be configured to be manually triggered by the user. As part of AKS cluster provisioning, a NGINX Ingress controller is deployed and a variable group with the name `aks-variables` is created, which contains, among others, the DNS name of the Ingress controller, that you you will need to add as CNAME record on the domains used in your application Ingress manifest files. Refer to the appendix for more details. | ||
|
|
||
| The creation of the pipeline will follow the project workflow, so a new branch named `feature/aks-provisioning` will be created, the YAML file for the {pipeline_type} and the terraform files for creating the cluster will be pushed to it. | ||
|
|
||
| Then, a Pull Request (PR) will be created in order to merge the new branch into the appropiate branch (provided in `-b` flag). The PR will be automatically merged if the repository policies are met. If the merge is not possible, either the PR URL will be shown as output, or it will be opened in your web browser if using `-w` flag. | ||
|
|
||
| The script located at `/scripts/pipelines/{path_provider}/pipeline_generator.sh` will automatically create this new branch, create the AKS provisioning pipeline based on the YAML template, create the Pull Request and, if it is possible, merge this new branch into the specified branch. | ||
|
|
||
| == Prerequisites | ||
|
|
||
| {trigger_sentence} | ||
|
|
||
| * An Azure resource group in the desired cluster location (e.g. `westeurope`). You can use an existing one or create a new one with the following command: | ||
|
|
||
| ``` | ||
| az group create -n <resource group name> -l <location> | ||
| ``` | ||
|
|
||
| * An Azure storage account within the previous resource group. You can use an existing one or create a new one with the following command: | ||
|
|
||
| ``` | ||
| az storage account create -n <storage account name> -g <resource group name> -l <location> | ||
| ``` | ||
|
|
||
| * An Azure storage container in Azure within the previous storage account. You can use an existing one or create a new one with the following command: | ||
|
|
||
| ``` | ||
| az storage container create -n <storage container name> --account-name <storage account name> | ||
| ``` | ||
|
|
||
| * This script will commit and push the corresponding YAML template into your repository, so please be sure your local repository is up-to-date (i.e you have pulled the latest changes with `git pull`). | ||
|
|
||
| == Creating the {pipeline_type} using provided script | ||
|
|
||
| Before executing the script you will need to customize some input variables about the environment. To do so, you can either edit `terraform.tfvars` file or take advantage of the `set-terraform-variables.sh` script located at `/scripts/environment-provisioning/azure/aks`, which allows you to create or update values for the required variables, passing them as flags. As a full example: | ||
|
|
||
| ``` | ||
| ./set-terraform-variables.sh --cluster_name <cluster name> --location <location> --resource_group_name <resource group name> --instance_type <worker instance type> --worker_node_count <number of worker nodes> --dns_prefix <dns prefix> | ||
| ``` | ||
|
|
||
| === Usage | ||
| ``` | ||
| pipeline_generator.sh \ | ||
| -c <config file path> \ | ||
| -n <pipeline name> \ | ||
| -d <project local path> \ | ||
| --resource-group <resource group name> \ | ||
| --storage-account <storage account name> \ | ||
| --storage-container <storage container name> \ | ||
| [--rancher] \ | ||
| [-b <branch>] \ | ||
| [-w] | ||
| ``` | ||
|
|
||
| NOTE: The config file for the AKS provisioning pipeline is located at `/scripts/pipelines/{path_provider}/templates/aks/aks-pipeline.cfg`. | ||
|
|
||
| === Flags | ||
| ``` | ||
| -c, --config-file [Required] Configuration file containing pipeline definition. | ||
| -n, --pipeline-name [Required] Name that will be set to the pipeline. | ||
| -d, --local-directory [Required] Local directory of your project (the path should always be using '/' and not '\'). | ||
| --resource-group [Required] Name of the resource group for the cluster. | ||
| --storage--account [Required] Name of the storage account for the cluster. | ||
| --storage-container [Required] Name of the storage container where the Terraform state of the cluster will be stored. | ||
| --rancher Install Rancher to manage the cluster. | ||
| -b, --target-branch Name of the branch to which the Pull Request will target. PR is not created if the flag is not provided. | ||
| -w Open the Pull Request on the web browser if it cannot be automatically merged. Requires -b flag. | ||
| ``` | ||
|
|
||
| === Example | ||
|
|
||
| ``` | ||
| {cmd_add} | ||
| ``` | ||
|
|
||
| NOTE: Rancher is installed on the cluster after provisioning when using the above command. | ||
|
|
||
| === Appendix: Interacting with the cluster | ||
|
|
||
| NOTE: Make sure you have https://kubernetes.io/docs/tasks/tools/#kubectl[kubectl] installed. | ||
|
|
||
| In order to interact with your cluster you will need to download the artifact `kubeconfig` generated by the cluster provisioning pipeline on the location it is expected by default (`~/.kube/config`) or either: | ||
|
|
||
| ``` | ||
| # via environment variable (you can add this on your profile) | ||
| export KUBECONFIG=<path to downloaded kubeconfig> | ||
| kubectl <command> | ||
|
|
||
| # via command-line flag | ||
| kubectl <command> --kubeconfig=<path to downloaded kubeconfig> | ||
| ``` | ||
|
|
||
| To get the DNS name of the NGINX Ingress controller on the AKS cluster, go into {aks_variables}. | ||
|
|
||
| Rancher, if installed, will be available on `https://<ingress controller domain>/dashboard`. You will be asked for an initial password, which can be retrieved with: | ||
|
|
||
| ``` | ||
| kubectl get secret --namespace cattle-system bootstrap-secret -o go-template='{{.data.bootstrapPassword|base64decode}}{{"\n"}}' | ||
| ``` | ||
|
|
||
| === Appendix: Destroying the cluster | ||
|
|
||
| To destroy the provisioned resources, set `operation` pipeline variable value to `destroy` and run the pipeline. |
8 changes: 8 additions & 0 deletions
8
documentation/src/github/setup-aks-provisioning-pipeline.asciidoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| :provider: Github | ||
| :pipeline_type: workflow | ||
| :trigger_sentence: * Add AZURE credentials as https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository[Github Secrets] in your repository and name it `AZURE_USERNAME`,`AZURE_PASSWORD`. If you already have a available credentials or you need a specific credentials connection, please update `aks-provisioning.yml` accordingly. | ||
| :pipeline_type2: Github action | ||
| :path_provider: github | ||
| :cmd_add: ./pipeline_generator.sh -c ./templates/aks/aks-pipeline.cfg -n aks-provisioning -d C:/Users/$USERNAME/Desktop/quarkus-project --cluster-name devon-hangar --resource-group devonfw --storage-account hangar --storage-container aks-state --rancher -b develop -w | ||
| :aks_variables: .github > vars > `aks-variables.env` | ||
| include::../common_templates/setup-build-pipeline.asciidoc[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Mandatory flags. | ||
| mandatoryFalgs="$pipelineName,$localDirectory,$clusterName,$resourceGroupName,$storageAccountName,$storageContainerName," | ||
| # Path to the templates. | ||
| templatesPath="scripts/pipelines/github/templates/aks" | ||
| #Path to common kubernetes templates. | ||
| commonKubernetesPath="scripts/pipelines/github/templates/common/kubernetes" | ||
| # YAML file name. | ||
| yamlFile="aks-provisioning.yml" | ||
| # Source branch. | ||
| sourceBranch="feature/aks-provisioning" | ||
| # Path to terraform templates. | ||
| terraformTemplatesPath="scripts/environment-provisioning/azure/aks" | ||
| # Path to terraform scripts. | ||
| terraformPath=".terraform/aks" | ||
| # Default cluster operation. | ||
| operation="create" | ||
| # Install Rancher on AKS cluster. | ||
| if test -z $installRancher | ||
| then | ||
| installRancher=false | ||
| fi | ||
|
|
||
| # Function that copies the necessary scripts into the directory. | ||
| function copyScript { | ||
| # Create .terraform/aks folder if it does not exist. | ||
| mkdir -p "${localDirectory}/${terraformPath}" | ||
|
|
||
| # Copy the terraform files. | ||
| cd "${hangarPath}/${terraformTemplatesPath}" | ||
| cp * "${localDirectory}/${terraformPath}" | ||
|
|
||
| # Copy the script for the DNS name into the directory. | ||
| cp "${hangarPath}/${templatesPath}/obtain-dns.sh" "${localDirectory}/${scriptFilePath}/obtain-dns.sh" | ||
|
|
||
| # Copy the common files for kubernetes | ||
| cp "${hangarPath}/${commonKubernetesPath}"/*.sh "${localDirectory}/${scriptFilePath}" | ||
| } | ||
|
|
||
| function commitFiles { | ||
| # Add the terraform files. | ||
| git add .terraform -f | ||
|
|
||
| # Changing all files to be executable. | ||
| find .terraform -type f -name '*.sh' -exec git update-index --chmod=+x {} \; | ||
|
|
||
| # Git commit and push it into the repository. | ||
| git commit -m "Adding the terraform files" | ||
| git push -u origin ${sourceBranch} | ||
| } | ||
|
|
||
| # Function that adds the variables to be used in the pipeline. | ||
| function addPipelineVariables { | ||
|
|
||
| export clusterName | ||
| export resourceGroupName | ||
| export storageAccountName | ||
| export storageContainerName | ||
| export installRancher | ||
| export operation | ||
| specificEnvSubstList='${clusterName} ${resourceGroupName} ${storageAccountName} ${storageContainerName} ${installRancher} ${operation}' | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.