Actualiser .gitea/workflows/deploy-verso.yml
Build and Deploy Verso / deploy (push) Has been cancelled
Build and Deploy Verso / deploy (push) Has been cancelled
This commit is contained in:
@@ -13,18 +13,18 @@ env:
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: native
|
||||
timeout-minutes: 60
|
||||
timeout-minutes: 90
|
||||
|
||||
steps:
|
||||
- name: Build and push image with Kaniko
|
||||
- name: Build and push image with BuildKit
|
||||
run: |
|
||||
kubectl -n ci delete job verso-kaniko --ignore-not-found=true
|
||||
kubectl -n ci delete job verso-buildkit --ignore-not-found=true
|
||||
|
||||
cat <<'EOF' | kubectl apply -f -
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: verso-kaniko
|
||||
name: verso-buildkit
|
||||
namespace: ci
|
||||
spec:
|
||||
backoffLimit: 0
|
||||
@@ -41,7 +41,6 @@ jobs:
|
||||
- |
|
||||
set -eux
|
||||
git clone --depth 1 https://git.alocoq.fr/alois/verso.git /workspace/repo
|
||||
|
||||
volumeMounts:
|
||||
- name: workspace
|
||||
mountPath: /workspace
|
||||
@@ -56,6 +55,7 @@ jobs:
|
||||
- -c
|
||||
- |
|
||||
set -eux
|
||||
|
||||
buildctl-daemonless.sh build \
|
||||
--frontend=dockerfile.v0 \
|
||||
--local context=/workspace/repo \
|
||||
@@ -65,30 +65,31 @@ jobs:
|
||||
volumeMounts:
|
||||
- name: workspace
|
||||
mountPath: /workspace
|
||||
volumes:
|
||||
- name: workspace
|
||||
emptyDir: {}
|
||||
EOF
|
||||
|
||||
volumes:
|
||||
- name: workspace
|
||||
emptyDir: {}
|
||||
EOF
|
||||
|
||||
- name: Wait for build
|
||||
run: |
|
||||
kubectl -n ci wait --for=condition=complete job/verso-kaniko --timeout=3600s
|
||||
kubectl -n ci wait --for=condition=complete job/verso-buildkit --timeout=5400s
|
||||
|
||||
- name: Show logs
|
||||
if: always()
|
||||
run: |
|
||||
kubectl -n ci logs job/verso-kaniko -c prepare || true
|
||||
kubectl -n ci logs job/verso-kaniko -c kaniko || true
|
||||
kubectl -n ci logs job/verso-buildkit -c prepare || true
|
||||
kubectl -n ci logs job/verso-buildkit -c buildkit || true
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
kubectl -n verso-dev set image deployment/verso \
|
||||
kubectl -n test set image deployment/verso \
|
||||
verso=registry.alocoq.fr/verso:latest
|
||||
|
||||
kubectl -n verso-dev rollout restart deployment/verso
|
||||
kubectl -n verso-dev rollout status deployment/verso
|
||||
kubectl -n test rollout restart deployment/verso
|
||||
kubectl -n test rollout status deployment/verso
|
||||
|
||||
- name: Cleanup
|
||||
if: always()
|
||||
run: |
|
||||
kubectl -n ci delete job verso-kaniko --ignore-not-found=true
|
||||
kubectl -n ci delete job verso-buildkit --ignore-not-found=true
|
||||
Reference in New Issue
Block a user