* Docs, Templates and Settings (#1)

* Add .github/

* Update README.md

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Add config.json

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Delete config.json

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Update .github/

* Add .pipelines/

* Add settings.json

* Update README.md

* Update settings.json

* Update settings.json

* Update README.md

* Update README.md

* Pipelines (#2)

* Update pull.yml

* Update push.yml

* Pipelines and Comments (#3)

* Update pull.yml

* Update push.yml

* Update pull.yml

* Update push.yml

* Pipelines (#4)

* Update pull.yml

* Update push.yml

* Update pull.yml

* Update push.yml

* Update README.md (#5)

* Repository (#6)

* Update README.md

* Update README.md

* Actions (#7)

* Update README.md

* Update README.md

* Update pull.yml

* Update push.yml

* Update .github/

* Update .pipelines/

* Update .pipelines/

* Update .pipelines/

* Update .github/

* Update README.md

* Update .github/

* Update .github/

* Update .github/

* Update .pipelines/

* Update SECURITY.md
This commit is contained in:
Lyon Till 2021-03-08 14:21:06 +00:00 коммит произвёл GitHub
Родитель ab91d6121e
Коммит 177e8d1fd8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 55 добавлений и 71 удалений

5
.github/CODEOWNERS поставляемый
Просмотреть файл

@ -1,5 +0,0 @@
# See for instructions on this file https://help.github.com/articles/about-codeowners/
* @azure/enterprisescale-vteam
.github/CODEOWNERS @ljtill @uday31in

8
.github/templates/simple/pull.yml поставляемый
Просмотреть файл

@ -6,7 +6,7 @@ on:
# #
# Schedule # Schedule
# This is an [optional] event to get latest Azure # This is an [optional] event to get latest Azure
# hierarchy of Management Grou and Subscription in # hierarchy of Management Group and Subscription in
# your Git in recurring manner. Default is every 6 hours # your Git in recurring manner. Default is every 6 hours
# #
# Adjust frequency based on your organization need # Adjust frequency based on your organization need
@ -17,14 +17,16 @@ on:
# #
# Workflow Dispatch # Workflow Dispatch
# This is to invoke this action from portal # This is to invoke this action from the GitHub UI
# #
workflow_dispatch: workflow_dispatch:
# #
# Repository Dispatch # Repository Dispatch
# To invoke this action based on event/webhook # Invoke this action based on event / webhook, this
# could be from an activity logs when a specific condition
# is met and triggered
# #
repository_dispatch: repository_dispatch:

13
.github/templates/simple/push.yml поставляемый
Просмотреть файл

@ -2,7 +2,20 @@
name: 'AzOps - Push' name: 'AzOps - Push'
on: on:
#
# Workflow Dispatch
# This is to invoke this action from portal
#
workflow_dispatch: workflow_dispatch:
#
# Pull Request
# Automated workflow trigger when a pull request
# is created within the repository.
#
pull_request: pull_request:
jobs: jobs:

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

@ -8,14 +8,6 @@ trigger: none
pool: pool:
name: 'Azure Self-hosted Pipelines' name: 'Azure Self-hosted Pipelines'
variables:
organization: 'lytill'
project: 'azops-test'
repository: 'azops-test'
branch: $(Build.SourceBranchName)
pullRequest: $(System.PullRequest.PullRequestId)
timeout: 30
jobs: jobs:
- job: pre - job: pre
@ -28,7 +20,7 @@ jobs:
# #
displayName: 'Pre' displayName: 'Pre'
condition: ne(variables['System.PullRequest.SourceBranch'], 'refs/heads/automated') condition: and(eq(variables['Build.Reason'], 'PullRequest'), ne(variables['System.PullRequest.SourceBranch'], 'refs/heads/automated'))
workspace: workspace:
clean: all clean: all
steps: steps:
@ -81,7 +73,7 @@ jobs:
targetType: 'inline' targetType: 'inline'
script: | script: |
Import-PSFConfig -Path settings.json -Schema MetaJson Import-PSFConfig -Path settings.json -Schema MetaJson
Initialize-AzOpsRepository Initialize-AzOpsRepository -Rebuild
Get-Job | Remove-Job -Force Get-Job | Remove-Job -Force
# #
@ -91,6 +83,7 @@ jobs:
- task: Bash@3 - task: Bash@3
displayName: 'Diff' displayName: 'Diff'
name: diff
inputs: inputs:
targetType: 'inline' targetType: 'inline'
script: | script: |
@ -98,10 +91,10 @@ jobs:
if [ -z "$DIFF" ] if [ -z "$DIFF" ]
then then
echo $DIFF echo $DIFF
echo "##vso[task.setvariable variable=state]continue" echo "##vso[task.setvariable variable=state;isOutput=true]continue"
else else
echo $DIFF echo $DIFF
echo "##vso[task.setvariable variable=state]stop" echo "##vso[task.setvariable variable=state;isOutput=true]stop"
fi fi
# #
@ -111,7 +104,7 @@ jobs:
- task: Bash@3 - task: Bash@3
displayName: 'Issue' displayName: 'Issue'
condition: contains(variables['state'], 'stop') condition: contains(variables['diff.state'], 'stop')
inputs: inputs:
targetType: 'inline' targetType: 'inline'
script: | script: |
@ -119,19 +112,19 @@ jobs:
--header "Authorization: Bearer $(System.AccessToken)" \ --header "Authorization: Bearer $(System.AccessToken)" \
--header "Content-Type: application/json" \ --header "Content-Type: application/json" \
--data '{ "comments": [ { "parentCommentId": 0, "content": "Hello!", "commentType": 1 } ], "status": 1 }' \ --data '{ "comments": [ { "parentCommentId": 0, "content": "Hello!", "commentType": 1 } ], "status": 1 }' \
--url https://dev.azure.com/$(organization)/$(project)/_apis/git/repositories/$(repository)/pullRequests/$(pullRequest)/threads?api-version=6.0 --url $(System.CollectionUri)/$(System.TeamProject)/_apis/git/repositories/$(Build.Repository.Name)/pullRequests/$(System.PullRequest.PullRequestId)/threads?api-version=6.0
- job: push - job: push
# #
# Push # Push
# - Before running the resource deployment, # -
# - we need to validate the repository state # -
# - is up to date and we won't encounter conflicts. # -
# #
displayName: 'Push' displayName: 'Push'
condition: contains(variables['state'], 'continue') condition: contains(dependencies.pre.outputs['diff.state'], 'continue')
dependsOn: pre dependsOn: pre
workspace: workspace:
clean: all clean: all
@ -196,8 +189,8 @@ jobs:
inputs: inputs:
targetType: 'inline' targetType: 'inline'
script: | script: |
Initialize-AzOpsEnvironment
Import-PSFConfig -Path settings.json -Schema MetaJson Import-PSFConfig -Path settings.json -Schema MetaJson
Initialize-AzOpsEnvironment
$diff = Get-Content -Path /tmp/diff.txt $diff = Get-Content -Path /tmp/diff.txt
$module = Get-Module -Name AzOps $module = Get-Module -Name AzOps
$module.Invoke({ Invoke-AzOpsChange -ChangeSet $diff }) $module.Invoke({ Invoke-AzOpsChange -ChangeSet $diff })
@ -207,13 +200,13 @@ jobs:
# #
# Post # Post
# - Before running the resource deployment, # -
# - we need to validate the repository state # -
# - is up to date and we won't encounter conflicts. # -
# #
displayName: 'Post' displayName: 'Post'
condition: contains(variables['state'], 'continue') condition: contains(dependencies.pre.outputs['diff.state'], 'continue')
dependsOn: push dependsOn: push
workspace: workspace:
clean: all clean: all
@ -251,7 +244,8 @@ jobs:
inputs: inputs:
targetType: 'inline' targetType: 'inline'
script: | script: |
git switch -c $(branch) sourceBranchName=$(echo $(System.PullRequest.SourceBranch) | sed 's:refs/heads/::')
git switch -c $sourceBranchName
# #
# Dependencies # Dependencies
@ -292,7 +286,8 @@ jobs:
targetType: 'inline' targetType: 'inline'
script: | script: |
Import-PSFConfig -Path settings.json -Schema MetaJson Import-PSFConfig -Path settings.json -Schema MetaJson
Initialize-AzOpsRepository Initialize-AzOpsRepository -Rebuild
Get-Job | Remove-Job -Force
# #
# Add # Add
@ -316,7 +311,7 @@ jobs:
inputs: inputs:
targetType: 'inline' targetType: 'inline'
script: | script: |
git commit -m "Automated commit" git commit -m "Automated commit" -m "[skip ci]"
# #
# Push # Push
@ -328,4 +323,5 @@ jobs:
inputs: inputs:
targetType: 'inline' targetType: 'inline'
script: | script: |
git push origin $(branch) -f sourceBranchName=$(echo $(System.PullRequest.SourceBranch) | sed 's:refs/heads/::')
git push origin $sourceBranchName -f

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

@ -68,28 +68,6 @@ After running the script blocks, the following pipeline variables will need to b
- ARM_TENANT_ID - ARM_TENANT_ID
- ARM_SUBSCRIPTION_ID - ARM_SUBSCRIPTION_ID
### Configure your repo to update changes from upstream
1. Add upstream repo to your local repository to get latest changes
Follow these steps in order to synchronize the latest changes from the upstream repo into your local repositories.
Run the following git commands once you change your directory to your local fork to add a reference to the upstream repo
```shell
git remote -v
git remote add upstream https://github.com/Azure/AzOps-Accelerator.git
git remote -v
```
Execute the following git commands when you want to synchronize changes from upstream repo into your local fork:
```shell
git fetch upstream
git pull upstream main --allow-unrelated-histories
```
## Contributing ## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a This project welcomes contributions and suggestions. Most contributions require you to agree to a

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

@ -1,6 +1,6 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK --> <!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
## Security # Security
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).