This commit is contained in:
TingluoHuang
2020-09-12 23:40:47 -04:00
parent 993357df7d
commit ef72239ff8
5 changed files with 61 additions and 23 deletions

View File

@@ -1,18 +0,0 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard

34
prereq.yaml Normal file
View File

@@ -0,0 +1,34 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: default
name: pod-patcher
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["pods"]
verbs: ["get", "watch", "list", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: default-pod-patcher
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: pod-patcher
subjects:
- kind: ServiceAccount
name: default
namespace: default
---
apiVersion: v1
kind: Secret
metadata:
name: githubtoken
type: Opaque
stringData:
GITHUB_PAT: "xxx"

View File

@@ -12,4 +12,26 @@ spec:
template:
spec:
setupDockerInDocker: true
imagePullPolicy: Always
imagePullPolicy: Always
runnerUpdateHandler:
containers:
- name: update-image
image: huangtingluo/workflow_dispatch:latest
imagePullPolicy: Always
env:
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: githubtoken
key: GITHUB_PAT
- name: GITHUB_OWNER
value: tingluohuang
- name: GITHUB_REPO
value: "k8s-runner-image"
- name: GITHUB_EXTRA_CURL_ARG
value: "-v"
- name: GITHUB_WORKFLOW
value: "docker-publish.yml"
- name: GITHUB_WORKFLOW_INPUTS
value: "{\"runnerDownloadUrl\":\"https://github.com/TingluoHuang/runner/releases/download/test/actions-runner-linux-x64-2.299.0.tar.gz\"}"
restartPolicy: Never

View File

@@ -507,7 +507,7 @@ namespace GitHub.Runner.Listener
await jobStartInvoker.ExecuteAsync(
workingDirectory: HostContext.GetDirectory(WellKnownDirectory.Root),
fileName: WhichUtil.Which("bash"),
arguments: $"-c \"{jobStartNotification}\" JOBSTART \"{DateTime.UtcNow.ToString("O")}\"",
arguments: $"-c \"{jobStartNotification} JOBSTART {DateTime.UtcNow.ToString("O")}\"",
environment: null,
requireExitCodeZero: true,
outputEncoding: null,
@@ -690,7 +690,7 @@ namespace GitHub.Runner.Listener
await jobCompleteInvoker.ExecuteAsync(
workingDirectory: HostContext.GetDirectory(WellKnownDirectory.Root),
fileName: WhichUtil.Which("bash"),
arguments: $"-c \"{jobCompleteNotification}\" JOBCOMPLETE \"{DateTime.UtcNow.ToString("O")}\"",
arguments: $"-c \"{jobCompleteNotification} JOBCOMPLETE {DateTime.UtcNow.ToString("O")}\"",
environment: null,
requireExitCodeZero: true,
outputEncoding: null,
@@ -771,7 +771,7 @@ namespace GitHub.Runner.Listener
await jobRunningInvoker.ExecuteAsync(
workingDirectory: HostContext.GetDirectory(WellKnownDirectory.Root),
fileName: WhichUtil.Which("bash"),
arguments: $"-c \"{jobRunningNotification}\" JOBRUNNING \"{DateTime.UtcNow.ToString("O")}\"",
arguments: $"-c \"{jobRunningNotification} JOBRUNNING {DateTime.UtcNow.ToString("O")}\"",
environment: null,
requireExitCodeZero: true,
outputEncoding: null,

View File

@@ -89,7 +89,7 @@ namespace GitHub.Runner.Listener
await runnerUpdateInvoker.ExecuteAsync(
workingDirectory: HostContext.GetDirectory(WellKnownDirectory.Root),
fileName: WhichUtil.Which("bash"),
arguments: $"-c \"{runnerUpdateNotification}\" RUNNERUPDATE \"{DateTime.UtcNow.ToString("O")}\"",
arguments: $"-c \"{runnerUpdateNotification} RUNNERUPDATE {DateTime.UtcNow.ToString("O")}\"",
environment: null,
requireExitCodeZero: true,
outputEncoding: null,