Skip to content

LWPM Dist K8S File

LWPM Dist K8S File #77

name: LWPM Dist K8S File
on:
workflow_dispatch:
inputs:
LWPM_K8S_VERSION:
description: k8s version
required: true
default: 1.27.0
env:
LWPM_K8S_VERSION: ${{ github.event.inputs.LWPM_K8S_VERSION }}
CODING_DOCKER_REGISTRY: pcit-docker.pkg.coding.net
CODING_DOCKER_USERNAME: khs1994-1601432822176
CODING_DOCKER_PASSWORD: ${{secrets.CODING_DOCKER_PASSWORD}}
jobs:
lwpm-dist-k8s-file:
name: lwpm-dist-k8s-file
runs-on: ${{ matrix.os }}-latest
env:
LWPM_DOCKER_USERNAME: khs1994
LWPM_DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
LWPM_DOCKER_REGISTRY: registry-1.docker.io
LNMP_CN_ENV: "false"
strategy:
matrix:
os: ["windows","ubuntu"]
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
repository: khs1994-docker/lnmp
fetch-depth: 1
path: lnmp
- name: handle-kubectl
shell: pwsh
if: matrix.os == 'windows'
env:
TENCENT_DOCKER_USERNAME: "906210846"
TENCENT_DOCKER_REGISTRY: useccr.ccs.tencentyun.com
run: |
echo $ErrorActionPreference
$ErrorActionPreference = "Continue"
. ./lnmp/windows/sdk/dockerhub/rootfs.ps1
./lnmp/windows/lnmp-windows-pm.ps1 dist kubectl@${env:LWPM_K8S_VERSION}
./lnmp/windows/lnmp-windows-pm.ps1 push kubectl@${env:LWPM_K8S_VERSION}
$env:DOCKER_USERNAME="khs1994"
rootfs lwpm/kubectl ${env:LWPM_K8S_VERSION} -phase "manifest list"
$env:LWPM_DOCKER_USERNAME=$env:TENCENT_DOCKER_USERNAME
$env:LWPM_DOCKER_REGISTRY=$env:TENCENT_DOCKER_REGISTRY
$NS="khs1994"
./lnmp/windows/lnmp-windows-pm.ps1 push $NS/kubectl@${env:LWPM_K8S_VERSION}
$env:DOCKER_USERNAME=$env:TENCENT_DOCKER_USERNAME
rootfs $NS/kubectl ${env:LWPM_K8S_VERSION} -registry $env:LWPM_DOCKER_REGISTRY -phase "manifest list"
$env:LWPM_DOCKER_USERNAME=$env:CODING_DOCKER_USERNAME
$env:LWPM_DOCKER_PASSWORD=$env:CODING_DOCKER_PASSWORD
$env:LWPM_DOCKER_REGISTRY=$env:CODING_DOCKER_REGISTRY
$NS="khs1994-docker/lwpm"
./lnmp/windows/lnmp-windows-pm.ps1 push $NS/kubectl@${env:LWPM_K8S_VERSION}
- name: handle-kubernetes-server
shell: pwsh
env:
TENCENT_DOCKER_USERNAME: "906210846"
TENCENT_DOCKER_REGISTRY: useccr.ccs.tencentyun.com
if: matrix.os == 'windows'
run: |
echo $ErrorActionPreference
$ErrorActionPreference = "Continue"
. ./lnmp/windows/sdk/dockerhub/rootfs.ps1
./lnmp/windows/lnmp-windows-pm.ps1 dist kubernetes-server@${env:LWPM_K8S_VERSION}
./lnmp/windows/lnmp-windows-pm.ps1 push kubernetes-server@${env:LWPM_K8S_VERSION}
$env:DOCKER_USERNAME="khs1994"
rootfs lwpm/kubernetes-server ${env:LWPM_K8S_VERSION} -phase "manifest list"
$env:LWPM_DOCKER_USERNAME=$env:TENCENT_DOCKER_USERNAME
$env:LWPM_DOCKER_REGISTRY=$env:TENCENT_DOCKER_REGISTRY
$NS="khs1994"
./lnmp/windows/lnmp-windows-pm.ps1 push $NS/kubernetes-server@${env:LWPM_K8S_VERSION}
$env:DOCKER_USERNAME=$env:TENCENT_DOCKER_USERNAME
rootfs $NS/kubernetes-server ${env:LWPM_K8S_VERSION} -registry $env:LWPM_DOCKER_REGISTRY -phase "manifest list"
$env:LWPM_DOCKER_USERNAME=$env:CODING_DOCKER_USERNAME
$env:LWPM_DOCKER_PASSWORD=$env:CODING_DOCKER_PASSWORD
$env:LWPM_DOCKER_REGISTRY=$env:CODING_DOCKER_REGISTRY
$NS="khs1994-docker/lwpm"
./lnmp/windows/lnmp-windows-pm.ps1 push $NS/kubernetes-server@${env:LWPM_K8S_VERSION}
- name: handle-kubernetes-node
shell: pwsh
if: matrix.os == 'ubuntu'
env:
TENCENT_DOCKER_USERNAME: "906210846"
TENCENT_DOCKER_REGISTRY: useccr.ccs.tencentyun.com
run: |
echo $ErrorActionPreference
. ./lnmp/windows/sdk/dockerhub/rootfs.ps1
./lnmp/windows/lnmp-windows-pm.ps1 dist kubernetes-node@${env:LWPM_K8S_VERSION}
./lnmp/windows/lnmp-windows-pm.ps1 push kubernetes-node@${env:LWPM_K8S_VERSION}
$env:DOCKER_USERNAME="khs1994"
rootfs lwpm/kubernetes-node ${env:LWPM_K8S_VERSION} -phase "manifest list"
$env:LWPM_DOCKER_USERNAME=$env:TENCENT_DOCKER_USERNAME
$env:LWPM_DOCKER_REGISTRY=$env:TENCENT_DOCKER_REGISTRY
$NS="khs1994"
./lnmp/windows/lnmp-windows-pm.ps1 push $NS/kubernetes-node@${env:LWPM_K8S_VERSION}
$env:DOCKER_USERNAME=$env:TENCENT_DOCKER_USERNAME
rootfs $NS/kubernetes-node ${env:LWPM_K8S_VERSION} -registry $env:LWPM_DOCKER_REGISTRY -phase "manifest list"
$env:LWPM_DOCKER_USERNAME=$env:CODING_DOCKER_USERNAME
$env:LWPM_DOCKER_PASSWORD=$env:CODING_DOCKER_PASSWORD
$env:LWPM_DOCKER_REGISTRY=$env:CODING_DOCKER_REGISTRY
$NS="khs1994-docker/lwpm"
./lnmp/windows/lnmp-windows-pm.ps1 push $NS/kubernetes-node@${env:LWPM_K8S_VERSION}
trigger-coding-net-ci:
needs: lwpm-dist-k8s-file
name: trigger-coding-net-ci
runs-on: ubuntu-latest
steps:
- name: trigger-coding.net-ci
env:
CODING_PASSWORD: ${{secrets.CODING_CI_PCIT_PASSWORD}}
run: |
set -x
curl -u pto8bv6hoj8e:${CODING_PASSWORD} \
-v -X POST 'https://pcit.coding.net/api/cci/job/234348/trigger' \
-H 'Content-Type: application/json' \
-d "
{
\"ref\": \"master\",
\"envs\": [
{
\"name\": \"LWPM_K8S_VERSION\",
\"value\": \"${LWPM_K8S_VERSION}\",
\"sensitive\": 0
}
]
}"