diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f901898..3801ee6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,7 +30,7 @@ jobs: curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh if: runner.os == 'Linux' - +#test - name: Set up Docker Buildx # uses: https://github.com/docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1 @@ -43,7 +43,7 @@ jobs: - name: Push to Docker run: docker push harbor.icurfer.com/msa-demo/msa-django-ansible:${{ steps.img-ver.outputs.content }} - +#test ## pre cd - name: Setup Kustomize uses: yokawasa/action-setup-kube-tools@v0.9.2 @@ -58,11 +58,28 @@ jobs: token: ${{ secrets.ACTION_TOKEN }} path: cd-msa-django-ansible - - name: Update Kubernetes resources + - name: Update container image Tag run: | cd cd-msa-django-ansible/overlays/dev/ kustomize edit set image harbor.icurfer.com/msa-demo/msa-django-ansible:${{ steps.img-ver.outputs.content }} - cat kustomization.yaml + cat kustomization.yaml + + - name: Update container name + run: | + cd cd-msa-django-ansible/overlays/dev/ + + echo "✅ Installing yq..." + wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64 + chmod +x /usr/local/bin/yq + + echo "✅ Updating container name in patch-deployment.yaml..." + VERSION="${{ steps.img-ver.outputs.content }}" + VERSION_SAFE=$(echo "$VERSION" | tr '.' 'd') + + yq e -i ".spec.template.spec.containers[0].name = \"msa-django-ansible-${VERSION_SAFE}\"" patch-deployment.yaml + + echo "✅ Final patch-deployment.yaml content:" + cat patch-deployment.yaml ## cd commit - name: Commit files diff --git a/version b/version index 45a2028..fb01fb5 100644 --- a/version +++ b/version @@ -1 +1 @@ -v0.0.7-r3 \ No newline at end of file +v0.0.7-r4 \ No newline at end of file