@vaharoni/devops 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/target-templates/.devops/config/constants.yaml +1 -1
- package/src/target-templates/.devops/manifests/cron-jobs.yaml.hb +1 -0
- package/src/target-templates/.devops/manifests/db-migrate-job.yaml.hb +1 -0
- package/src/target-templates/.devops/manifests/deployment-debug.yaml.hb +1 -0
- package/src/target-templates/.devops/manifests/deployment-process.yaml.hb +1 -0
- package/src/target-templates/.devops/manifests/deployment-web.yaml.hb +1 -0
- package/src/target-templates/.devops/manifests/prefect.yaml.hb +1 -0
- package/src/target-templates/.github/actions/connect-to-gke@v1/action.yaml +43 -0
- package/src/target-templates/.github/actions/connect-to-infra@v1/action.yaml +22 -1
- package/src/target-templates/.github/workflows/k8s-build.yaml +8 -0
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# These will be used when generating kubernetes entities
|
2
2
|
project-name: changeme
|
3
3
|
|
4
|
-
# Supported: hetzner or
|
4
|
+
# Supported: hetzner, digitalocean, or gcloud
|
5
5
|
infra: hetzner
|
6
6
|
|
7
7
|
# Only relevant for Digital Ocean. Determines the number of versions to keep for each docker image.
|
@@ -0,0 +1,43 @@
|
|
1
|
+
name: "Connect to Google Cloud GKE"
|
2
|
+
description: "Sets up kubernetes connection to Google Cloud and ensures connection"
|
3
|
+
inputs:
|
4
|
+
project_id:
|
5
|
+
description: "Google Cloud project ID"
|
6
|
+
required: true
|
7
|
+
zone:
|
8
|
+
description: "Google Cloud GKE zone (e.g., us-central1)"
|
9
|
+
required: true
|
10
|
+
cluster_name:
|
11
|
+
description: "Google Cloud GKE cluster name"
|
12
|
+
required: true
|
13
|
+
service_account_key:
|
14
|
+
description: "Google Cloud service account key in JSON format"
|
15
|
+
required: true
|
16
|
+
runs:
|
17
|
+
using: "composite"
|
18
|
+
steps:
|
19
|
+
- name: Authenticate to Google Cloud
|
20
|
+
uses: google-github-actions/auth@v2
|
21
|
+
with:
|
22
|
+
project_id: ${{ inputs.project_id }}
|
23
|
+
credentials_json: ${{ inputs.service_account_key }}
|
24
|
+
|
25
|
+
- name: Install gcloud
|
26
|
+
uses: google-github-actions/setup-gcloud@v2
|
27
|
+
with:
|
28
|
+
project_id: ${{ inputs.project_id }}
|
29
|
+
|
30
|
+
- name: Configure Docker auth
|
31
|
+
shell: bash
|
32
|
+
run: gcloud --quiet auth configure-docker
|
33
|
+
|
34
|
+
- name: Fetch GKE credentials
|
35
|
+
uses: google-github-actions/get-gke-credentials@v2
|
36
|
+
with:
|
37
|
+
cluster_name: ${{ inputs.cluster_name }}
|
38
|
+
location: ${{ inputs.zone }}
|
39
|
+
project_id: ${{ inputs.project_id }}
|
40
|
+
|
41
|
+
- name: verify namepsace exists
|
42
|
+
run: devops namespace check --env ${{ github.ref_name }}
|
43
|
+
shell: bash
|
@@ -16,6 +16,18 @@ inputs:
|
|
16
16
|
harbor_password:
|
17
17
|
description: "The password for the harbor registry"
|
18
18
|
required: false
|
19
|
+
gcloud_project_id:
|
20
|
+
description: "Google Cloud project ID"
|
21
|
+
required: false
|
22
|
+
gcloud_zone:
|
23
|
+
description: "Google Cloud GKE zone (e.g., us-central1)"
|
24
|
+
required: false
|
25
|
+
gcloud_cluster_name:
|
26
|
+
description: "Google Cloud GKE cluster name"
|
27
|
+
required: false
|
28
|
+
service_account_key:
|
29
|
+
description: "Google Cloud service account key in JSON format"
|
30
|
+
required: false
|
19
31
|
outputs:
|
20
32
|
infra:
|
21
33
|
description: "Which infrastructure is being used"
|
@@ -43,4 +55,13 @@ runs:
|
|
43
55
|
with:
|
44
56
|
kubeconfig: ${{ inputs.hetzner_kubeconfig }}
|
45
57
|
harbor_user: ${{ inputs.harbor_user }}
|
46
|
-
harbor_password: ${{ inputs.harbor_password }}
|
58
|
+
harbor_password: ${{ inputs.harbor_password }}
|
59
|
+
|
60
|
+
- name: Connect to Google Cloud GKE
|
61
|
+
if: steps.determine_infrastructure.outputs.infra == 'gcloud'
|
62
|
+
uses: ./.github/actions/connect-to-gke@v1
|
63
|
+
with:
|
64
|
+
project_id: ${{ inputs.gcloud_project_id }}
|
65
|
+
zone: ${{ inputs.gcloud_zone }}
|
66
|
+
cluster_name: ${{ inputs.gcloud_cluster_name }}
|
67
|
+
service_account_key: ${{ inputs.service_account_key }}
|
@@ -37,6 +37,10 @@ jobs:
|
|
37
37
|
hetzner_kubeconfig: ${{ secrets.HCLOUD_KUBECONFIG }}
|
38
38
|
harbor_user: ${{ secrets.HARBOR_USER }}
|
39
39
|
harbor_password: ${{ secrets.HARBOR_PASSWORD }}
|
40
|
+
gcloud_project_id: ${{ secrets.GCLOUD_PROJECT_ID }}
|
41
|
+
gcloud_zone: ${{ secrets.GCLOUD_ZONE }}
|
42
|
+
gcloud_cluster_name: ${{ secrets.GCLOUD_CLUSTER_NAME }}
|
43
|
+
service_account_key: ${{ secrets.GCLOUD_SA_KEY }}
|
40
44
|
|
41
45
|
- name: Build image
|
42
46
|
uses: ./.github/actions/build-image@v1
|
@@ -65,6 +69,10 @@ jobs:
|
|
65
69
|
hetzner_kubeconfig: ${{ secrets.HCLOUD_KUBECONFIG }}
|
66
70
|
harbor_user: ${{ secrets.HARBOR_USER }}
|
67
71
|
harbor_password: ${{ secrets.HARBOR_PASSWORD }}
|
72
|
+
gcloud_project_id: ${{ secrets.GCLOUD_PROJECT_ID }}
|
73
|
+
gcloud_zone: ${{ secrets.GCLOUD_ZONE }}
|
74
|
+
gcloud_cluster_name: ${{ secrets.GCLOUD_CLUSTER_NAME }}
|
75
|
+
service_account_key: ${{ secrets.GCLOUD_SA_KEY }}
|
68
76
|
|
69
77
|
- name: Run DB Migrate
|
70
78
|
uses: ./.github/actions/db-migrate@v1
|