Webhook with a docker registry trigger


#1

I have a pipeline which can be triggered via a push to a docker registry. I would also like to support a webhook however when the webhook starts the pipeline it doesn’t seem to provide the trigger metadata which is used by the manifest:

apiVersion: v1
kind: ConfigMap
metadata:
  name: selenium-${trigger.tag} <== selenium-trigger.tag not found

I tried to provide the trigger data in the post:

curl $SPIN_SELENIUM_ADD_HOOK -X POST -H "$SPIN_POST_HEAD" -d \
'{ 
    "parameters": { 
        "ingress": "devdacloud01" 
    },
    "trigger": {
        "tag": "3-5-3-alpha"
    }
}'

#2

I was able to use the following post:

curl $SPIN_SELENIUM_ADD_HOOK -X POST -H "$SPIN_POST_HEAD" -d \
'{ 
    "parameters": { 
        "ingress": "devdacloud01"
    },
    "artifacts": [
        {
            "type": "docker/image",
            "name": "XXXXXXXXXXXXX:XXXX/devdacloud01/selenium-hub",
            "version": "3-5-3-delta"
        }
    ]
}'

manifest:

apiVersion: v1
kind: ConfigMap
metadata:
  name: selenium-${trigger.resolvedExpectedArtifacts[0].boundArtifact.version}