-
create you own branch
- git checkout -b tusharBranch
-
switch to your branch from master to tusharBranch
-
git checkout tusharBranch
-
or: use force to checkout git checkout -f tusharBranch
-
-
git pull , eg: if you are behind
- git pull
-
If you want to pull a branch and you edited your branch
-
stash the your branch
- git stash
-
then pull
- pull master
-
-
if you want to rebase your branch with master
- git rebase master
-
do not merge with master without conversation
- eg: if you want to merge your local branch with - - - - - tusharBranch
- git merge tusharBranch
- eg: if you want to merge your local branch with - - - - - tusharBranch
- git config --global user.name "example@gmail.com"
- git config --global user.password "password"
-
install virtual environment:
-
python -m pip install --user virtualenv
-
create an instance of virtual environment:
- linux:
- python -m virtualenv venv
- window:
- python -m venv venv
-
activate your virtual environment:
- linux:
- . venv/bin/activate
- linux:
-
window: - .\venv\Scripts\activate
-
- pip install -r requirements.txt
- or
- pip3 install --user requirements.txt
- or
- create an image from cmd
- docker build -t snowlibrary:latest .
- confirm the build images
- docker images
- run the image ("PORT-FORWORDING")
- docker run -it -d -p 5000:5000 snowlibrary
- check if the image is running or not
- docker ps
- stop the image (two steps):
- docker ps (to get the running image id)
- docker stop
- export PROJECT_ID=pyback
- docker build -t gcr.io/pyback/snowlibrary:v1 .
- docker push gcr.io/pyback/snowlibrary:v1
- gcloud container clusters get-credentials standard-cluster-1 --zone us-central1-a --project pyback
- gcloud config set project $PROJECT_ID
- gcloud config set compute/zone [COMPUTE_ENGINE_ZONE]
- kubectl create deployment pyback --image=gcr.io/pyback/snowlibrary:v1
- kubectl get pods
- kubectl expose deployment pyback --type=LoadBalancer --port 80 --target-port 5000
- kubectl get service
- kubectl scale deployment pyback --replicas=3
- kubectl get deployment pyback
- kubectl set image pyback=gcr.io/pyback/snowlibrary:v2