Move old content into subfolder READMEs
Add list of contents
Add azdevopspub email to each one
Add open source code of conduct footer
This commit is contained in:
Eric Jizba 2017-03-06 09:41:43 -08:00
Родитель c18d37514a
Коммит 8d4d29c31d
5 изменённых файлов: 81 добавлений и 56 удалений

Просмотреть файл

@ -1,57 +1,25 @@
# azure-devops-utils
Utilities of Azure Devops to run/configure systems in Azure
# Azure DevOps Utilities
This repository contains utility scripts to run/configure DevOp systems in Azure. These scripts can be used individually, but are also leveraged in several 'Getting Started' solutions:
* [Jenkins Quickstart Templates](https://azure.microsoft.com/resources/templates/?term=Jenkins)
* [Spinnaker Quickstart Templates](https://azure.microsoft.com/resources/templates/?term=Spinnaker)
## [Create Service Principal](bash/create-service-principal.sh)
> [bash/create-service-principal.sh](bash/create-service-principal.sh)
## Contents
* Common
* [create-service-principal.sh](bash/create-service-principal.sh): Creates Azure Service Principal credentials.
* Jenkins
* [basic-docker-build.groovy](jenkins/basic-docker-build.groovy): Sample Jenkins pipeline that clones a git repository, builds the docker container defined in the Docker file and pushes that container to a private container registry.
* [add-docker-build-job.sh](jenkins/add-docker-build-job.sh): Adds a Docker Build job in an existing Jenkins instance.
* [Jenkins-Windows-Init-Script.ps1](powershell/Jenkins-Windows-Init-Script.ps1): Sample script on how to setup your Windows Azure Jenkins Agent to communicate through JNLP with the Jenkins master.
* [Migrate-Image-From-Classic.ps1](powershell/Migrate-Image-From-Classic.ps1): Migrates an image from the classic image model to the new Azure Resource Manager model.
* Spinnaker
* [add_k8s_pipeline.sh](spinnaker/add_k8s_pipeline/): Adds a Kubernetes pipeline with three main stages:
1. Deploy to a development environment
1. Wait for manual judgement
1. Deploy to a production environment
* [await_restart_spinnaker.sh](spinnaker/await_restart_spinnaker/): Restarts Spinnaker and waits for several known services to be ready before returning.
* [configure_k8s.sh](spinnaker/configure_k8s/): Automatically configure a spinnaker instance to target a Kubernetes cluster and to use an Azure storage account for Spinnaker's persistent storage.
* [copy_kube_config.sh](spinnaker/copy_kube_config/): Programatically copies a kubeconfig file from an Azure Container Service Kubernetes cluster to a Spinnaker machine.
Creates Azure Service Principal credentials.
## Questions/Comments? azdevopspub@microsoft.com
Requires that the [Azure CLI](https://docs.microsoft.com/en-us/azure/xplat-cli-install) is pre-installed.
The script prompts for user input to be able to authenticate on Azure and to pick the desired subscription (this step can be skipped by providing the subscription id as a script argument).
For doing this in Windows without a bash shell, refer to instructions [here](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-authenticate-service-principal-cli)
Another alternative using PowerShell can be found [here](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-authenticate-service-principal)
## [Jenkins Azure Agent initialization script](powershell/Jenkins-Windows-Init-Script.ps1)
> [powershell/Jenkins-Windows-Init-Script.ps1](powershell/Jenkins-Windows-Init-Script.ps1)
Sample script on how to setup your Windows Azure Jenkins Agent to communicate through JNLP with the Jenkins master.
Before deploying using this initialization script remember to update this line with your credentials (you can get api token by clicking on your username --> configure --> show api token):
```powershell
$credentials="username:apitoken"
```
More information about the Azure VM Agents plugin can be found [here](https://wiki.jenkins-ci.org/display/JENKINS/Azure+VM+Agents+Plugin).
## [Azure Classic VM Image migration](powershell/Migrate-Image-From-Classic.ps1)
> [powershell/Migrate-Image-From-Classic.ps1](powershell/Migrate-Image-From-Classic.ps1)
Migrates an image from the classic image model to the new Azure Resource Manager model.
| Argument | Description |
|----------------------|---------------------------------------------------------------------------------------------------|
| ImageName | Original image name |
| TargetStorageAccount | Target account to copy to |
| TargetResourceGroup | Resource group of the target storage account |
| TargetContainer | Target container to put the VHD |
| TargetVirtualPath | Virtual path to put the blob in. If not specified, defaults to the virtual path of the source URI |
| TargetBlobName | Blob name to copy to. If not specified, defaults to the blob name of the source URI |
## [Jenkins groovy script to build and push a Docker container](jenkins/basic-docker-build.groovy)
> [jenkins/basic-docker-build.groovy](jenkins/basic-docker-build.groovy)
Sample Jenkins pipeline that clones a git repository, builds the docker container defined in the Docker file and pushes that container to a private container registry.
The Jenkins Job that uses this groovy script must have these parameters defined:
| Jenkins job parameters | Description |
|-------------------------|-------------------------------------------------------------------------------------------------------------|
| git_repo | A public git repository that has a Dockerfile |
| docker_repository | The container repository |
| registry_url | The Docker private container registry url |
| registry_credentials_id | The Jenkins credentials id that stores the user name and password for the Docker private container registry |
## [Add a Docker Build job in an existing Jenkins instance](jenkins/add-docker-build-job.sh)
> [jenkins/add-docker-build-job.sh](jenkins/add-docker-build-job.sh)
Bash script that adds a Docker Build job in an existing Jenkins instance. The created job will use the [basic-docker-build.groovy](groovy/basic-docker-build.groovy) script.
_This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments._

13
bash/README.md Normal file
Просмотреть файл

@ -0,0 +1,13 @@
## Create Service Principal
Creates Azure Service Principal credentials.
Requires that the [Azure CLI](https://docs.microsoft.com/azure/xplat-cli-install) is pre-installed.
The script prompts for user input to be able to authenticate on Azure and to pick the desired subscription (this step can be skipped by providing the subscription id as a script argument).
For doing this in Windows without a bash shell, refer to instructions [here](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-authenticate-service-principal-cli)
Another alternative using PowerShell can be found [here](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-authenticate-service-principal)
## Questions/Comments? azdevopspub@microsoft.com

Просмотреть файл

@ -3,12 +3,12 @@
#echo "Usage:
# 1 bash create-service-principal.sh
# 2 bash create-service-principal.sh <Subscription ID>
# You need Azure CLI: https://docs.microsoft.com/en-us/azure/xplat-cli-install
# You need Azure CLI: https://docs.microsoft.com/azure/xplat-cli-install
SUBSCRIPTION_ID=$1
#echo ""
#echo " Background article: https://azure.microsoft.com/en-us/documentation/articles/resource-group-authenticate-service-principal"
#echo " Background article: https://azure.microsoft.com/documentation/articles/resource-group-authenticate-service-principal"
echo ""
my_app_name_uuid=$(python -c 'import uuid; print (str(uuid.uuid4())[:8])')

19
jenkins/README.md Normal file
Просмотреть файл

@ -0,0 +1,19 @@
## Jenkins groovy script to build and push a Docker container
> [basic-docker-build.groovy](basic-docker-build.groovy)
Sample Jenkins pipeline that clones a git repository, builds the docker container defined in the Docker file and pushes that container to a private container registry.
The Jenkins Job that uses this groovy script must have these parameters defined:
| Jenkins job parameters | Description |
|-------------------------|-------------------------------------------------------------------------------------------------------------|
| git_repo | A public git repository that has a Dockerfile |
| docker_repository | The container repository |
| registry_url | The Docker private container registry url |
| registry_credentials_id | The Jenkins credentials id that stores the user name and password for the Docker private container registry |
## Add a Docker Build job in an existing Jenkins instance
> [add-docker-build-job.sh](add-docker-build-job.sh)
Bash script that adds a Docker Build job in an existing Jenkins instance. The created job will use the [basic-docker-build.groovy](basic-docker-build.groovy) script.
## Questions/Comments? azdevopspub@microsoft.com

25
powershell/README.md Normal file
Просмотреть файл

@ -0,0 +1,25 @@
## Jenkins Azure Agent initialization script
> [Jenkins-Windows-Init-Script.ps1](Jenkins-Windows-Init-Script.ps1)
Sample script on how to setup your Windows Azure Jenkins Agent to communicate through JNLP with the Jenkins master.
Before deploying using this initialization script remember to update this line with your credentials (you can get api token by clicking on your username --> configure --> show api token):
```powershell
$credentials="username:apitoken"
```
More information about the Azure VM Agents plugin can be found [here](https://wiki.jenkins-ci.org/display/JENKINS/Azure+VM+Agents+Plugin).
## Azure Classic VM Image migration
> [Migrate-Image-From-Classic.ps1](Migrate-Image-From-Classic.ps1)
Migrates an image from the classic image model to the new Azure Resource Manager model.
| Argument | Description |
|----------------------|---------------------------------------------------------------------------------------------------|
| ImageName | Original image name |
| TargetStorageAccount | Target account to copy to |
| TargetResourceGroup | Resource group of the target storage account |
| TargetContainer | Target container to put the VHD |
| TargetVirtualPath | Virtual path to put the blob in. If not specified, defaults to the virtual path of the source URI |
| TargetBlobName | Blob name to copy to. If not specified, defaults to the blob name of the source URI |
## Questions/Comments? azdevopspub@microsoft.com