diff --git a/Jenkinsfile b/Jenkinsfile index 7fa8fbe..b1878c9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,11 +62,11 @@ pipeline { echo "Updating deployment manifests in GitOps repo..." withCredentials([usernamePassword(credentialsId: 'gitea-token-gitops', usernameVariable: 'GITEA_USER', passwordVariable: 'GITEA_PASS')]) { sh ''' - # Install yq kalau belum terpasang - if ! command -v yq &> /dev/null; then - echo "Installing yq..." - wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 - chmod +x /usr/local/bin/yq + # Install yq lokal (tanpa root) + if ! command -v ./yq &> /dev/null; then + echo "Installing yq locally..." + wget -qO ./yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 + chmod +x ./yq fi # Clone repo GitOps @@ -74,10 +74,10 @@ pipeline { git -c http.sslVerify=false clone -b $GITOPS_BRANCH https://$GITEA_USER:$GITEA_PASS@git.winteraccess.id/syifa/datasiswa-gitops.git gitops cd gitops - # Update image tag dengan yq + # Update image tag pakai yq lokal echo "Updating image tags..." - yq e -i ".spec.template.spec.containers[] |= select(.name == \\"backend\\").image = env(BACKEND_TAG)" ${DEPLOY_OVERLAY}/patch-deployment.yaml - yq e -i ".spec.template.spec.containers[] |= select(.name == \\"frontend\\").image = env(FRONTEND_TAG)" ${DEPLOY_OVERLAY}/patch-deployment.yaml + ../yq e -i ".spec.template.spec.containers[] |= select(.name == \\"backend\\").image = env(BACKEND_TAG)" ${DEPLOY_OVERLAY}/patch-deployment.yaml + ../yq e -i ".spec.template.spec.containers[] |= select(.name == \\"frontend\\").image = env(FRONTEND_TAG)" ${DEPLOY_OVERLAY}/patch-deployment.yaml # Commit & push perubahan git config user.name "jenkins"