Skip to content

Commit

Permalink
Merge pull request #8 from giladAlboher/main
Browse files Browse the repository at this point in the history
fixed the CI problem
  • Loading branch information
ozalboher authored Jan 29, 2024
2 parents 07dff10 + cb129b6 commit 26d6ae4
Showing 2 changed files with 30 additions and 43 deletions.
71 changes: 29 additions & 42 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -9,6 +9,32 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: build docker image
run: |
docker build -t giladalboher/integratorportal:v1.0.${{ github.run_id }} .
- name: Update Deployment Manifest
run: |
sed -i "s|image: giladalboher/integratorportal:v1.0.*|image: giladalboher/integratorportal:v1.0.${{ github.run_id }}|" configs/intergratorportal.yaml
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
ecr: auto
logout: true

- name: docker push
run: |
docker push giladalboher/integratorportal:v1.0.${{ github.run_id }}
- name: Start minikube
uses: medyagh/setup-minikube@master
@@ -26,56 +52,17 @@ jobs:
run: |
SECONDS=0
TIMEOUT=60
while true; do
POD_COUNT=$(kubectl get pods -n integratorportal -o custom-columns=:metadata.name | wc -l)
CURRENT_READY_PODS=$(kubectl get pods -n integratorportal -l app=integratorportal -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}' | grep -o "True" | wc -l)
if [[ $CURRENT_READY_PODS -eq $POD_COUNT ]]; then
break
elif [[ $SECONDS -gt $TIMEOUT ]]; then
POD_COUNT=$(kubectl get pods -n integratorportal --no-headers -o custom-columns=:metadata.name | wc -l)
while [[ $(kubectl get pods -n integratorportal -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}' | grep -o "True" | wc -l) -ne $POD_COUNT ]]; do
if [[ $SECONDS -gt $TIMEOUT ]]; then
echo "Timed out waiting for pods to be ready"
pod_name=$(kubectl get pods -n integratorportal -l app=integratorportal -o jsonpath='{.items[0].metadata.name}')
kubectl describe pods $pod_name -n integratorportal
exit 1
fi
kubectl get pods -n integratorportal && sleep 1;
SECONDS=$((SECONDS+1))
done
- name: Test service URLs
run: |
docker images
minikube service list
kubectl get pods
minikube service integratorportal-service --url
echo "-----------------opening the service-----------------"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: build docker image
run: |
docker build -t giladalboher/integratorportal:v1.0.${{ github.run_id }} .
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
ecr: auto
logout: true

- name: docker push
run: |
docker push giladalboher/integratorportal:v1.0.${{ github.run_id }}
- name: Update Deployment Manifest
run: |
sed -i "s|image: giladalboher/integratorportal:v1.0.*|image: giladalboher/integratorportal:v1.0.${{ github.run_id }}|" configs/intergratorportal.yaml

- name: Commit & Push changes
uses: actions-js/push@master
with:
2 changes: 1 addition & 1 deletion configs/intergratorportal.yaml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: integratorportal
image: giladalboher/integratorportal:v1.0.7697634675
image: giladalboher/integratorportal:v1.0.7699784857
ports:
- containerPort: 3000
resources:

0 comments on commit 26d6ae4

Please sign in to comment.