Last active
June 20, 2023 16:00
-
-
Save kingbuzzman/be4f4f2cb72269e4f4334ec225b9384a to your computer and use it in GitHub Desktop.
commit_to_behave_django.sh
This file contains 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
# Steps to running behave-django quickly to make a PR. | |
# 1. Fork behave-django on github: https://github.com/behave/behave-django | |
# 2. Make sure that you've setup your ssh keys for github: https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/ | |
# IMPORTANT: *** Please ignore if you've already done it *** | |
# 3. Copy and paste this directly into your terminal: | |
mkdir -p $(pwd)/behave-django | |
docker run -v ${pwd}/behave-django:/behave-django -v ~/.ssh:/root/.ssh -v ~/.gitconfig:/root/.gitconfig -it --rm python:3.9 bash -c "$(cat << 'EOF' | |
# update the machine | |
apt-get update && \ | |
# install dependencies | |
apt-get install -y libmemcached-dev zlib1g-dev libssl-dev build-essential vim && \ | |
# clone the repo if it doesnt exist | |
(if [ ! -d /behave-django/behave_django ]; then | |
# dont be afaid of this, this just gets your github username and adds it into the clone url | |
# this is here so there is no placeholder "git@github.com:<insert your username here>/behave-django.git" | |
# and anyone can just copy and paste it. also behave-django is large so we only get the last 50 commits to try and keep the size down. | |
git clone --depth 50 git@github.com:`ssh -T git@github.com 2>&1 | cut -d " " -f 2 | rev | cut -c 2- | rev`/behave-django.git | |
fi) && \ | |
# go into the behave-django code | |
cd behave-django && \ | |
# add the remote "upstream" if it doesnt exist | |
(if ! git config remote.upstream.url > /dev/null; then | |
git remote add upstream https://github.com/behave/behave-django | |
fi) && \ | |
install behave-django | |
pip install -e . && \ | |
pip install tox && \ | |
# make a new line and add instructions for the user to follow | |
echo && \ | |
echo "Run: 'tox' for tests" && \ | |
echo "Run: 'tox -l' for test names" && \ | |
echo "Run: 'tox -e <test name>' to run individual test" && \ | |
# give the user the prompt so they chose what they really want to do | |
exec bash | |
EOF | |
)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment