Skip to content

Instantly share code, notes, and snippets.

# SETUP #
DOMAIN=example.com
PROJECT_REPO="git@github.com:example.com/app.git"
AMOUNT_KEEP_RELEASES=5
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S)
RELEASES_DIRECTORY=~/$DOMAIN/releases
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME
# stop script on error signal (-e) and undefined variables (-u)
@postb99
postb99 / gist:a2f38c9352790ae0ff0d2f4977cbf23e
Created April 17, 2018 10:49
Add adal token renewal to App startup
export default Vue.extend({
name: 'app',
created: function() {
// Add an utility method to check token on startup
// because the necessary renewal when expired etc isn't handled for now by vue-adal package.
// (see a comment in https://github.com/survirtual/vue-adal/issues/2).
const resource = AuthenticationContext.config.clientId
AuthenticationContext.acquireToken(resource, (err: any, token: any) => {
if (err) {
let errCode = err.split(':')[0]