@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vaharoni/devops",
3
3
  "type": "module",
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "description": "Devops utility",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -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 digitalocean
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.
@@ -48,6 +48,7 @@ spec:
48
48
  resources:
49
49
  requests:
50
50
  memory: 250Mi
51
+ cpu: 100m
51
52
  restartPolicy: Never
52
53
  {{#unless @last}}
53
54
  ---
@@ -37,6 +37,7 @@ spec:
37
37
  resources:
38
38
  requests:
39
39
  memory: 100Mi
40
+ cpu: 250m
40
41
  restartPolicy: Never
41
42
  backoffLimit: 0
42
43
  ttlSecondsAfterFinished: 3600
@@ -42,3 +42,4 @@ spec:
42
42
  resources:
43
43
  requests:
44
44
  memory: 250Mi
45
+ cpu: 100m
@@ -45,3 +45,4 @@ spec:
45
45
  resources:
46
46
  requests:
47
47
  memory: 250Mi
48
+ cpu: 250m
@@ -51,3 +51,4 @@ spec:
51
51
  resources:
52
52
  requests:
53
53
  memory: 250Mi
54
+ cpu: 250m
@@ -56,6 +56,7 @@ spec:
56
56
  resources:
57
57
  requests:
58
58
  memory: 250Mi
59
+ cpu: 250m
59
60
  {{#unless @last}}
60
61
  ---
61
62
  {{/unless}}
@@ -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