Hello,
i have added Environment-Variables on Account Level and on the Repository Level. One Command of my pipeline is this:
- curl -X PUT -d 'data={"keys":{"android":{"id":"$PHONEGAP_ANDROID_CERT_ID","key_pw":"$PHONEGAP_ANDROID_KEY_PASSWORD","keystore_pw":"$PHONEGAP_ANDROID_KEYSTORE_PASSWORD"},"ios":{"id":"$PHONEGAP_IOS_CERT_ID","password":"$PHONEGAP_IOS_CERT_PASSWORD"}}}' https://build.phonegap.com/api/v1/apps/$PHONEGAP_APP_ID?auth_token=$PHONEGAP_AUTH_TOKEN
As you can see there are multiple environment variables that should be injected to the JSON payload. But unfortunately this isn't working for me. What i am doing wrong?
Response from the PhoneGap Build Server after this request was sent:
{"error":"android key $PHONEGAP_ANDROID_CERT_ID not found (maybe wrong platform?)"}
This is the also first parameter from the Payload which hints that there is a general problem in this command with resolving the variables.
I found the solution by my own. It was a general thing with handling variables in a shell script.
- curl -X PUT -d 'data={"keys":{"android":{"id":"'$PHONEGAP_ANDROID_CERT_ID'","key_pw":"'$PHONEGAP_ANDROID_KEY_PASSWORD'","keystore_pw":"'$PHONEGAP_ANDROID_KEYSTORE_PASSWORD'"},"ios":{"id":"'$PHONEGAP_IOS_CERT_ID'","password":"'$PHONEGAP_IOS_CERT_PASSWORD'"}}}' https://build.phonegap.com/api/v1/apps/${PHONEGAP_APP_ID}?auth_token=${PHONEGAP_AUTH_TOKEN}
Good catch, I was also searching how to use the variables for a curl command
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Be mindful: because this is YAML you can't have spaces after ':' characters or the YAML parser will choke. Watch for the error message: Bad indentation of a sequence entry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.