Skip to content

Commit 52bbc07

Browse files
authored
Merge pull request #4 from Keyfactor/main
updated workflows for release 1.0.0
2 parents 39df52f + 1f58a38 commit 52bbc07

File tree

6 files changed

+223
-56
lines changed

6 files changed

+223
-56
lines changed
Lines changed: 83 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
# This is a basic workflow to help you get started with Actions
1+
# This workflow will build a Release Candidate (pre-release)
2+
# It runs automatically when attempting a PR from pre-release branch to the release branch
23

3-
name: Keyfactor Extension - Pre Release
4+
name: Keyfactor Extension - Release Candidate
5+
6+
env:
7+
SOLUTION_FOLDER: '.'
8+
PROJECT_FOLDER: 'GCPAnyAgent'
49

510
# Controls when the action will run.
611
on:
7-
# Triggers the workflow on push
8-
push:
9-
#only run this workflow when pushing to a branch that has the prerelease suffix
12+
# Triggers the workflow on PR open
13+
pull_request:
14+
types: [opened, synchronize]
15+
# only run this workflow when opening PR to release branch
1016
branches:
11-
- 'release-[0-9]+.[0-9]+.[0-9]+-pre'
12-
- '!release-[0-9]+.[0-9]+.[0-9]+'
17+
- '!release-[0-9]+.[0-9]+-pre'
18+
- 'release-[0-9]+.[0-9]+'
1319

14-
# Allows you to run this workflow manually from the Actions tab
20+
# Release Candidate can be triggered manually
1521
workflow_dispatch:
1622

17-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1823
jobs:
1924
# This workflow contains a single job called "build"
2025
build:
@@ -32,14 +37,17 @@ jobs:
3237
echo "Setup Envrionment Variables for Workflow"
3338
echo "Working Path: ${Env:GITHUB_WORKSPACE}"
3439
$slnPath = (Get-ChildItem -Include *.sln -File -Recurse).fullname
35-
$relName = "${{ github.ref }}".Split("/")
40+
$relName = "${{ github.base_ref }}".Split("/")
3641
$repoName = "${{ github.repository }}".Split("/")
42+
$relVersion = "${{ github.base_ref }}".Split("-")
3743
echo "Solution File Path: ${slnPath}"
3844
echo "SOLUTION_PATH=${slnPath}" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
3945
echo "Release Name: $($relName[-1])"
4046
echo "RELEASE_NAME=$($relName[-1])" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
4147
echo "Repo Name: $($repoName[-1])"
4248
echo "REPO_NAME=$($repoName[-1])" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
49+
echo "Release Version: $($relVersion[-1])"
50+
echo "RELEASE_VERSION=$($relVersion[-1])" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
4351
4452
- uses: actions/setup-dotnet@v1
4553
with:
@@ -58,6 +66,65 @@ jobs:
5866
- name: restore nuget packages
5967
run: |
6068
nuget restore ${{ env.SOLUTION_PATH }}
69+
70+
- name: GitHub Script checks for existing version tags
71+
id: existing_version
72+
uses: actions/[email protected]
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
VERSION_NUMBER: ${{ env.RELEASE_VERSION }}
76+
with:
77+
script: |
78+
// check for existing tags on this major.minor version
79+
const tagsList = await github.git.listMatchingRefs({
80+
owner: context.repo.owner,
81+
repo: context.repo.repo,
82+
ref: 'tags'
83+
});
84+
85+
const { VERSION_NUMBER } = process.env;
86+
const tags = tagsList.data.reverse();
87+
88+
// assume linear release pattern - i.e. always working on latest major.minor version
89+
// if there are no tags, or latest tag does not start with VERSION_NUMBER, set a manual version for release
90+
if (tags.length < 1
91+
|| !tags.shift().ref.startsWith(`refs/tags/${VERSION_NUMBER}`)) {
92+
core.exportVariable('MANUAL_VERSION', `${VERSION_NUMBER}.0-rc.0`);
93+
}
94+
95+
# Create a new release to auto-increment (or use manual version number)
96+
- name: Create new release
97+
id: create_release
98+
#uses: zendesk/action-create-release@v1
99+
uses: keyfactor/action-create-release@786b73035fa09790f9eb11bb86834a6d7af1c256
100+
env:
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
MANUAL_VERSION: ${{ env.MANUAL_VERSION }}
103+
with:
104+
release_name: Release Candidate ${{ env.REPO_NAME }} ${{ env.RELEASE_VERSION }}
105+
body: |
106+
[Changelog](../CHANGELOG.MD)
107+
draft: false
108+
prerelease: true
109+
prerelease_suffix: rc
110+
tag_name: ${{ env.MANUAL_VERSION }}
111+
auto_increment_type: prerelease
112+
tag_schema: semantic
113+
commitish: ${{ github.sha }}
114+
115+
# update version number of AssemblyInfo.cs file
116+
- name: Increment Assembly Version
117+
run: |
118+
$VersionRegex = "\d+\.\d+\.\d+"
119+
$assemblyInfoFiles = (Get-ChildItem -Include AssemblyInfo.cs -File -Recurse).fullname
120+
$newVer = "${{ steps.create_release.outputs.current_tag }}".TrimStart('v').Split('-')[0]
121+
echo "Prepared to overwrite Assembly version to: ${newVer}"
122+
foreach ($assemblyInfoFile in $assemblyInfoFiles)
123+
{
124+
$filecontent = Get-Content($assemblyInfoFile)
125+
attrib $assemblyInfoFile -r
126+
$filecontent -replace $VersionRegex, $newVer | Out-File $assemblyInfoFile
127+
}
61128
62129
# Runs a set of commands using the runners shell
63130
- name: Execute MSBuild Commands
@@ -67,36 +134,22 @@ jobs:
67134
- name: Archive Files
68135
run: |
69136
md ${{ github.workspace }}\zip\Keyfactor
70-
Compress-Archive -Path ${{ github.workspace }}\GCPAnyAgent\bin\Release\*.dll,${{ github.workspace }}\GCPAnyAgent\bin\Release\GCPAnyAgent.dll.config -DestinationPath ${{ github.workspace }}\zip\Keyfactor\$Env:REPO_NAME.zip -Force
137+
Compress-Archive -Path `
138+
${{ env.SOLUTION_FOLDER }}\${{ env.PROJECT_FOLDER }}\bin\Release\* `
139+
-DestinationPath ${{ github.workspace }}\zip\Keyfactor\$Env:REPO_NAME.zip -Force
71140
72141

73142
- name: Upload a Build Artifact
74143
uses: actions/[email protected]
75144
with:
76145
# Artifact name
77-
name: ${{ env.REPO_NAME}}.zip
146+
name: ${{ env.REPO_NAME }}.zip
78147
# A file, directory or wildcard pattern that describes what to upload
79148
path: |
80149
${{ github.workspace }}\zip\Keyfactor\${{ env.REPO_NAME}}.zip
81150
# The desired behavior if no files are found using the provided path.
82151
if-no-files-found: error # optional, default is warn
83-
84-
- name: Create Release
85-
id: create_release
86-
#uses: zendesk/action-create-release@v1 - Update when PR is approved
87-
uses: keyfactor/action-create-release@786b73035fa09790f9eb11bb86834a6d7af1c256
88-
env:
89-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90-
with:
91-
release_name: Release ${{ env.RELEASE_NAME }}
92-
body: |
93-
[Changelog](../CHANGELOG.MD)
94-
draft: false
95-
prerelease: true
96-
auto_increment_type: patch
97-
tag_schema: semantic
98-
commitish: ${{ github.sha }}
99-
152+
100153
- name: Upload Release Asset (x64)
101154
id: upload-release-asset-x64
102155
uses: actions/upload-release-asset@v1
@@ -105,5 +158,5 @@ jobs:
105158
with:
106159
upload_url: ${{ steps.create_release.outputs.upload_url }}
107160
asset_path: ${{ github.workspace }}\zip\Keyfactor\${{ env.REPO_NAME}}.zip
108-
asset_name: ${{ env.REPO_NAME}}.zip
161+
asset_name: ${{ env.REPO_NAME}}_${{ steps.create_release.outputs.current_tag }}.zip
109162
asset_content_type: application/zip

.github/workflows/keyfactor-extension-release.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
name: Keyfactor Extension - Release
44

55
env:
6-
SOLUTION_FOLDER: '<SOLUTION_FOLDER_NAME>'
7-
PROJECT_FOLDER: '<PROJECT_FOLDER_NAME>'
6+
SOLUTION_FOLDER: '.'
7+
PROJECT_FOLDER: 'GCPAnyAgent'
88

99
# Controls when the action will run.
1010
on:
@@ -109,9 +109,7 @@ jobs:
109109
run: |
110110
md ${{ github.workspace }}\zip\Keyfactor
111111
Compress-Archive -Path `
112-
${{ env.SOLUTION_FOLDER }}\${{ env.PROJECT_FOLDER }}\bin\Release\*.dll, `
113-
${{ env.SOLUTION_FOLDER }}\${{ env.PROJECT_FOLDER }}\bin\Release\*.json, `
114-
${{ env.SOLUTION_FOLDER }}\${{ env.PROJECT_FOLDER }}\bin\Release\*.config `
112+
${{ env.SOLUTION_FOLDER }}\${{ env.PROJECT_FOLDER }}\bin\Release\* `
115113
-DestinationPath ${{ github.workspace }}\zip\Keyfactor\$Env:REPO_NAME.zip -Force
116114
117115
- name: Upload Release Asset (x64)

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
v1.0
2+
- Original Version

README.md

Lines changed: 66 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,68 @@
1-
# GCP AnyAgent
2-
## Gcp
3-
4-
This integration is used to inventory and manage certificates in GCP.
1+
# GCP Load Balancer
2+
## Orchestrator
53

64
<!-- add integration specific information below -->
7-
***
5+
6+
***
87

98
# Introduction
10-
- TODO:
9+
- The GCP Load Balancer Orchestrator allows for the management of Google Cloud Platform Load Balancer certificate stores. Inventory, Management-Add, and Management-Remove functions are supported. Also, re-binding to endpoints IS supported for certificate renewals (but NOT adding new certificates). The orchestrator uses the Google Cloud Compute Engine API to manage stores.
1110

1211
# Setting up GCP Cert Store Type
12+
The certificate store type set up for the GCP Load Balancer Orchestrator should have the following options set:
13+
14+
**Name:** A descriptive name for the certificate store type
15+
16+
**Short Name:** Must be **GCP**
17+
18+
**Needs Server:** Unchecked
19+
20+
**Blueprint Allowed:** Unchecked
21+
22+
**Requires Store Password:** Unchecked
23+
24+
**Supports Entry Password:** Unchecked
25+
26+
**Supports Custom Alias:** Optional (If unselected, a random alias will be generated by the GCP LB Orchestrator)
27+
28+
**Uses PowerShell: ** Unchecked
29+
30+
**Store Path Type:** FreeForm
31+
32+
**Private Keys: ** Required (Adding a certificate to a GCP Load Balancer certificate store without the private key is not a valid use case)
33+
34+
**PFX Password Style:** Default
35+
36+
**Job Types:** Check Inventory, Add, and Remove. Leave Create, Discovery, and Reenrollment unchecked
37+
38+
**Parameters:** Add 1 custom parameter if authenticating to the GCP API library by passing the GCP service account key from Keyfactor Command (see Authentication):
39+
40+
- Name: Must be **jsonKey**
41+
- Display Name: Desired custom display name
42+
- Type: Secret
43+
- Change Default Value: Unchecked
44+
- Default Value: Leave blank
45+
46+
47+
48+
# Setting up GCP Cert Store
49+
When creating a GCP certificate store in Keyfactor, the various options should be set up a follows:
50+
51+
**Category:** Must be GCP
52+
53+
**Container:** Optional container name if using this feature. Please consult the Keyfactor Command Reference Guide for more information on this feature.
54+
55+
**Client Machine:** The name or IP address of the Orchestrator server that will be handling GCP jobs.
56+
57+
**Store Path:** This should be your Google Cloud project ID. This will work against GCP Global resources. Optionally, you can append "/" with the region you wish to process against. Please refer to the following page for a list of valid region codes (GCP code column): https://gist.github.com/rpkim/084046e02fd8c452ba6ddef3a61d5d59.
58+
59+
**Service Account Key:** If you will be authenticating via passing credentials from Keyfactor Command, you must add this value as follows:
60+
- No Service Account Key: Unchecked
61+
- Secret Source: "Keyfactor Secrets" if you wish to store the GCP service account key in the Keyfactor secrets engine or "Load From PAM Provider" if you have set up a PAM provider integration within Keyfactor Command and wish to store this value there.
62+
- Enter and Confirm Service Account Key: The JSON-based service account key you acquired from GCP (See Authentication).
63+
64+
**Inventory Schedule:** Set whether to schedule Inventory jobs for this certificate store, and if so, the frequency here.
65+
1366

1467
# Authentication
1568
A service account is necessary for authentication to GCP. The following are the required permissions:
@@ -26,12 +79,16 @@ Remember to assign the appropriate role/permissions for the service account.
2679
Afterwards inside Keyfactor Command copy and paste the contents of the service account key in the password field for the GCP Certificate Store Type.
2780

2881
# Supported Functionality
29-
- Inventory, Management
82+
- Inventory
83+
- Management-Add (including re-binding of existing bindings for certificate renewals, no binding functionality available for new certificate adds)
84+
- Management-Remove
3085

3186
# Not Implemented/Supported
32-
- Binding
87+
- Discovery
88+
- Management-Create
89+
- Reenrollment
3390

34-
***
91+
***
3592

3693
### License
3794
[Apache](https://apache.org/licenses/LICENSE-2.0)

README.md.tpl

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,68 @@
11
# {{ name }}
22
## {{ integration_type | capitalize }}
33

4-
{{ description }}
5-
64
<!-- add integration specific information below -->
7-
***
5+
6+
***
87

98
# Introduction
10-
- TODO:
9+
- {{ description }}
1110

1211
# Setting up GCP Cert Store Type
12+
The certificate store type set up for the GCP Load Balancer Orchestrator should have the following options set:
13+
14+
**Name:** A descriptive name for the certificate store type
15+
16+
**Short Name:** Must be **GCP**
17+
18+
**Needs Server:** Unchecked
19+
20+
**Blueprint Allowed:** Unchecked
21+
22+
**Requires Store Password:** Unchecked
23+
24+
**Supports Entry Password:** Unchecked
25+
26+
**Supports Custom Alias:** Optional (If unselected, a random alias will be generated by the GCP LB Orchestrator)
27+
28+
**Uses PowerShell: ** Unchecked
29+
30+
**Store Path Type:** FreeForm
31+
32+
**Private Keys: ** Required (Adding a certificate to a GCP Load Balancer certificate store without the private key is not a valid use case)
33+
34+
**PFX Password Style:** Default
35+
36+
**Job Types:** Check Inventory, Add, and Remove. Leave Create, Discovery, and Reenrollment unchecked
37+
38+
**Parameters:** Add 1 custom parameter if authenticating to the GCP API library by passing the GCP service account key from Keyfactor Command (see Authentication):
39+
40+
- Name: Must be **jsonKey**
41+
- Display Name: Desired custom display name
42+
- Type: Secret
43+
- Change Default Value: Unchecked
44+
- Default Value: Leave blank
45+
46+
47+
48+
# Setting up GCP Cert Store
49+
When creating a GCP certificate store in Keyfactor, the various options should be set up a follows:
50+
51+
**Category:** Must be GCP
52+
53+
**Container:** Optional container name if using this feature. Please consult the Keyfactor Command Reference Guide for more information on this feature.
54+
55+
**Client Machine:** The name or IP address of the Orchestrator server that will be handling GCP jobs.
56+
57+
**Store Path:** This should be your Google Cloud project ID. This will work against GCP Global resources. Optionally, you can append "/" with the region you wish to process against. Please refer to the following page for a list of valid region codes (GCP code column): https://gist.github.com/rpkim/084046e02fd8c452ba6ddef3a61d5d59.
58+
59+
**Service Account Key:** If you will be authenticating via passing credentials from Keyfactor Command, you must add this value as follows:
60+
- No Service Account Key: Unchecked
61+
- Secret Source: "Keyfactor Secrets" if you wish to store the GCP service account key in the Keyfactor secrets engine or "Load From PAM Provider" if you have set up a PAM provider integration within Keyfactor Command and wish to store this value there.
62+
- Enter and Confirm Service Account Key: The JSON-based service account key you acquired from GCP (See Authentication).
63+
64+
**Inventory Schedule:** Set whether to schedule Inventory jobs for this certificate store, and if so, the frequency here.
65+
1366

1467
# Authentication
1568
A service account is necessary for authentication to GCP. The following are the required permissions:
@@ -26,12 +79,16 @@ Remember to assign the appropriate role/permissions for the service account.
2679
Afterwards inside Keyfactor Command copy and paste the contents of the service account key in the password field for the GCP Certificate Store Type.
2780

2881
# Supported Functionality
29-
- Inventory, Management
82+
- Inventory
83+
- Management-Add (including re-binding of existing bindings for certificate renewals, no binding functionality available for new certificate adds)
84+
- Management-Remove
3085

3186
# Not Implemented/Supported
32-
- Binding
87+
- Discovery
88+
- Management-Create
89+
- Reenrollment
3390

34-
***
91+
***
3592

3693
### License
3794
[Apache](https://apache.org/licenses/LICENSE-2.0)

integration-manifest.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
21
{
32
"$schema": "https://keyfactor.github.io/integration-manifest-schema.json",
4-
"integration_type": "gcp",
5-
"name": "GCP AnyAgent",
6-
"status": "pilot",
7-
"description": "This integration is used to inventory and manage certificates in GCP. "
3+
"integration_type": "orchestrator",
4+
"name": "GCP Load Balancer",
5+
"status": "production",
6+
"link_github": true,
7+
"description": "The GCP Load Balancer Orchestrator allows for the management of Google Cloud Platform Load Balancer certificate stores. Inventory, Management-Add, and Management-Remove functions are supported. Also, re-binding to endpoints IS supported for certificate renewals (but NOT adding new certificates). The orchestrator uses the Google Cloud Compute Engine API to manage stores."
88
}

0 commit comments

Comments
 (0)