snackship

Simple abstractions around deployment

Usage no npm install needed!

<script type="module">
  import snackship from 'https://cdn.skypack.dev/snackship';
</script>

README

snackship

abstractions around production deployment

install

npm install --save-dev snackship

set up

// snackship.js

import { archiveS3, deployS3 } from 'snackship'

export default {
  src: 'src',
  targetBucket: 'production',
  archiveBucket: 'production',
  strategy: async config => {
    try {
      await archiveS3({
        dir: config.src,
        bucket: config.archiveBucket,
        key: `build-${(new Date()).toString().replace(/ /, '_')}.tgz`
      })
      
      await deployS3({
        dir: config.src,
        bucket: config.targetBucket
      })
    } catch (e) {
      console.log(`error: ${e}`)
      throw e
    }
  }
}

run

snackship -c snackship.js