I’ve hit an impass with Ionic Pro’s build process. I’ve followed the official doc, I think, to the letter:
- The build environment is using @ionic/app-scripts@3.2.0
- The src/declarations.d.ts file has been created as per the official doc
- In the app there is a switch statement starting
switch (process.env.CI_GIT_REF) {
- Deploy is successfully building via a git repository branch on GitHub and automatically assigning it to a ‘Demo’ channel.
- I have run
cordova plugin add cordova-plugin-ionic --save --variable APP_ID="XXXXXXXX" --variable CHANNEL_NAME="Demo" --variable UPDATE_METHOD="background"
(substituting the correct APP_ID)
But when I close the app on an iOS device and open it up again (haven’t tried Android yet), process.env.CI_GIT_REF
is always undefined
. I’d expect to see the branch name that Ionic Pro’s Deploy build injects. If I JSON.stringify()
the process
object on the iOS device I get the following:
{
"title": "browser",
"browser": true,
"env": {},
"argv": [],
"version": "",
"versions": {}
}
The app never updates to a later build on the channel. Even though Ionic Pro’s Monitoring is working! The app shows no error messages to suggest anything is wrong.
Have I missed something about how Ionic Pro’s Deploy build injects the environment variables? Is there typically a long delay before a build will be picked up after an app restart on the device? I’ve tried waiting for several hours.