Skip to content

Frontend Deployment

Sriram Viswanathan edited this page Jun 3, 2023 · 1 revision

Deployment Location on VM012 Bridges Machine

The location of the front-end artifacts after build i.e. the dist folder resides on the VM012 at this location - /data/vue/.

NOTE: Make sure you have the permissions this directory on the VM before proceeding ahead.

How to deploy from local machine ?

  • Check .env file in the vue sub-directory in the cloned repo - make sure you have the following values in there -
VUE_APP_PP_ENDPOINT=https://printprobdb.psc.edu/api
VUE_HOME=https://printprobdb.psc.edu
  • Check deploy.sh file in the vue sub-directory - it should contain -
#!/bin/bash

## Build front end
npm run build

## Either get SSH_USER environment variable for the username or default to 'sviswana' username
export SSH_USER=${SSH_USER:-sviswana}

## Rsync the `dist` directory contents
# Make sure the 'group' gets read/write permissions
# '--perms' is necessary for '--chmod' to work
rsync -avh --recursive --perms --no-times --chmod=Du=rwx,Dg=rwx,Do=rx,Fu=rw,Fg=rw,Fo=r --delete dist/ ${SSH_USER}@vm012.bridges2.psc.edu:/data/vue/

Currently, it defaults to my username (sviswana) but once you have your username and permissions, you should be able to run this by changing the username directly and commiting that to the repo or using the SSH_USER environment variable.

Build and Deploy

Once you are ready with your changes and your .env file is set and the deployment permissions are also right, you can execute ./deploy.sh from the vue sub-directory to deploy - this will clean and re-build the artifacts again.