File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # IMPORTANT: you must be on the master branch before running this script!
4+
5+ # 1. Sets package version
6+ # 2. Commits to master
7+ # 3. Creates new tag and pushes tag
8+ # 4. Publishes to npm
9+ # 5. Builds and pushes docker images
10+
11+ # Change to script directory
12+ cd ` dirname $0 `
13+ sd=` pwd`
14+
15+ version=$1
16+
17+ if [ " ${version} " == " " ]; then
18+ echo " Usage: build.sh version"
19+ exit
20+ fi
21+
22+ # Set package version. Note: -e option required for OSX
23+ # (https://stackoverflow.com/a/19457213/2831606)
24+ sed -i ' ' -e " s/\" version\" : \" [^\" ]*\" /\" version\" : \" ${version} \" /g" $sd /../package.json
25+
26+ # Commit to master
27+ git add -A
28+ git commit -m " chore(version): ${version} "
29+ git push origin master
30+
31+ # Create new tag and push
32+ git tag -a v${version} -m " ${version} "
33+ git push origin --tags
34+
35+ # Publish to npm
36+ cd $sd /..
37+ npm publish
38+
39+ # Build and push new docker images. We use the no-cache option as we want the latest package on npm
40+ # to be used
41+ cd $sd /../docker
42+ docker build --no-cache -t redgeoff/replicate-couchdb-cluster:${version} .
43+ docker tag redgeoff/replicate-couchdb-cluster:${version} redgeoff/replicate-couchdb-cluster:latest
44+ docker push redgeoff/replicate-couchdb-cluster:${version}
45+ docker push redgeoff/replicate-couchdb-cluster:latest
You can’t perform that action at this time.
0 commit comments