chore: fix workflow
This commit is contained in:
parent
23b7f0f696
commit
4d9e492115
@ -13,11 +13,12 @@ jobs:
|
|||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
SSH_REPO_URL: "ssh://git@clrepo.tls13.io:9623"
|
SSH_REPO_URL: "ssh://git@clrepo.tls13.io:9623"
|
||||||
TARGET_NAME: "docserver"
|
TARGET_NAME: "docserver"
|
||||||
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
|
|
||||||
KUBECONFIG: "/tmp/.kubeconfig"
|
|
||||||
RUSTUP_HOME: "/toolcache/rust/.rustup"
|
RUSTUP_HOME: "/toolcache/rust/.rustup"
|
||||||
CARGO_HOME: "/toolcache/rust/.cargo"
|
CARGO_HOME: "/toolcache/rust/.cargo"
|
||||||
|
CARGO_TARGET_DIR: "/toolcache/docserver_target"
|
||||||
#KYD: ${{ secrets.KYD}}
|
#KYD: ${{ secrets.KYD}}
|
||||||
|
#KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
|
||||||
|
#KUBECONFIG: "/tmp/.kubeconfig"
|
||||||
steps:
|
steps:
|
||||||
- name: Init job triggered by event
|
- name: Init job triggered by event
|
||||||
run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event "
|
run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event "
|
||||||
@ -63,31 +64,30 @@ jobs:
|
|||||||
rustc -V
|
rustc -V
|
||||||
# printf "\n\t🐋 Installed RUSTUP 🐋\t\n"
|
# printf "\n\t🐋 Installed RUSTUP 🐋\t\n"
|
||||||
# rustup -V
|
# rustup -V
|
||||||
- name: Rust build
|
- name: Rust check
|
||||||
run: |
|
run: |
|
||||||
source "${CARGO_HOME}/env"
|
source "${CARGO_HOME}/env"
|
||||||
cd ${{ gitea.workspace }}
|
cd ${{ gitea.workspace }}
|
||||||
cargo build
|
cargo check
|
||||||
ls -l target/debug
|
# - name: Install kubectl
|
||||||
- name: Install kubectl
|
# run: |
|
||||||
run: |
|
# OS="$(uname | tr '[:upper:]' '[:lower:]')"
|
||||||
OS="$(uname | tr '[:upper:]' '[:lower:]')"
|
# ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')"
|
||||||
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')"
|
# apt-get update
|
||||||
apt-get update
|
# apt-get install ca-certificates
|
||||||
apt-get install ca-certificates
|
# update-ca-certificates
|
||||||
update-ca-certificates
|
# curl -L "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/$OS/$ARCH/kubectl" -o /usr/local/bin/kubectl
|
||||||
curl -L "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/$OS/$ARCH/kubectl" -o /usr/local/bin/kubectl
|
# [ -r "/usr/local/bin/kubectl" ] && chmod +x /usr/local/bin/kubectl
|
||||||
[ -r "/usr/local/bin/kubectl" ] && chmod +x /usr/local/bin/kubectl
|
# echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > $KUBECONFIG
|
||||||
echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > $KUBECONFIG
|
# - name: Run K8s JOB
|
||||||
- name: Run K8s JOB
|
# run: |
|
||||||
run: |
|
# echo "${{ vars.K8_JOB }}" | sed "s/{{KS_NAMESPACE}}/${{ vars.KS_NAMESPACE }}/g" | sed "s/{{KS_JOB_NAME}}/${{ vars.KS_JOB_NAME }}/g" > /tmp/job.yaml
|
||||||
echo "${{ vars.K8_JOB }}" | sed "s/{{KS_NAMESPACE}}/${{ vars.KS_NAMESPACE }}/g" | sed "s/{{KS_JOB_NAME}}/${{ vars.KS_JOB_NAME }}/g" > /tmp/job.yaml
|
# if [ -n "$(kubectl get pods -n ${{ vars.KS_NAMESPACE }} | grep ${{ vars.KS_JOB_NAME }})" ]; then
|
||||||
if [ -n "$(kubectl get pods -n ${{ vars.KS_NAMESPACE }} | grep ${{ vars.KS_JOB_NAME }})" ]; then
|
# kubectl delete -f /tmp/job.yaml
|
||||||
kubectl delete -f /tmp/job.yaml
|
# fi
|
||||||
fi
|
# echo "${{ vars.K8_CONFIGMAP_JOB }}" | sed "s/{{KS_NAMESPACE}}/${{ vars.KS_NAMESPACE }}/g" | sed "s/{{KS_JOB_NAME}}/${{ vars.KS_JOB_NAME }}/g"> /tmp/config_job.yaml
|
||||||
echo "${{ vars.K8_CONFIGMAP_JOB }}" | sed "s/{{KS_NAMESPACE}}/${{ vars.KS_NAMESPACE }}/g" | sed "s/{{KS_JOB_NAME}}/${{ vars.KS_JOB_NAME }}/g"> /tmp/config_job.yaml
|
# echo "🍏 Job ${{ vars.KS_JOB_NAME }} in ${{ vars.KS_NAMESPACE }} launched."
|
||||||
echo "🍏 Job ${{ vars.KS_JOB_NAME }} in ${{ vars.KS_NAMESPACE }} launched."
|
# echo "kubectl cp -n ${{ vars.KS_NAMESPACE }} ${{ gitea.workspace }}/target/debug/${TARGET_NAME} pod/targetPath ""
|
||||||
echo "kubectl cp -n ${{ vars.KS_NAMESPACE }} ${{ gitea.workspace }}/target/debug/${TARGET_NAME} pod/targetPath ""
|
|
||||||
# kubectl apply -f /tmp/config_job.yaml
|
# kubectl apply -f /tmp/config_job.yaml
|
||||||
# kubectl apply -f /tmp/job.yaml
|
# kubectl apply -f /tmp/job.yaml
|
||||||
# kubectl get jobs -n ${{ vars.KS_NAMESPACE }}
|
# kubectl get jobs -n ${{ vars.KS_NAMESPACE }}
|
Loading…
Reference in New Issue
Block a user