-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris Kruining
committed
Nov 21, 2024
1 parent
f88c283
commit 591ddf8
Showing
36 changed files
with
632 additions
and
145 deletions.
There are no files selected for viewing
This file contains 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,84 @@ | ||
name: Publish to registry | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
prepare: | ||
name: Calculate next version | ||
runs-on: ubuntu-latest | ||
outputs: | ||
semver: ${{ steps.gitversion.outputs.SemVer }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: "5.x" | ||
|
||
- name: Determine Version | ||
id: gitversion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
useConfigFile: true | ||
|
||
infra: | ||
name: Infrastructure | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
infrastructure | ||
- name: Az CLI login | ||
uses: azure/login@v2 | ||
with: | ||
client-id: ${{ secrets.TRICEP_CLIENT_ID }} | ||
tenant-id: ${{ secrets.TRICEP_TENANT_ID }} | ||
subscription-id: ${{ secrets.TRICEP_SUBSCRIPTION_ID }} | ||
|
||
- name: Deploy bicep | ||
uses: Azure/cli@v2 | ||
with: | ||
azcliversion: 2.66.0 | ||
inlineScript: | | ||
az deployment sub create \ | ||
--location westeurope \ | ||
--template-file infrastructure/main.bicep \ | ||
--parameters infrastructure/params/main.prd.bicepparam \ | ||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
needs: [ prepare, infra ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
src | ||
- name: Az CLI login | ||
uses: azure/login@v2 | ||
with: | ||
client-id: ${{ secrets.TRICEP_CLIENT_ID }} | ||
tenant-id: ${{ secrets.TRICEP_TENANT_ID }} | ||
subscription-id: ${{ secrets.TRICEP_SUBSCRIPTION_ID }} | ||
|
||
- name: Publish Bicep module | ||
uses: azure/cli@v1 | ||
with: | ||
inlineScript: | | ||
for x in ls -al src; do | ||
echo "$x" | ||
done | ||
# az bicep publish \ | ||
# --file src/main.bicep \ | ||
# --target 'br:toycompany.azurecr.io/main:${{needs.prepare.outputs.semver}}' |
This file contains 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,20 @@ | ||
assembly-versioning-scheme: MajorMinorPatch | ||
assembly-file-versioning-scheme: MajorMinorPatchTag | ||
assembly-informational-format: "{InformationalVersion}" | ||
mode: Mainline | ||
tag-prefix: "[vV]" | ||
continuous-delivery-fallback-tag: ci | ||
major-version-bump-message: '\+semver:\s?(breaking|major)' | ||
minor-version-bump-message: '\+semver:\s?(feature|minor)' | ||
patch-version-bump-message: '\+semver:\s?(fix|patch)' | ||
no-bump-message: '\+semver:\s?(none|skip)' | ||
legacy-semver-padding: 4 | ||
build-metadata-padding: 4 | ||
commits-since-version-source-padding: 4 | ||
commit-message-incrementing: Enabled | ||
branches: {} | ||
ignore: | ||
sha: [] | ||
increment: Inherit | ||
commit-date-format: yyyy-MM-dd | ||
merge-message-formats: {} |
This file contains 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 |
---|---|---|
|
@@ -48,4 +48,5 @@ Function Watch { | |
} | ||
} | ||
|
||
Build | ||
Watch |
This file contains 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 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 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,18 @@ | ||
import { Context } from '../../../src/types.bicep' | ||
import { log_analytics } from '../../../src/recommended/log-analytics.bicep' | ||
|
||
targetScope = 'resourceGroup' | ||
|
||
param context Context | ||
|
||
var logAnalyticsConfig = log_analytics(context, []) | ||
|
||
resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-06-01' = { | ||
name: logAnalyticsConfig.name | ||
location: logAnalyticsConfig.location | ||
properties: logAnalyticsConfig.properties | ||
} | ||
|
||
// output logAnalytics resource'Microsoft.OperationalInsights/workspaces@2021-06-01' = logAnalytics | ||
output la_customerId string = logAnalytics.properties.customerId | ||
output la_sharedKey string = logAnalytics.listKeys().primarySharedKey |
This file contains 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,15 +1,16 @@ | ||
import { createContext } from '../../../src/common/context.bicep' | ||
import { resourceGroup } from '../../../src/recommended/resource-group.bicep' | ||
import { create_context } from '../../../src/common/context.bicep' | ||
import { resource_group } from '../../../src/recommended/resource-group.bicep' | ||
|
||
targetScope = 'subscription' | ||
|
||
param deployedAt string | ||
|
||
var context = createContext({ | ||
var context = create_context({ | ||
name: 'appName' | ||
nameConventionTemplate: '$type-$env-$loc-$name' | ||
environment: 'shared' | ||
location: 'westeurope' | ||
deployedAt: deployedAt | ||
tenant: tenant() | ||
tags: {} | ||
}) |
This file contains 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,3 @@ | ||
|
||
|
||
# this is not part of the library, this is the bicep used to deploy the bicep |
This file contains 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,29 @@ | ||
targetScope = 'subscription' | ||
|
||
param deployedAt string = utcNow('yyyyMMdd') | ||
|
||
var locationAbbreviation = 'euw' | ||
var location = 'west europe' | ||
var environment = 'prd' | ||
var projectName = 'tricep' | ||
|
||
var context = { | ||
locationAbbreviation: locationAbbreviation | ||
location: location | ||
environment: environment | ||
projectName: projectName | ||
deployedAt: deployedAt | ||
} | ||
|
||
resource calqueResourceGroup 'Microsoft.Resources/resourceGroups@2024-07-01' = { | ||
name: 'rg-${locationAbbreviation}-${environment}-${projectName}' | ||
location: location | ||
} | ||
|
||
module registry 'registry.bicep' = { | ||
name: 'registry' | ||
scope: calqueResourceGroup | ||
params: { | ||
context: context | ||
} | ||
} |
This file contains 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 @@ | ||
using '../main.bicep' |
Oops, something went wrong.