Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
task('deploy:devapp', ['stage-deploy:devapp'], () => {
return firebaseTools.deploy({cwd: projectDir, only: 'hosting'})
// Firebase tools opens a persistent websocket connection and the process will never exit.
.then(() => {
console.log('Successfully deployed the dev-app to firebase');
process.exit(0);
})
.catch((err: any) => {
console.log(err);
process.exit(1);
});
});
task('deploy:devapp', ['stage-deploy:devapp'], () => {
return firebaseTools.deploy({cwd: projectDir, only: 'hosting'})
// Firebase tools opens a persistent websocket connection and the process will never exit.
.then(() => { console.log('Successfully deployed the demo-app to firebase'); process.exit(0); })
.catch((err: any) => { console.log(err); process.exit(1); });
});
task('deploy:devapp', ['stage-deploy:devapp'], () => {
return (
firebaseTools
.deploy({ cwd: projectDir, only: 'hosting' })
// Firebase tools opens a persistent websocket connection and the process will never exit.
.then(() => {
console.log('Successfully deployed the demo-app to firebase');
process.exit(0);
})
.catch((err: any) => {
console.log(err);
process.exit(1);
})
);
});
task('deploy:devapp', ['stage-deploy:devapp'], () => {
return firebaseTools.deploy({cwd: projectDir, only: 'hosting'})
// Firebase tools opens a persistent websocket connection and the process will never exit.
.then(() => { console.log('Successfully deployed the demo-app to firebase'); process.exit(0); })
.catch((err: any) => { console.log(err); process.exit(1); });
});
deploy(firebaseName, projectDirName) {
console.log('Forging 🔨, please wait...');
client.deploy({
project: firebaseName,
token: process.env.FIREBASE_TOKEN,
cwd: process.cwd()
}).then(() => {
console.log(`${projectDirName} has been deployed at: https://${firebaseName}.firebaseapp.com 😊`);
opn(`https://${firebaseName}.firebaseapp.com`);
process.exit();
}).catch((err) => {
console.log(`Unable to deploy 😔. Please make sure that the firebase project name you entered (${firebaseName}) matches your firebase project name at https://console.firebase.google.com --- Error: ${err}`);
});
},
};
gulp.task(function deploy(done) {
const TOKEN = process.env.FIREBASE_TOKEN || env.token;
if (!TOKEN) {
return done(new Error('No FIREBASE_TOKEN found in env or --token option passed.'));
}
log('Starting Firebase deployment ...');
firebase.deploy({token: TOKEN}).then(
() => {
log(colors.green('Deployment successful'));
done();
process.exit();
},
(error) => {
done(error);
process.exit(1);
});
});
export async function deploy(token: string) {
try {
return await client.deploy({
project: 'hnpwa-coffee',
only: 'hosting',
token,
cwd: process.cwd()
});
} catch (e) {
throw e;
}
}