Created
October 20, 2016 07:09
-
-
Save iegik/e181ddbad5bbce8bf3d1040e2258491a to your computer and use it in GitHub Desktop.
Deployment with make
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
DIR_STATIC = app_static | |
DIR_TDP = tdp.ru/v02 | |
DIR_CART = cart-module | |
# Help | |
# https://gist.github.com/prwhite/8168133 | |
help: ## Show this help. | |
@echo "\ | |
Release workflow\n\ | |
1. Build in local branch or milestone\n\ | |
2. Test on Alpha\n\ | |
3. Build in develop branch\n\ | |
4. Test on Beta\n\ | |
5. Lock build with hashes\n\ | |
6. Release on Prod\n\ | |
\n\ | |
Hotfixes workflow\n\ | |
1. Test on Beta\n\ | |
2. Lock build with hashes (postfix)\n\ | |
3. Release on Prod\n\ | |
\n\ | |
Usage: make [options] [target] ...\n\ | |
Targets:"; \ | |
fgrep -h '##' Makefile | awk -F'##|:' '{printf "%40s %s\n", $$1, $$3}' | fgrep -v 'fgrep' | |
##: Tdp | |
tdp_checkout: # Update develop | |
@cd $(DIR_STATIC)/$(DIR_TDP); \ | |
git reset --hard; \ | |
git checkout develop; \ | |
git pull origin develop; \ | |
tdp_checkout_beta: # Update Beta | |
@cd "$(DIR_STATIC)/$(DIR_TDP)"; \ | |
git reset --hard; \ | |
git checkout beta; \ | |
git pull origin beta; \ | |
tdp_build: # Build | |
make -C $(DIR_STATIC)/$(DIR_TDP) build; \ | |
tdp_test: | |
@cd $(DIR_STATIC)/$(DIR_TDP) ; \ | |
git status | |
tdp_beta: # Commit changes to branch develop for Beta | |
@cd $(DIR_STATIC)/$(DIR_TDP); \ | |
git add build/; \ | |
git commit -m "Build for Beta"; \ | |
git push origin develop; \ | |
tdp_beta_hotfix: # Commit changes to branch beta for Beta | |
@cd "$(DIR_STATIC)/$(DIR_TDP)"; \ | |
git add build/; \ | |
git commit -m "Hotfix Build"; \ | |
git push origin beta; \ | |
tdp_clean: # Clean | |
@make -C $(DIR_STATIC)/$(DIR_TDP) clean; | |
tdp_rev: # Lock build with hashes | |
@make -C $(DIR_STATIC)/$(DIR_TDP) gulp:rev; | |
tdp_prod: # Commit changes for Prod | |
@cd $(DIR_STATIC)/$(DIR_TDP); \ | |
git add build/; \ | |
git commit -m "Build for Prod"; \ | |
git push origin develop; \ | |
static_build: tdp_clean tdp_checkout tdp_build ## Update and build tdp.ru static (develop) | |
static_build_hotfix: tdp_clean tdp_checkout_beta tdp_build ## Update and build tdp.ru static (beta) | |
static_beta: tdp_beta ## Push tdp.ru static (develop) | |
#static_hotfix: tdp_beta_hotfix ## Push tdp.ru static (beta) | |
static_status: tdp_test | |
static_prod: tdp_rev tdp_prod ## Lock (develop) build with hashes for production | |
static_hotfix: tdp_rev tdp_beta_hotfix ## Lock (beta) build with hashes for production hotfix | |
##: Cart | |
module_cart_checkout: # Update develop | |
@cd $(DIR_CART); \ | |
git reset --hard; \ | |
git checkout develop; \ | |
git pull origin develop; \ | |
module_cart_build: # Build | |
make -C $(DIR_CART) build; \ | |
module_cart_prod: # Commit changes to branch develop for Prod | |
@cd "$(DIR_CART)"; \ | |
git add build/; \ | |
git commit -m "Build"; \ | |
git push origin develop; \ | |
module_build: module_cart_checkout module_cart_build module_cart_build ## Update and build cart module (develop) | |
module_prod: module_cart_prod ## Push cart module (develop) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment