Skip to content

Commit

Permalink
add useProjectsAsFolders setting
Browse files Browse the repository at this point in the history
  • Loading branch information
freddydk committed Nov 24, 2023
1 parent b7b009a commit 6d9ee6d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 23 deletions.
1 change: 1 addition & 0 deletions Actions/AL-Go-Helper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ function ReadSettings {
"ContinuousDeployment" = $false
"DeployToGitHubPages" = $true
"MaxReleases" = 3
"useProjectsAsFolders" = $true
"Projects" = @()
"ExcludeProjects" = @()
"Header" = "Documentation for {REPOSITORY} {VERSION}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function GenerateDocsSite {
[string] $defaultReleaseMD,
[string] $docsPath,
[string] $logLevel,
[switch] $useProjectsAsFolders,
[switch] $hostIt
)

Expand Down Expand Up @@ -123,31 +124,27 @@ function GenerateDocsSite {
}
$allApps | ConvertTo-Json -Depth 99 | Out-Host
if ($allApps.Keys.Count -eq 1 -and $allApps.Keys[0] -eq $repoName) {
# Single project repo
foreach($appFile in $allApps."$repoName") {
$apps += @($appFile)
$appName, $appFolder = GetAppNameAndFolder -appFile $appFile
$newTocYml += @(
" - name: $appName"
" href: reference/$appFolder/toc.yml"
)
}
# Single project repo - do not use project names as folders
$useProjectsAsFolders = $false
}
else {
# Multi project repo add all apps
foreach($project in $allApps.Keys) {
foreach($project in $allApps.Keys) {
if ($useProjectsAsFolders) {
$newTocYml += @(
" - name: $project"
" items:"
)
foreach($appFile in $allApps."$project") {
$apps += @($appFile)
$appName, $appFolder = GetAppNameAndFolder -appFile $appFile
$newTocYml += @(
" - name: $appName"
" href: reference/$appFolder/toc.yml"
)
}
$indent = " "
}
else {
$indent = " "
}
foreach($appFile in $allApps."$project") {
$apps += @($appFile)
$appName, $appFolder = GetAppNameAndFolder -appFile $appFile
$newTocYml += @(
"$($indent)- name: $appName"
"$($indent) href: reference/$appFolder/toc.yml"
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ foreach($release in $releases) {
$allApps, $allDependencies = CalculateProjectsAndApps -tempFolder $tempFolder -projects $projects -excludeProjects $excludeProjects
$version = $release.Name
$releaseNotes = $release.body
GenerateDocsSite -version $version -allVersions $versions -allApps $allApps -repoName $settings.repoName -releaseNotes $releaseNotes -header $header -footer $footer -defaultIndexMD $defaultIndexMD -defaultReleaseMD $defaultReleaseMD -docsPath $docsPath -logLevel $logLevel
GenerateDocsSite -version $version -allVersions $versions -allApps $allApps -repoName $settings.repoName -releaseNotes $releaseNotes -header $header -footer $footer -defaultIndexMD $defaultIndexMD -defaultReleaseMD $defaultReleaseMD -docsPath $docsPath -logLevel $logLevel -useProjectsAsFolders:$settings.ALDoc.useProjectsAsFolders
do {
try {
$retry = $false
Expand Down Expand Up @@ -98,7 +98,7 @@ if ($latestReleaseTag) {
else {
$releaseNotes = ''
}
GenerateDocsSite -version '' -allVersions $versions -allApps $allApps -repoName $settings.repoName -releaseNotes $releaseNotes -header $header -footer $footer -defaultIndexMD $defaultIndexMD -defaultReleaseMD $defaultReleaseMD -docsPath $docsPath -logLevel $logLevel
GenerateDocsSite -version '' -allVersions $versions -allApps $allApps -repoName $settings.repoName -releaseNotes $releaseNotes -header $header -footer $footer -defaultIndexMD $defaultIndexMD -defaultReleaseMD $defaultReleaseMD -docsPath $docsPath -logLevel $logLevel -useProjectsAsFolders:$settings.ALDoc.useProjectsAsFolders

if ($artifactsFolderCreated) {
Remove-Item $artifactsFolder -Recurse -Force
Expand Down
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Note that when using the preview version of AL-Go for GitHub, we recommend you U
- **ContinuousDeployment** = Determines if reference documentation will be deployed continuously as part of CI/CD. You can run the **Deploy Reference Documentation** workflow to deploy manually or on a schedule. (Default false)
- **DeployToGitHubPages** = Determines whether or not the reference documentation site should be deployed to GitHub Pages for the repository. In order to deploy to GitHub Pages, GitHub Pages must be enabled and set to GitHub Actuibs. (Default true)
- **MaxReleases** = Maximum number of releases to include in the reference documentation. (Default 3)
- **useProjectsAsFolders** = Determines whether projects in multi-project repositories are used as folders in reference documentation
- **Projects** = An array of projects to include in the reference documentation. (Default all)
- **ExcludeProjects** = An array of projects to exclude in the reference documentation. (Default none)-
- **Header** = Header for the documentation site. (Default: Documentation for...)
Expand Down
2 changes: 1 addition & 1 deletion Scenarios/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The repository settings are only read from the repository settings file (.github
| <a id="environments"></a>environments | Array of logical environment names. You can specify environments in GitHub environments or in the repo settings file. If you specify environments in the settings file, you can create your AUTHCONTEXT secret using **&lt;environmentname&gt;_AUTHCONTEXT**. You can specify additional information about environments in a setting called **DeployTo&lt;environmentname&gt;** |
| <a id="deliverto"></a>DeliverTo&lt;deliveryTarget&gt; | Structure with additional properties for the deliveryTarget specified. Some properties are deliveryTarget specific. The structure can contain the following properties:<br />**Branches** = an array of branch patterns, which are allowed to deliver to this deliveryTarget. (Default main)<br />**CreateContainerIfNotExist** = *[Only for DeliverToStorage]* Create Blob Storage Container if it doesn't already exist. (Default false)<br /> |
| <a id="deployto"></a>DeployTo&lt;environmentname&gt; | Structure with additional properties for the environment specified. The structure can contain the following properties:<br />**EnvironmentType** = specifies the type of environment. The environment type can be used to invoke a custom deployment. (Default SaaS)<br />**EnvironmentName** = specifies the "real" name of the environment if it differs from the GitHub environment.<br />**Branches** = an array of branch patterns, which are allowed to deploy to this environment. (Default main)<br />**Projects** = In multi-project repositories, this property can be a comma separated list of project patterns to deploy to this environment. (Default *)<br />**SyncMode** = ForceSync if deployment to this environment should happen with ForceSync, else Add. If deploying to the development endpoint you can also specify Development or Clean. (Default Add)<br />**ContinuousDeployment** = true if this environment should be used for continuous deployment, else false. (Default: AL-Go will continuously deploy to sandbox environments or environments, which doesn't end in (PROD) or (FAT)<br />**runs-on** = specifies which runner to use when deploying to this environment. (Default is settings.runs-on)<br /> |
| <a id="aldoc"></a>ALDoc | Structure with properties for the aldoc reference document generation. The structure can contain the following properties:<br />**ContinuousDeployment** = Determines if reference documentation will be deployed continuously as part of CI/CD. You can run the **Deploy Reference Documentation** workflow to deploy manually or on a schedule. (Default false)<br />**DeployToGitHubPages** = Determines whether or not the reference documentation site should be deployed to GitHub Pages for the repository. In order to deploy to GitHub Pages, GitHub Pages must be enabled and set to GitHub Actuibs. (Default true)<br />**MaxReleases** = Maximum number of releases to include in the reference documentation. (Default 3)<br />**Projects** = An array of projects to include in the reference documentation. (Default all)<br />**ExcludeProjects** = An array of projects to exclude in the reference documentation. (Default none)<br />**Header** = Header for the documentation site. (Default: Documentation for...)<br />**Footer** = Footer for the documentation site. (Default: Made with...)<br />**DefaultIndexMD** = Markdown for the landing page of the documentation site. (Default: Reference documentation...)<br />**DefaultReleaseMD** = Markdown for the landing page of the release sites. (Default: Release reference documentation...)<br />*Note that in Header, Footer, DefaultIndexMD and DefaultReleaseMD you can use the following placeholders: {REPOSITORY}, {VERSION}, {INDEXTEMPLATERELATIVEPATH}, {RELEASENOTES}* |
| <a id="aldoc"></a>ALDoc | Structure with properties for the aldoc reference document generation. The structure can contain the following properties:<br />**ContinuousDeployment** = Determines if reference documentation will be deployed continuously as part of CI/CD. You can run the **Deploy Reference Documentation** workflow to deploy manually or on a schedule. (Default false)<br />**DeployToGitHubPages** = Determines whether or not the reference documentation site should be deployed to GitHub Pages for the repository. In order to deploy to GitHub Pages, GitHub Pages must be enabled and set to GitHub Actuibs. (Default true)<br />**MaxReleases** = Maximum number of releases to include in the reference documentation. (Default 3)<br />**useProjectsAsFolders** = Determines whether projects in multi-project repositories are used as folders in reference documentation<br />**Projects** = An array of projects to include in the reference documentation. (Default all)<br />**ExcludeProjects** = An array of projects to exclude in the reference documentation. (Default none)<br />**Header** = Header for the documentation site. (Default: Documentation for...)<br />**Footer** = Footer for the documentation site. (Default: Made with...)<br />**DefaultIndexMD** = Markdown for the landing page of the documentation site. (Default: Reference documentation...)<br />**DefaultReleaseMD** = Markdown for the landing page of the release sites. (Default: Release reference documentation...)<br />*Note that in Header, Footer, DefaultIndexMD and DefaultReleaseMD you can use the following placeholders: {REPOSITORY}, {VERSION}, {INDEXTEMPLATERELATIVEPATH}, {RELEASENOTES}* |
| <a id="useProjectDependencies"></a>useProjectDependencies | Determines whether your projects are built using a multi-stage built workflow or single stage. After setting useProjectDependencies to true, you need to run Update AL-Go System Files and your workflows including a build job will change to have multiple build jobs, depending on each other. The number of build jobs will be determined by the dependency depth in your projects.<br />You can change dependencies between your projects, but if the dependency **depth** changes, AL-Go will warn you that updates for your AL-Go System Files are available and you will need to run the workflow. |
| <a id="CICDPushBranches"></a>CICDPushBranches | CICDPushBranches can be specified as an array of branches, which triggers a CI/CD workflow on commit.<br />Default is [ "main", "release/\*", "feature/\*" ] |
| <a id="CICDPullrequestBranches"></a>CICDPullRequestBranches | CICDPullRequestBranches can be specified as an array of branches, which triggers a CI/CD workflow on a PR.<br />Default is [ "main" ] |
Expand Down

0 comments on commit 6d9ee6d

Please sign in to comment.