I have an AWS amplify React Native App. For setting up, I am required to run
amplify pull
It asks certain question. As my backend and frontend repository are separated, particularly for option "Do you want to modify this backend", I select "n" while working on React Native app. Now,
I am setting up CI/CD with MS Visual Studio App Center. For each development, I need to set up an automated way to give these values. I have tried setting up custom scripts
**appcenter-post-clone.sh**
#!/usr/bin/env bash
# Amplify config
echo "Initializing Amplify Script from Post Clone"
npm install -g @aws-amplify/cli
amplify pull --appId <app ID> --envName devo
Similarly I have added other scripts. The scripts are not getting executed. At the end of each build, I am getting error that aws-exports.js is generated. It is expected as it is not running.
It will be great if anyone can share solutions and any alternative of doing this? I saw one question in GitHub, but that was unanswered. I want to use App Center for leveraging the CodePush.
Edit 1: I have made some progress based on this Github link.
#!/usr/bin/env bash
npm install -g @aws-amplify/cli
AWSCONFIG="{\
\"configLevel\":\"general\"\
}"
AMPLIFY="{\
\"envName\":\"devo\"\
\"defaultEditor\":\"vscode\"\
}"
#amplify init --amplify ${AMPLIFY} --providers ${PROVIDERS} --codegen ${CODEGEN} --yes
amplify init --amplify ${AMPLIFY} --yes
amplify pull --appId <app id> --envName <env name>
I am still struggling with authentication method in the command prompt in CI/CD.