Actualiser .gitea/workflows/deploy-verso.yml
Build and Deploy Verso / deploy (push) Successful in 9m39s
Build and Deploy Verso / deploy (push) Successful in 9m39s
This commit is contained in:
@@ -91,6 +91,119 @@ jobs:
|
||||
kubectl -n ci logs job/verso-buildkit -c prepare || true
|
||||
kubectl -n ci logs job/verso-buildkit -c buildkit || true
|
||||
|
||||
- name: Recreate test dependencies
|
||||
run: |
|
||||
kubectl -n test delete deployment mongo redis --ignore-not-found=true
|
||||
kubectl -n test delete service mongo redis --ignore-not-found=true
|
||||
|
||||
cat <<'EOF' | kubectl apply -f -
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mongo
|
||||
namespace: test
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mongo
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mongo
|
||||
spec:
|
||||
containers:
|
||||
- name: mongo
|
||||
image: mongo:6
|
||||
command:
|
||||
- mongod
|
||||
- --replSet
|
||||
- rs0
|
||||
- --bind_ip_all
|
||||
ports:
|
||||
- containerPort: 27017
|
||||
volumeMounts:
|
||||
- name: mongo-data
|
||||
mountPath: /data/db
|
||||
volumes:
|
||||
- name: mongo-data
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mongo
|
||||
namespace: test
|
||||
spec:
|
||||
selector:
|
||||
app: mongo
|
||||
ports:
|
||||
- name: mongo
|
||||
port: 27017
|
||||
targetPort: 27017
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: test
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
spec:
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:7
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
volumeMounts:
|
||||
- name: redis-data
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: redis-data
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: test
|
||||
spec:
|
||||
selector:
|
||||
app: redis
|
||||
ports:
|
||||
- name: redis
|
||||
port: 6379
|
||||
targetPort: 6379
|
||||
EOF
|
||||
|
||||
kubectl -n test rollout status deployment/mongo
|
||||
kubectl -n test rollout status deployment/redis
|
||||
|
||||
sleep 5
|
||||
|
||||
kubectl -n test exec deploy/mongo -- mongosh --eval '
|
||||
rs.initiate({
|
||||
_id: "rs0",
|
||||
members: [
|
||||
{ _id: 0, host: "mongo:27017" }
|
||||
]
|
||||
})
|
||||
'
|
||||
|
||||
kubectl -n test exec deploy/mongo -- mongosh --eval '
|
||||
while (rs.status().myState !== 1) {
|
||||
sleep(1000)
|
||||
}
|
||||
print("Mongo replica set is PRIMARY")
|
||||
'
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
kubectl -n test set image deployment/verso \
|
||||
|
||||
Reference in New Issue
Block a user