1.0.9 • Published 4 years ago

@kekalma/dist-upload v1.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

dist-upload

Script for AWS S3 bucket upload from the distribution folder (linux version)

Latest release version: 1.1.2

Syntax:   dist-upload   optional params

optionargumentdescription
-cconfigFileThe name of the config file to save (-w) or use. aws.distconfig
-wConfig file write mode, for creating configuration(s).
-pprofileNameSets the AWS profile name. default
-rregionNameSets the AWS region name for the profile. us-east-1
-aaccessKeySets the AWS IAM user's access_key for the profile.
-ssecretKeySets the AWS IAM user's secret_access_key for the profile.
-gtrue | falseShould the name of the config file be added to .gitignore file.
-ddistDirectorySets the distribution directory. dist
-bbucketNameSets the AWS S3 bucket name in config.
-ibucketName | offSets the AWS S3 bucket name for incremental release backup in config.
-RRollback (undo) release: Rolls back the code to previsous state, deleting the last release.
-mversionLimitThe maximum number of versions kept in the bucket. Older will be deleted.
-fbranchFolderThe folder for automated version storage. You can store different branches this way.
-ltailNumberLists optionaly the last n number of the release versions in the incremental backup bucket.
-yAnswers default option to the config questions. Hint: use for changing only the given params.
-SSilent mode. Hides all the information about the process.

 

Examples

To configure the system, as the first step:

dist-upload -w

The script will ask all the setup parameters and save it to the default config file. Creating a special config file (for example for staging):

dist-upload -c myTestConfig -w

This will create a config file 'myTestconfig', which can be used for alternative uploads. Sending this complete startup setup along with the webpack config to the team:

dist-upload -w -d dist  -b ourProdBucket -i ourProdBackup -m 5
dist-upload -w -d build -b ourTestBucket -i off -c stage

The script will ask for the personal AWS access keys. Hint: Place the above into the package.json under the 'scripts' like this: "init" : "dist-upload -w dist ..." Updating the config file, changing ONLY the given params (In this example switching off the backup and changing the region):

dist-upload -c myConfig -w -y -i off -r eu-west-1

  Uploading the folder 'test_build' (other than the folder set in config) in silent mode, while using the branch name 'stage':

dist-upload -d test_build -S -f stage

  Listing the backup folder content, but only the last 3 versions:

dist-upload -l 3

  Uploading the dist folder (as set in the config) by leaving only 5 older versions alive, without status messages:

dist-upload -m 5 -S

Any older versions above the number, will be deleted. Uploading to the previously configured staging area:

dist-upload -c stage

 

Written by: Attila Kiss, e-LET Kft, Hungary ( GitHub: kissato70 )

Licence: MIT

1.0.9

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago