forked from Joystream/joystream
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/user/bin/env bash | ||
# Copyright 2017-2020 @polkadot/apps authors & contributors | ||
# This software may be modified and distributed under the terms | ||
# of the Apache-2.0 license. See the LICENSE file for details. | ||
|
||
# fail fast on any non-zero exits | ||
set -e | ||
|
||
# the docker image name and dockerhub repo | ||
NAME="polkadot-js-apps" | ||
REPO="jacogr" | ||
|
||
# extract the current npm version from package.json | ||
VERSION=$(cat package.json \ | ||
| grep version \ | ||
| head -1 \ | ||
| awk -F: '{ print $2 }' \ | ||
| sed 's/[",]//g' \ | ||
| sed 's/ //g') | ||
|
||
# helper function for the build logic | ||
function build () { | ||
echo "*** Building $NAME" | ||
docker build -t $NAME . | ||
} | ||
|
||
# helper function for the publishing logic | ||
function publish () { | ||
docker login -u $REPO -p $DOCKER_PASS | ||
|
||
echo "*** Tagging $REPO/$NAME" | ||
docker tag $NAME $REPO/$NAME:$VERSION | ||
docker tag $NAME $REPO/$NAME | ||
|
||
echo "*** Publishing $NAME" | ||
docker push $REPO/$NAME | ||
} | ||
|
||
build | ||
publish |