Skip to content

Instantly share code, notes, and snippets.

@nitinja nitinja/deploy.sh
Created Feb 19, 2017

Embed
What would you like to do?
script to bundle & deploy Javascript apps to remote server using npm
#!/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
You can’t perform that action at this time.