apiVersion: tekton.dev/v1alpha1 kind: Task metadata: name: argocd-task-sync-and-wait spec: inputs: params: - name: application-name description: name of the application to sync - name: revision description: the revision to sync to default: HEAD - name: flags default: -- - name: argocd-version default: v1.0.2 stepTemplate: envFrom: - configMapRef: name: argocd-env-configmap # used for server address - secretRef: name: argocd-env-secret # used for authentication (username/password or auth token) steps: - name: login image: argoproj/argocd:$(inputs.params.argocd-version) command: ["/bin/bash", "-c"] args: - if [ -z $ARGOCD_AUTH_TOKEN ]; then yes | argocd login $ARGOCD_SERVER --username=$ARGOCD_USERNAME --password=$ARGOCD_PASSWORD; fi - name: sync image: argoproj/argocd:$(inputs.params.argocd-version) command: ["/bin/bash", "-c"] args: - argocd app sync $(inputs.params.application-name) --revision $(inputs.params.revision) $(inputs.params.flags) - name: wait image: argoproj/argocd:$(inputs.params.argocd-version) command: ["/bin/bash", "-c"] args: - argocd app wait $(inputs.params.application-name) --health $(inputs.params.flags)