Created
February 19, 2017 17:39
-
-
Save nitinja/47aed999836e2644629cf0347656a47f to your computer and use it in GitHub Desktop.
script to bundle & deploy Javascript apps to remote server using npm
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
#!/bin/bash | |
#Get app version | |
APP_VERSION=$(node -pe "require('./package.json').version") | |
#create a name for your bundle | |
ARCHIVE_NAME='app-name-'$APP_VERSION'.tar.gz' | |
#create an archive | |
tar -czvf $ARCHIVE_NAME -C ./dist . | |
#deploy to server | |
curl -u username:password -X PUT "http://jenkins.myserver.com:8081/artifactory/libs-release-local/com/myserver/myproject/$APP_VERSION/$ARCHIVE_NAME" -T ./$ARCHIVE_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment