Skip to content

Instantly share code, notes, and snippets.

@love8587
Created February 3, 2020 07:37
Show Gist options
  • Select an option

  • Save love8587/2272c7b241ab99fe88cd797de593f6b0 to your computer and use it in GitHub Desktop.

Select an option

Save love8587/2272c7b241ab99fe88cd797de593f6b0 to your computer and use it in GitHub Desktop.
react native CI/CD - versioning automation increment whenever app release
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:10.16.0
definitions:
after-script: &merge-to-staging-with-versionup
- apt-get update -y
- apt-get install -y git
- git fetch --unshallow
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin
- git checkout --track origin/staging
- git merge $BITBUCKET_BRANCH -m "Automated Merge by pipelines branch '$BITBUCKET_BRANCH' into 'staging' [SKIP CI]"
- npm version patch
- npm run react-native-version
- git status
- git push origin
- git push origin --tags
pipelines:
branches:
master:
- step:
name: npm version and app-version increment
caches:
- node
script:
- npm install
after-script: *merge-to-staging-with-versionup
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"pod": "cd ios && pod install --repo-update && cd ..",
"postuninstall": "npm run pod",
"prepare": "npm run pod",
"start": "react-native start",
"test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint-fix": "npm run lint -- --fix",
"react-native-version": "react-native-version"
}
@love8587
Copy link
Author

love8587 commented Feb 3, 2020

@stovmascript
Copy link

Can you also show your "dependencies" and "devDependencies" in package.json?

@love8587
Copy link
Author

love8587 commented Feb 3, 2020

@stovmascript I think that's not necessary. let me know why you need that. That's not hard to share of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment