-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.72 KB
/
Copy pathcreate-k8s.yaml
File metadata and controls
57 lines (50 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Create K8s cluster pipeline
on:
workflow_dispatch:
jobs:
DEV:
runs-on: rhel_arm
steps:
- name: Import secrets hashicorp
uses: hashicorp/vault-action@v2.4.0
with:
url: ${{secrets.VAULT_SERVER}}
token: ${{secrets.VAULT_TOKEN}}
tlsSkipVerify: true #add to runner later /usr/local/share/ca-certificates/vault-ca.crt
secrets: |
tools/data/aws aws_user | AWS_USER;
tools/data/aws aws_password |AWS_PASSWORD;
# tools/data/aws aws_ami_id | AWS_AMI_ID ;
# # tools/data/aws vault_token |VAULT_TOKEN # give ami id on vault
# tools is secretengine-check api
- uses: actions/checkout@v4
- name: run terraform
# export TF_VAR_vault_token=${{secrets.VAULT_TOKEN}}
run: |
cd k8s-infra-selfmanaged;
terraform init -backend-config=env-dev/state.tfvars ; terraform plan -var-file=env-dev/main.tfvars;terraform apply -var-file=env-dev/main.tfvars -auto-approve
env:
TF_VAR_aws_user: ${{env.AWS_USER}}
TF_VAR_aws_password: ${{env.AWS_PASSWORD}}
# TF_VAR_aws_ami_id: ${{env.AWS_AMI_ID}}
QA:
runs-on: rhel_arm
needs: DEV
environment: QA
steps:
- name: Running code on QA
run: echo "Code run successfully after test"
UAT:
runs-on: rhel_arm
needs: QA
environment: UAT
steps:
- name: Running code on QA
run: echo "Code run successfully after test"
PROD:
runs-on: rhel_arm
needs: UAT
environment: PROD
steps:
- name: Running code on QA
run: echo "Code run successfully and deployed"