This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function to deploy to Heroku | |
.deploy_script: &deploy_script | |
script: | |
- apk update && apk add git && apk add curl | |
- git remote add heroku https://heroku:[email protected]/$APP.git | |
- git push heroku HEAD:master -f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Job to deploy master branch to production environment | |
Deploy to production: | |
stage: deploy_production | |
<<: *deploy_script | |
only: | |
- master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set a base docker image, using node alpine because it is lightweight | |
image: node:10.16.0-alpine | |
# This folder is cached between builds and will speed up subsequent build | |
cache: | |
paths: | |
- node_modules/ | |
# Function to deploy to Heroku | |
.deploy_script: &deploy_script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { createLogger, format, transports } = require('winston'); | |
const { combine, timestamp, printf} = format; | |
const { Worker, isMainThread } = require('worker_threads'); | |
const logFormat = printf(({ level, message, timestamp }) => { | |
return `{ "Date": "${timestamp}", "level": "${level.toUpperCase()}", "message": "${message}" }`; | |
}); | |
class Logger { | |
log(message, logType=null) { |
OlderNewer