-
Notifications
You must be signed in to change notification settings - Fork 0
/
.jiffy-aliases##os.Linux
94 lines (77 loc) · 2.32 KB
/
.jiffy-aliases##os.Linux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Function jd_attach() {
overmind connect $1
}
function run_rubo_bc() {
git ls-files -m | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec rubocop
}
function run_rubo_ac() {
git diff-tree -r --no-commit-id --name-only head origin/master | xargs bundle exec rubocop
}
# Running Feature specs
function jd_fspec() {
spec_file=${1:-""}
mobile_only=${2:-"FEATURES_DESKTOP=yes"}
FEATURES_HEADED=yes FEATURES_RESKINNED=yes $mobile_only bin/scripts/run_features.sh $spec_file
}
# Running Migrations/Rollbacks
# Running ROllback
function run_rollback() {
echo "Running Rollback for Dev Environment"
bundle exec rails db:rollback
echo "Running Rollback for Test Environment"
bundle exec rails db:rollback RAILS_ENV=test
}
# Running Migrations
function run_migrations() {
checkout_changes=true
if git status --porcelain | grep db/; then
checkout_changes=false
fi
echo "Running Migrations for Dev Environment"
bundle exec rails db:migrate
echo "Now Running migrations for Test Env"
bundle exec rails db:migrate RAILS_ENV=test
if $checkout_changes; then
echo "checking out db/structure.sql changes"
git co db/structure.sql
else
echo "not checking out structure file changes as we have added migrations"
fi
}
# build, upload and deploy to stack mentioned in argument
# Build Upload and Deploy
function jd_deploy() {
if [ -f ".overmind.sock" ]; then
echo "Stopping containers for deploy"
overmind quit
fi
source ~/.jiffy-deploy-env
echo " delete hard sources"
rm -rf node_modules/.cache/hard-source
echo "start deploy"
AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
AWS_REGION=$AWS_REGION \
DEPLOY_BUCKET=$DEPLOY_BUCKET \
./bin/deploy.sh $1
# echo "Running yarn install"
# yarn install
# echo "Starting containers back up"
# overmind start -D
}
alias jd_be="bundle exec"
alias be="bundle exec"
alias jd_bi="bundle"
alias bi="bundle"
alias jd_rails_c="bundle exec rails c"
alias rc="bundle exec rails c"
alias jd_rspec"rspec"
alias jd_rubo="run_rubo_bc"
alias jd_rubo_ac="run_rubo_ac"
alias jd_migrate="run_migrations"
alias jd_rollback="run_rollback"
alias ostart="overmind start -D"
alias oatt="overmind connect web"
alias oquit="overmind quit"
alias orem="rm -rf .overmind.sock"
alias otail="tail -f log/development.log"