Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaltrushaitis committed Feb 26, 2020
2 parents 8f405ad + 7c0940a commit 38ab9c0
Show file tree
Hide file tree
Showing 35 changed files with 3,294 additions and 1,861 deletions.
25 changes: 19 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<a href="https://github.com/tbaltrushaitis/cv/releases"><img src="https://img.shields.io/github/release/tbaltrushaitis/cv.svg?style=flat" alt="GitHub release" /></a>
<a href="https://github.com/tbaltrushaitis/cv/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat" alt="License" /></a>
<img src="https://img.shields.io/david/tbaltrushaitis/cv.svg" alt="Dependencies" />
<img src="https://img.shields.io/david/dev/tbaltrushaitis/cv.svg" alt="Dev Dependencies" />
</p>

<p align="center">
Expand Down Expand Up @@ -32,23 +31,37 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
<!-- ##### Fixed: ##### -->
<!-- ##### Removed: ##### -->

---
<!-- --- -->

<!-- ## [Unreleased] - Current ## -->
<!-- ## [v0.2.5](Unreleased) - Current ## -->

---

## [v0.2.4](Unreleased) - Current ##
## [v0.2.4](https://github.com/tbaltrushaitis/cv/tree/v0.2.4) - 2020-02-26 ##

### Added ###
- [x] manifest.json
- [x] `Gray` color for console logging
- [x] `GraphQL` to skills list
- [x] Vhost configuration for **nginx**
- [x] `Bootstrap` brand color for `fa-*` icons

### Changed ###
- [x] bower i --save-dev [email protected]
- [x] Small improvements in biography section
- [x] Small improvemnts in employment history cards when rendering in mobile
- [x] Improved Clean operations in Make
- [x] Timestamp format to just time instead of .toLocaleTimeString() for console messages
- [x] Small improvements in employment history cards when rendering in mobile
- [x] Improved `Clean` operations in Makefile
- [x] Timestamp format to show only time instead of `.toLocaleTimeString()` for console messages
- [x] npm i --save-dev [email protected]
- [x] npm i --save-dev [email protected]
- [x] npm i --save-dev [email protected]
- [x] npm i --save-dev [email protected] [email protected]
- [x] npm i --save-dev [email protected]
- [x] npm i --save-dev [email protected]
- [x] npm i --save-dev [email protected]
- [x] npm i --save-dev [email protected]
- [x] bower i --save [email protected]

### Fixed ###
- [x] lodash.template [CVE-2019-10744](https://github.com/lodash/lodash/pull/4336) vulnerability
Expand Down
173 changes: 125 additions & 48 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,44 @@
## ------------------------------------------------------------------------ ##

.SILENT:
# .IGNORE:
.EXPORT_ALL_VARIABLES:
.IGNORE:
.ONESHELL:

SHELL = /bin/sh
THIS_FILE := $(lastword $(MAKEFILE_LIST))
TO_NULL = 2>&1 >/dev/null

# $(info [THIS_FILE:${THIS_FILE}])
## ------------------------------------------------------------------------ ##
$(shell [ -f NODE_ENV ] || cp -prfu config/.NODE_ENV ./NODE_ENV);
# $(shell [ -f NODE_ENV ] || cp -prfu config/.NODE_ENV ./NODE_ENV);
## ------------------------------------------------------------------------ ##

## ------------------------------------------------------------------------ ##
# $(shell [ -f NODE_ENV ] || cp -prfu config/.NODE_ENV ./NODE_ENV);
$(shell [ -f .bowerrc ] || cp -prfu config/.bowerrc ./);
$(shell [ -f .npmrc ] || cp -prfu config/.npmrc ./);
## ------------------------------------------------------------------------ ##

APP_NAME := cv
APP_SLOG := CV+PORTFOLIO
APP_PREF := cv_
APP_SLOG := "CV + PORTFOLIO"
APP_LOGO := ./assets/BANNER
APP_REPO := $(shell git ls-remote --get-url)

CODE_VERSION := $(shell cat ./VERSION)
$(shell [ -f ./VERSION ] || echo "0.0.0" > VERSION)
$(shell [ -f ./.env ] || echo "NODE_ENV=production" >> .env)

CODE_VERSION := $(strip $(shell cat ./VERSION))
GIT_BRANCH := $(shell git rev-list --remove-empty --max-count=1 --reverse --branches)
GIT_COMMIT := $(shell git rev-list --remove-empty --max-count=1 --reverse --remotes --date-order)

WD := $(shell pwd -P)
DT = $(shell date +'%Y-%m-%dT%H:%M:%S%:z')
TS = $(shell date +'%T')

# $(shell [ -f .env ] && source .env || echo test)
DT = $(shell date +'%T')
TS = $(shell date +'%s')
DZ = $(shell date +'%Y%m%dT%H%M%S%:z')

APP_ENV := $(strip $(shell [ -f .env ] && cat .env || (touch .env && echo "TOUCHED FILE: [.env]")))
APP_ENV := $(strip $(shell [ -f NODE_ENV ] && cat NODE_ENV || cat config/.NODE_ENV))
ifeq ($(APP_ENV),)
$(info [$(White)$(TS)$(NC)] APP_ENV is NOT DETECTED!)
endif
WD := $(shell pwd -P)
BD := $(WD)/bin

BUILD_FILE = BUILD-$(CODE_VERSION)
BUILD_CNTR = $(strip $(shell [ -f "$(BUILD_FILE)" ] && cat $(BUILD_FILE) || echo 0))
Expand All @@ -49,16 +53,26 @@ BUILD_YEAR := $(shell date +'%Y')
BUILD_HASH := $(shell echo "$(BUILD_FULL)" | md5sum | cut -b -4)

## ------------------------------------------------------------------------ ##
## Colors definitions
## Colors definition
## ------------------------------------------------------------------------ ##

include $(BD)/Colors

## ------------------------------------------------------------------------ ##

include bin/Colors
DAT = [$(Gray)$(DT)$(NC)]
BEGIN = $(Yellow)$(On_Blue)BEGIN TARGET$(NC)
DONE = $(Yellow)$(On_Blue)DONE TARGET$(NC)
FINE = $(Yellow)$(On_Green)FINISHED GOAL$(NC)
TARG = [$(Orange) $@ $(NC)]
THIS = [$(Red) $(THIS_FILE) $(NC)]
OKAY = [$(White) OK $(NC)]

## ------------------------------------------------------------------------ ##
## BUILDs counter
## ------------------------------------------------------------------------ ##
$(file > $(BUILD_FILE),$(BUILD_CNTR))
$(info [$(White)$(TS)$(NC)] Created file [$(Yellow)$(BUILD_FILE)$(NC):$(Purple)$(BUILD_CNTR)$(NC)])
$(info $(DAT) Created file [$(Yellow)$(BUILD_FILE)$(NC):$(Red)$(BUILD_CNTR)$(NC)])

## ------------------------------------------------------------------------ ##
## BUILD information
Expand All @@ -74,13 +88,14 @@ BUILD_CONTENT := $(subst GIT_COMMIT,$(GIT_COMMIT),$(BUILD_CONTENT))
BUILD_CONTENT := $(subst CODE_VERSION,$(CODE_VERSION),$(BUILD_CONTENT))

$(file > config/build.json,$(BUILD_CONTENT))
$(info [$(White)$(TS)$(NC)] Created file [$(Yellow)BUILD_CONTENT$(NC):$(Purple)$(WD)/config/build.json$(NC)])
$(info $(DAT) Created file [$(Yellow)BUILD_CONTENT$(NC):$(White)$(WD)/config/build.json$(NC)])


## ------------------------------------------------------------------------ ##
## COMMIT information
## ------------------------------------------------------------------------ ##
$(file > COMMIT,$(GIT_COMMIT));
$(info [$(White)$(TS)$(NC)] Created file [$(BYellow)COMMIT$(NC):$(BPurple)$(GIT_COMMIT)$(NC)]);
$(info $(DAT) Created file [$(BYellow)COMMIT$(NC):$(White)$(GIT_COMMIT)$(NC)]);

## ------------------------------------------------------------------------ ##
## DIRECTORIES ##
Expand All @@ -90,7 +105,7 @@ ARC := arch
SRC := src
BLD := build-${CODE_VERSION}
DST := dist-${CODE_VERSION}
WEB := webroot
WEB := web-${CODE_VERSION}-${BUILD_CNTR}

$(shell [ -d $(ARC) ] || mkdir $(ARC))

Expand All @@ -103,107 +118,169 @@ DIR_BUILD := $(WD)/$(BLD)
DIR_DIST := $(WD)/$(DST)
DIR_WEB := $(WD)/$(WEB)

$(shell [ -d $(DIR_SRC) ] || mkdir $(DIR_SRC))
$(shell [ -d $(DIR_BUILD) ] || mkdir $(DIR_BUILD))
$(shell [ -d $(DIR_DIST) ] || mkdir $(DIR_DIST))
$(shell [ -d $(DIR_WEB) ] || mkdir $(DIR_WEB))

## ------------------------------------------------------------------------ ##

APP_ENV := $(shell grep NODE_ENV .env | cut -d "=" -f 2)
ifeq ($(APP_ENV),)
$(info $(DAT) $(Orange)APP_ENV$(NC) is $(Yellow)$(On_Red)NOT DETECTED$(NC)!)
endif

## ------------------------------------------------------------------------ ##
## Query default goal.
## Query default goal
## ------------------------------------------------------------------------ ##
ifeq ($(.DEFAULT_GOAL),)
.DEFAULT_GOAL := default
endif
$(info [$(White)$(TS)$(NC)] Goal [$(Yellow)DEFAULT$(NC):$(Cyan)$(.DEFAULT_GOAL)$(NC)]);
$(info [$(White)$(TS)$(NC)] Goal [$(Yellow)CURRENT$(NC):$(Cyan)$(MAKECMDGOALS)$(NC)]);
$(info $(DAT) $(Yellow)$(On_Purple)GOALS$(NC));
$(info $(DAT) \-- $(Orange)DEFAULT$(NC): [$(White)$(.DEFAULT_GOAL)$(NC)]);
$(info $(DAT) \-- $(Orange)CURRENT$(NC): [$(Blue)$(MAKECMDGOALS)$(NC)]);

## ------------------------------------------------------------------------ ##
## INCLUDES ##
## ------------------------------------------------------------------------ ##

include ./bin/*.mk
include $(BD)/*.mk

## ------------------------------------------------------------------------ ##

.PHONY: default

default: run ;
@ echo "$(DAT) $(FINE): $(TARG)" ;

## ------------------------------------------------------------------------ ##

.PHONY: test config tasklist tasktree
.PHONY: test config

test: banner state help ;
@ export NODE_ENV="${APP_ENV}"; npm run test
@ echo "$(DAT) $(FINE): $(TARG)"

config:
@ export NODE_ENV="${APP_ENV}"; npm run config
@ echo "$(DAT) $(FINE): $(TARG)"

# critical:
# @ export NODE_ENV="${APP_ENV}"; npm run crit
## ------------------------------------------------------------------------ ##

.PHONY: tasklist tasktree critical

tasklist:
@ gulp --tasks --depth 1 --color
@ echo "$(DAT) $(FINE): $(TARG)"

tasktree:
@ gulp --tasks --depth 2 --color
@ echo "$(DAT) $(FINE): $(TARG)"

# critical:
# @ export NODE_ENV="${APP_ENV}"; npm run crit
# @ echo "$(DAT) $(FINE): $(TARG)"

## ------------------------------------------------------------------------ ##

.PHONY: build dist deploy pre-update update
# .PHONY: build dist deploy pre-update update
.PHONY: pre-update update

setup-deps: banner ;
@ npm i -g bower
@ npm i
@ bower i --production
@ touch ./setup-deps
@ echo "$(DAT) $(FINE): $(TARG)"

setup: setup-deps ;
@ touch setup
@ touch ./setup
@ echo "$(DAT) $(FINE): $(TARG)"

setup-deps:
@ npm i -g bower ;
@ npm i ;
@ bower i --production ;
@ touch setup-deps
pre-build: banner ;
@ rm -vf build
@ echo "$(DAT) $(FINE): $(TARG)"

build:
build: setup ;
@ export NODE_ENV="${APP_ENV}"; npm run build
@ touch ./build
@ echo "$(DAT) $(FINE): $(TARG)"

dist:
@ export NODE_ENV="production"; npm run build
dist: build ;
@ export NODE_ENV="production"; npm run dist
# @ cp -pr ${BLD}/* ${DST}/
@ rm -rf ${DST}/resources
@ tar -c "${DST}" | gzip -9 > "${ARC}/${APP_NAME}-v${CODE_VERSION}-b${BUILD_CNTR}.tar.gz"
@ touch ./dist
@ echo "$(DAT) $(FINE): $(TARG)"

pre-deploy: banner ;
@ rm -vf deploy
@ echo "$(DAT) $(FINE): $(TARG)"

deploy:
@ export NODE_ENV="${APP_ENV}"; npm run deploy
deploy: dist ;
# @ export NODE_ENV="${APP_ENV}"; npm run deploy
@ cp -pr ${DST}/* ${WEB}/
@ cd ${WD} && rm -vf webroot
@ ln -s ${WEB} webroot
@ touch ./deploy
@ echo "$(DAT) $(FINE): $(TARG)"

pre-update:
@ rm -f setup setup-deps ;
pre-update: banner ;
@ rm -vf setup setup-deps ;
@ echo "$(DAT) $(FINE): $(TARG)"

update: pre-update setup ;
@ echo "$(DAT) $(FINE): $(TARG)"

## ------------------------------------------------------------------------ ##

.PHONY: rebuild redeploy rb rd

rebuild: build ;
redeploy: rebuild deploy banner ;
rebuild: pre-build build ;
@ echo "$(DAT) $(FINE): $(TARG)"

redeploy: pre-deploy rebuild deploy ;
@ echo "$(DAT) $(FINE): $(TARG)"

rb: rebuild ;
@ echo "$(DAT) $(FINE): $(TARG)"

rd: redeploy ;
@ echo "$(DAT) $(FINE): $(TARG)"


## ------------------------------------------------------------------------ ##

.PHONY: all full cycle cycle-dev dev run watch
.PHONY: all full cycle cycle-dev dev dev-setup run watch
#* means the word "all" doesn't represent a file name in this Makefile;
#* means the Makefile has nothing to do with a file called "all" in the same directory.

all: clean cycle banner ;
@ echo "$(DAT) $(FINE): $(TARG)"

full: clean-all all banner ;
@ echo "$(DAT) $(FINE): $(TARG)"

cycle: setup build deploy ;
cycle-dev: build deploy ;
@ echo "$(DAT) $(FINE): $(TARG)"

cycle-dev: rd ;
@ echo "$(DAT) $(FINE): $(TARG)"

dev: clean banner cycle-dev ;
@ export NODE_ENV="${APP_ENV}"; npm run dev ;
dev: clean-dev banner cycle-dev ;
@ export NODE_ENV="${APP_ENV}"; npm run dev
@ echo "$(DAT) $(FINE): $(TARG)"

dev-setup: clean-deps setup banner cycle-dev ;
@ export NODE_ENV="${APP_ENV}"; npm run dev ;
@ export NODE_ENV="${APP_ENV}"; npm run dev
@ echo "$(DAT) $(FINE): $(TARG)"

run: banner help cycle dist banner ;
@ echo "$(DAT) $(FINE): $(TARG)"

watch:
@ export NODE_ENV="${APP_ENV}"; npm run watch
@ echo "$(DAT) $(FINE): $(TARG)"

## ------------------------------------------------------------------------ ##
Loading

0 comments on commit 38ab9c0

Please sign in to comment.