-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc-work
80 lines (65 loc) · 2.33 KB
/
zshrc-work
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
# GPG setup to launch agent at start.
export GPG_TTY=$(tty)
gpgconf --launch gpg-agent
# Debugging
# See https://gist.github.com/carlwiedemann/ac9d1c8f58801a9e160ff1b44f16ae39
# Add this file to global gitignore
# # git config --global core.excludesfile ~/.gitignore
function bringdd {
cp ~/_src/_dd.rb config/initializers
}
# Load config variables from files.
function catconfig {
cat ~/.config/$1 | tr -d "\n"
}
# Kubernetes
alias k="kubectl"
# Teleport
export TELEPORT_PROXY="heimdallr.checkrhq.net"
export TELEPORT_AUTH="gitlab"
export TSH_USER=carl.wiedemann
# Gitlab
export GITLAB_PAT=$(catconfig GITLAB_PAT)
export GITLAB_CI_TOKEN=$GITLAB_PAT
# Login to container registry so that Docker can pull images
function checkr_docker_login {
echo ${GITLAB_PAT} | docker login -u${USER} gitlab-registry.checkrhq.net --password-stdin
echo ${ARTIFACTORY_DOCKER_TOKEN} | docker login -u ${ARTIFACTORY_USER} docker.arti.checkrhq.net --password-stdin
}
# Ruby gems & gemfury
export RUBYGEMS_API_KEY=$(catconfig RUBYGEMS_API_KEY)
export BUNDLE_GEM__FURY__IO=$(catconfig BUNDLE_GEM__FURY__IO)
export GEM_FURY_PUSH_TOKEN=$(catconfig GEM_FURY_PUSH_TOKEN)
# Artifactory
export ARTIFACTORY_USER=$(catconfig ARTIFACTORY_USER)
export ARTIFACTORY_DOCKER_TOKEN=$(catconfig ARTIFACTORY_DOCKER_TOKEN)
export BUNDLE_ARTI__CHECKRHQ__NET="$(echo $ARTIFACTORY_USER | sed 's/@/%40/'):$ARTIFACTORY_DOCKER_TOKEN"
# Open a merge request
function mr {
BRANCH=$(git rev-parse --abbrev-ref HEAD)
REPO=$(basename $PWD)
GROUP=$(git remote get-url origin | cut -d : -f 2 | xargs dirname)
open "https://gitlab.checkrhq.net/$GROUP/$REPO/-/merge_requests/new?merge_request%5Bsource_branch%5D=$BRANCH"
}
# Tests in monolith
alias testme="VERBOSE_TEST_REPORTS=1 bundle exec m"
# Rename approvals
function mv_approvals {
find spec/fixtures/approvals -name "*.received.json" -exec bash -c 'mv "$1" "${1%.received.json}".approved.json' - '{}' \;
}
# Remove approvals
function rm_approvals {
find spec/fixtures/approvals -name "*.received.json" | xargs rm
}
# View monolith commit on GitLab
function glmc {
open "https://gitlab.checkrhq.net/platform/checkr/-/commit/$1"
}
# View monolith commit on GitHub
function ghmc {
open "https://github.com/checkr/checkr/commit/$1"
}
# View monolith file path
function glmf {
open "https://gitlab.checkrhq.net/platform/checkr/-/blob/master/$1"
}