[GANDI][SH][GIT] Transfert d'application de Bitbucket vers un dépôt git d'une instance Simple Hosting. I) Bitbucket. 1/ Sous Bitbucket, créer un dépot git. Ajouter sa clé publique dans son compte. 2/ Création d'un répertoire de travail :
➜ ~ mkdir -p DEPOT/BB
➜ ~ cd DEPOT/BB/
3/ Création du répertoire de base 'htdocs/' de l'application :
➜ BB mkdir htdocs
4/ Création de fichiers : Ouvrir :
htdocs/index.php
Ajouter :
<?php
echo "Mon appli";
?>
Ouvrir :
htdocs/README.md
Ajouter :
Mon appli
=========
Ouvrir :
README.md
Ajouter
Contributeurs:
Sam
5/ Initialisation du dépôt :
➜ BB git init .
Initialized empty Git repository in /home/sam/DEPOT/BB/.git/
6/ Ajout de la branche distante 'origin' :
➜ BB git:(master) ✗ git remote add origin git@bitbucket.org:Nekrofage/monappli.git
7/ Ajout des fichiers :
➜ BB git:(master) ✗ git add -A
8/ Premier commit :
➜ BB git:(master) ✗ git commit -m "Version 0.0.1"
[master (root-commit) d30cdc8] Version 0.0.1
2 files changed, 7 insertions(+)
create mode 100644 htdocs/README.md
create mode 100644 htdocs/index.php
9/ Pousser les fichiers dans la branche distante :
➜ BB git:(master) git push -u origin master
10/ Vérification de la branche distante :
➜ BB git:(master) git remote show origin
* remote origin
Fetch URL: git@bitbucket.org:Nekrofage/monappli.git
Push URL: git@bitbucket.org:Nekrofage/monappli.git
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
II) Gandi. 1/ Création du répertoire de travail :
➜ ~ mkdir -p DEPOT/BB
2/ Clonage du dépôt distant :
➜ ~ cd DEPOT/SH
➜ SH git clone git@bitbucket.org:Nekrofage/monappli.git
Cloning into 'monappli'...
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 8 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (8/8), done.
Checking connectivity... done.
➜ SH
3/ Ajout de la branche distante 'originsh' du dépôt git de l'instance Simple Hosting :
➜ SH cd monappli
➜ monappli git:(master) git remote add originsh git+ssh://5743348@git.dc0.gpaas.net/test.siteperso.tech.git
4/ Pousser les modification vers la branche distante :
➜ monappli git:(master) git push originsh master
Counting objects: 8, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (8/8), 612 bytes | 0 bytes/s, done.
Total 8 (delta 0), reused 8 (delta 0)
To git+ssh://5743348@git.dc0.gpaas.net/test.siteperso.tech.git
* [new branch] master -> master
5/ Déploiement de l'application vers le répertoire SFTP : /lamp0/web/vhosts/test.siteperso.tech/htdocs/
➜ monappli git:(master) ssh 5743348@git.dc0.gpaas.net 'deploy test.siteperso.tech.git'
initializing builder
....................builder ready
Vm password:
Grabbing terminal
Ok
-----> Starting new deployment (test.siteperso.tech - master)
-----> Fetching application code
-----> Building new application
/tmp/build.wJxuUEgh9J/htdocs /tmp/build.wJxuUEgh9J
/tmp/build.wJxuUEgh9J
-----> Copying new application
sending incremental file list
README.md
htdocs/README.md
htdocs/index.php
sent 348 bytes received 82 bytes 860.00 bytes/sec
total size is 73 speedup is 0.17
-----> Build complete
-----> Cleaning temporary files
➜ monappli git:(master)
6/ Test :
http://test.siteperso.tech