drone ci to push to github

This commit is contained in:
viktorbarzin 2021-02-14 18:23:49 +00:00
parent 03f8b5a9ac
commit f414a214de
2 changed files with 12 additions and 42 deletions

View file

@ -3,7 +3,7 @@ type: kubernetes
name: default
steps:
- name: PRepare terraform files
- name: Prepare terraform files
image: alpine
commands:
- "apk update && apk add jq curl git git-crypt"
@ -16,29 +16,15 @@ steps:
TF_VAR_prod: "true"
commands:
- "terraform init"
- "terraform plan -target=module.kubernetes_cluster"
- "terraform apply -target=module.kubernetes_cluster -auto-approve"
# - name: Update configmap
# image: alpine
# commands:
# - "apk update && apk add curl"
# - "head terraform.tfstate"
# plan: true
# root_dir: "/data/src"
# var_files:
# - "/terraform.tfvars"
# remote:
# backend:
# ---
# kind: secret
# name: tfstate
# get:
# path: tfstate-default-state
# name: tfstate
# ---
# kind: secret
# name: tfstate
# data: zQSRlrUlUyY/lJL4AADpjTt+CfLmybuZqI4uHbPKv8kn2Aq4jomsNmseYgvrxbOF
- name: Push commit
image: alpine
commands:
- "apk update && apk add openssh-client git git-crypt"
- "mkdir ~/.ssh && ssh-keyscan -H github.com >> ~/.ssh/known_hosts"
- 'chmod 400 secrets/deploy_key'
- "git add ."
- "git remote set-url origin git@github.com:ViktorBarzin/infra.git"
- "git commit -m 'Drone CI deploy commit' || echo 'No changes'"
- "GIT_SSH_COMMAND='ssh -i ./secrets/deploy_key -o IdentitiesOnly=yes' git push origin master"

View file

@ -292,22 +292,6 @@ resource "kubernetes_deployment" "drone_runner" {
value = "true"
}
}
# volume {
# name = "tfvars"
# config_map {
# name = "tfvars"
# }
# }
# volume {
# name = "data"
# iscsi {
# target_portal = "iscsi.viktorbarzin.lan:3260"
# fs_type = "ext4"
# iqn = "iqn.2020-12.lan.viktorbarzin:storage:drone:tfstate"
# lun = 0
# read_only = false
# }
# }
}
}
}