This is a basic general-purpose ReactNative/Android command line build script.
It is intended to be deployed to CodeShip for CI builds of a ReactNative app.
Will install dependencies for and compile the Android version of your ReactNative app.
Does not run tests or create an apk. Could be edited to do that.
There's an .nvmrc
set to default to node version 6.5.0
. Change it accordingly.
If it's not present you should add a link
npm script to your package.json
, like so:
//...
"scripts": {
//...
"link": "node node_modules/react-native/local-cli/cli.js link"
}
Setup a new CodeShip build.
Add codeship-install-android.sh
to your repository at the root.
Edit the variables in codeship-install-android.sh
to make sure you're using the right sdk/tools/api versions for your app.
Paste the contents of codeship-build.sh
into the test setup step in CodeShip. Your setup should now look something like this:
jdk_switcher use oraclejdk8
source ./codeship-install-android.sh
nvm use || nvm install
npm install --ignore-scripts
npm run link
cd android
touch local.properties
echo "sdk.dir=$ANDROID_HOME" >> local.properties
./gradlew assembleDebug
Thanks to Jonathan Muller and Bogdan Gradinariu for the gruntwork.