SlideShare a Scribd company logo
1 of 22
Download to read offline
Deploy
En Gitlab
vía FTP
G. Mizael Mtz Hdz
SOFTWARE ENGINEER
“
Automatizar el envío de código fuente
desde un repositorio en Gitlab hacia tu
Servidor (producción), por medio de
FTP
.
PASO #1: Push a
master/main
git push -u origin master / main
merge request
PASO #2: Despliegue del código
desde Gitlab hacia nuestro
servidor (cPanel/ HestiaCP/
Plesk) a través de FTP
Ambiente de desarrollo.
GitFlow
AGENDA
INTRODUCCIÓN
Aprender los conceptos
generales sobre los
despliegues automáticos
CONFIGURACIÓN EN GITLAB
Configurar el repositorio
de Gitlab + FTP
RESULTADO
Mostrar el resultado de la
configuración del
repositorio
INTRODUCCIÓN
Aprender los conceptos generales sobre
los despliegues automáticos
01.
PASO #1: Push a
master/main
git push -u origin master / main
merge request
PASO #2: Despliegue del código
desde Gitlab hacia nuestro
servidor (cPanel/ HestiaCP/
Plesk) a través de FTP
Ambiente de desarrollo.
GitFlow
INTRODUCCIÓN
CI
Integración continua,
nuevas características
(automatizado).
CD
Despliegue continuo
(automatizado)
AUTOMATIZACIÓN
● Ser ágil
● Entregar software de calidad
Fuente: redhat
INTRODUCCIÓN
.gitlab-ci.yml
Archivo donde se definen
los JOB's CI/CD
CONTENEDOR
Capacidad de ejecutar varios procesos y
aplicaciones por separado para hacer un mejor uso
de su infraestructura y, al mismo tiempo, conservar
la seguridad que tendría con sistemas separados
LFTP
transferencia de archivos desde
la consola de comandos.
INTRODUCCIÓN
PIPELINE
Conjunto de scripts (Jobs)
que se definen en
.gitlab-ci.yml
JOB
Funcionalidades únicas.
RUNNERS
Proceso encargado de ejecutar las
instrucciones definidas en archivos
.gitlab-ci.yml
CONFIGURACIÓN EN GITLAB
Configurar el repositorio de Gitlab + FTP
02.
PASO #1: Push a
master/main
git push -u origin master / main
merge request
PASO #2: Despliegue del código
desde Gitlab hacia nuestro
servidor (cPanel/ HestiaCP/
Plesk) a través de FTP
Ambiente de desarrollo.
GitFlow
CONFIGURACIÓN EN GITLAB
PRECONFIGURACIÓN
Antes de iniciar con la configuración es importante conocer la siguiente información del proyecto /
repositorio:
1. La rama que desencadenará el despliegue (regularmente master o main).
2. Si el servidor destino, soporta conexiones por FTP / SFTP (SSH) / ETC.
3. Que carpetas o archivos solo necesitan subirse una vez, para descartarlos en el archivo de
configuración “.gitlab-ci.yml”, como por ej.
a. system/
b. vendor/
c. config/
d. .git/
e. .gitignore
f. .gitlab-ci.yml
g. etc.
4. Tener un repositorio en Gitlab
a. Rol “Maintainer“ o “Owner”
CONFIGURACIÓN EN GITLAB
CREACIÓN DE CUENTA FTP
● HestiaCP
○ Login en el Web Panel
○ Web > *Seleccionar dominio/subdominio > Additional FTP account(s)
■ FTP #1
● Username: admin_gitlab
● Password: wq3HownaqQ2Ly1um
● Path: /home/admin/web/witsoftplus.com/public_html/gitlab_ftp
● Servidor: http://witsoftplus.com/
● Url: http://witsoftplus.com/gitlab_ftp
cPanel: cuenta de FTP
cPanel: cuenta de FTP
CONFIGURACIÓN EN GITLAB
CONFIGURAR VARIABLES
● En el repositorio que estamos configurando > clic en el menú de la izquierda > Settings > CI / CD
● En la sección de “Variables” expandir y dar de alta las siguientes 3 variables:
○ FTP_SERVER: ftp.witsoftplus.com
○ FTP_USERNAME: admin_gitlab
○ FTP_PASSWORD: wq3HownaqQ2Ly1um
CONFIGURACIÓN EN GITLAB
CREACIÓN DE ARCHIVO “.gitlab-ci.yml” EN GITLAB
● Iniciar sesión en Gitlab: https://gitlab.com/
● Agregar un archivo llamado “.gitlab-ci.yml” en el directorio root del repositorio.
○ https://gitlab.com/g.-mizael-mtz-hdz/gitflow-en-gitlab
● Notas:
○ No necesariamente se tiene que utilizar la imagen de docker: ubuntu:18.04.
○ No agregar la etiqueta -e o --delete: ya que si no existen los archivos del repositorio en el
servidor, se eliminarán.
○ Es recomendable excluir aquellas carpetas que solo se necesitan subir una vez, como por
ej. system/ (core de codeigniter), vendor/ (a menos que se actualicen los paquetes que se
están utilizando), etc.
● Ejemplos de archivo .gitlab-ci.yml
○ https://gist.github.com/gmizaelmtzhdz/a66376dbac8e5e73363f40f2413591ac
○ https://gist.github.com/gmizaelmtzhdz/b89cc754e7a27daf806350adfdfe7cd3
○ https://gist.github.com/gmizaelmtzhdz/4abafafce454719db3e653d1bdfdfc3a
○ https://gist.github.com/gmizaelmtzhdz/1ea7eaf788335d325dd5c22c22b53160
RESULTADO
Mostrar el resultado de la configuración
del repositorio
03.
PROBANDO EL
DEPLOY
Analizar el despliegue
Cuota de uso
Job
HACIENDO CAMBIOS
EN EL “.gitlab-ci.yml”
Gitlab
Siguiente paso...
Gitlab
¡Gracias!
¿Tienes alguna duda?
G. Mizael Mtz Hdz
SOFTWARE ENGINEER

More Related Content

What's hot

Présentation de git
Présentation de gitPrésentation de git
Présentation de gitJulien Blin
 
Git with bitbucket
Git with bitbucketGit with bitbucket
Git with bitbucketSumin Byeon
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHubNicolás Tourné
 
Jenkins tutorial for beginners
Jenkins tutorial for beginnersJenkins tutorial for beginners
Jenkins tutorial for beginnersBugRaptors
 
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence Parag Gajbhiye
 
Understanding GIT and Version Control
Understanding GIT and Version ControlUnderstanding GIT and Version Control
Understanding GIT and Version ControlSourabh Sahu
 
Liquibase & Flyway @ Baltic DevOps
Liquibase & Flyway @ Baltic DevOpsLiquibase & Flyway @ Baltic DevOps
Liquibase & Flyway @ Baltic DevOpsAndrei Solntsev
 
DevOps Introduction
DevOps IntroductionDevOps Introduction
DevOps IntroductionRobert Sell
 
GitHub - Présentation
GitHub - PrésentationGitHub - Présentation
GitHub - PrésentationDavid RIEHL
 
Git flow
Git flowGit flow
Git flowshaokun
 
Gitlab with github desktop
Gitlab with github desktopGitlab with github desktop
Gitlab with github desktopSagar Dash
 
Database Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDatabase Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDan Stine
 

What's hot (20)

CI/CD with GitHub Actions
CI/CD with GitHub ActionsCI/CD with GitHub Actions
CI/CD with GitHub Actions
 
Gitlab flow
Gitlab flowGitlab flow
Gitlab flow
 
Présentation de git
Présentation de gitPrésentation de git
Présentation de git
 
Git with bitbucket
Git with bitbucketGit with bitbucket
Git with bitbucket
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Source control
Source controlSource control
Source control
 
Git
GitGit
Git
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Jenkins tutorial for beginners
Jenkins tutorial for beginnersJenkins tutorial for beginners
Jenkins tutorial for beginners
 
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
 
Understanding GIT and Version Control
Understanding GIT and Version ControlUnderstanding GIT and Version Control
Understanding GIT and Version Control
 
Liquibase & Flyway @ Baltic DevOps
Liquibase & Flyway @ Baltic DevOpsLiquibase & Flyway @ Baltic DevOps
Liquibase & Flyway @ Baltic DevOps
 
DevOps Introduction
DevOps IntroductionDevOps Introduction
DevOps Introduction
 
TestNG with selenium
TestNG with seleniumTestNG with selenium
TestNG with selenium
 
GitHub - Présentation
GitHub - PrésentationGitHub - Présentation
GitHub - Présentation
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git flow
Git flowGit flow
Git flow
 
Gitlab with github desktop
Gitlab with github desktopGitlab with github desktop
Gitlab with github desktop
 
Database Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDatabase Migrations with Gradle and Liquibase
Database Migrations with Gradle and Liquibase
 

Similar to Deploy gitlab vía ftp

GuiaPrincipiantesGitHubrfuenzalidadev.pptx
GuiaPrincipiantesGitHubrfuenzalidadev.pptxGuiaPrincipiantesGitHubrfuenzalidadev.pptx
GuiaPrincipiantesGitHubrfuenzalidadev.pptxfuenzalidarodrigo
 
Introducción a Git
Introducción a GitIntroducción a Git
Introducción a GitManuel Ceron
 
Curso: Publicando mi proyecto web en Github
Curso: Publicando mi proyecto web en GithubCurso: Publicando mi proyecto web en Github
Curso: Publicando mi proyecto web en GithubCarlos Huamaní
 
Git para-principiantes
Git para-principiantesGit para-principiantes
Git para-principiantesnscoder_mad
 
Git: un enfoque práctico
Git: un enfoque prácticoGit: un enfoque práctico
Git: un enfoque prácticoPatxi Gortázar
 
Git & GitHub Part II
Git & GitHub Part IIGit & GitHub Part II
Git & GitHub Part IIMax Rodriguez
 
Control de versiones utilizando Git
Control de versiones utilizando GitControl de versiones utilizando Git
Control de versiones utilizando GitHugo Gilmar Erazo
 
Presentación GitHub Antonio Luque Bravo y Miguel Ángel Zamora Blanco
Presentación GitHub Antonio Luque Bravo y Miguel Ángel Zamora BlancoPresentación GitHub Antonio Luque Bravo y Miguel Ángel Zamora Blanco
Presentación GitHub Antonio Luque Bravo y Miguel Ángel Zamora BlancoAntonio Luque Bravo
 
Todo sobre el mundo del GIT-INTEGRACION-CONCEPTOS-USABILIDAD
Todo sobre el mundo del GIT-INTEGRACION-CONCEPTOS-USABILIDADTodo sobre el mundo del GIT-INTEGRACION-CONCEPTOS-USABILIDAD
Todo sobre el mundo del GIT-INTEGRACION-CONCEPTOS-USABILIDADDIEGOALBERTOENRIQUEZ4
 
Uso practico de git
Uso practico de gitUso practico de git
Uso practico de gitKeopx
 
Más allá de Git add/commit/push
Más allá de Git add/commit/pushMás allá de Git add/commit/push
Más allá de Git add/commit/pushAlexis Lopez
 

Similar to Deploy gitlab vía ftp (20)

Git flow en github
Git flow en githubGit flow en github
Git flow en github
 
Git flow en gitlab
Git flow en gitlabGit flow en gitlab
Git flow en gitlab
 
Flujos de trabajo y mejores prácticas en git
Flujos de trabajo y mejores prácticas en gitFlujos de trabajo y mejores prácticas en git
Flujos de trabajo y mejores prácticas en git
 
GuiaPrincipiantesGitHubrfuenzalidadev.pptx
GuiaPrincipiantesGitHubrfuenzalidadev.pptxGuiaPrincipiantesGitHubrfuenzalidadev.pptx
GuiaPrincipiantesGitHubrfuenzalidadev.pptx
 
Introducción a Git
Introducción a GitIntroducción a Git
Introducción a Git
 
Curso: Publicando mi proyecto web en Github
Curso: Publicando mi proyecto web en GithubCurso: Publicando mi proyecto web en Github
Curso: Publicando mi proyecto web en Github
 
Introducción a Git
Introducción a GitIntroducción a Git
Introducción a Git
 
Git para-principiantes
Git para-principiantesGit para-principiantes
Git para-principiantes
 
Git: un enfoque práctico
Git: un enfoque prácticoGit: un enfoque práctico
Git: un enfoque práctico
 
Git & GitHub Part II
Git & GitHub Part IIGit & GitHub Part II
Git & GitHub Part II
 
Control de versiones utilizando Git
Control de versiones utilizando GitControl de versiones utilizando Git
Control de versiones utilizando Git
 
Fundamentos de GIt y Github
Fundamentos de GIt y GithubFundamentos de GIt y Github
Fundamentos de GIt y Github
 
Git y github básico
Git y github básicoGit y github básico
Git y github básico
 
Presentación GitHub Antonio Luque Bravo y Miguel Ángel Zamora Blanco
Presentación GitHub Antonio Luque Bravo y Miguel Ángel Zamora BlancoPresentación GitHub Antonio Luque Bravo y Miguel Ángel Zamora Blanco
Presentación GitHub Antonio Luque Bravo y Miguel Ángel Zamora Blanco
 
Git.manual.usuario
Git.manual.usuarioGit.manual.usuario
Git.manual.usuario
 
Todo sobre el mundo del GIT-INTEGRACION-CONCEPTOS-USABILIDAD
Todo sobre el mundo del GIT-INTEGRACION-CONCEPTOS-USABILIDADTodo sobre el mundo del GIT-INTEGRACION-CONCEPTOS-USABILIDAD
Todo sobre el mundo del GIT-INTEGRACION-CONCEPTOS-USABILIDAD
 
wp-cli
wp-cliwp-cli
wp-cli
 
Git training
Git trainingGit training
Git training
 
Uso practico de git
Uso practico de gitUso practico de git
Uso practico de git
 
Más allá de Git add/commit/push
Más allá de Git add/commit/pushMás allá de Git add/commit/push
Más allá de Git add/commit/push
 

Deploy gitlab vía ftp

  • 1. Deploy En Gitlab vía FTP G. Mizael Mtz Hdz SOFTWARE ENGINEER
  • 2. “ Automatizar el envío de código fuente desde un repositorio en Gitlab hacia tu Servidor (producción), por medio de FTP .
  • 3. PASO #1: Push a master/main git push -u origin master / main merge request PASO #2: Despliegue del código desde Gitlab hacia nuestro servidor (cPanel/ HestiaCP/ Plesk) a través de FTP Ambiente de desarrollo. GitFlow
  • 4. AGENDA INTRODUCCIÓN Aprender los conceptos generales sobre los despliegues automáticos CONFIGURACIÓN EN GITLAB Configurar el repositorio de Gitlab + FTP RESULTADO Mostrar el resultado de la configuración del repositorio
  • 5. INTRODUCCIÓN Aprender los conceptos generales sobre los despliegues automáticos 01.
  • 6. PASO #1: Push a master/main git push -u origin master / main merge request PASO #2: Despliegue del código desde Gitlab hacia nuestro servidor (cPanel/ HestiaCP/ Plesk) a través de FTP Ambiente de desarrollo. GitFlow
  • 7. INTRODUCCIÓN CI Integración continua, nuevas características (automatizado). CD Despliegue continuo (automatizado) AUTOMATIZACIÓN ● Ser ágil ● Entregar software de calidad Fuente: redhat
  • 8. INTRODUCCIÓN .gitlab-ci.yml Archivo donde se definen los JOB's CI/CD CONTENEDOR Capacidad de ejecutar varios procesos y aplicaciones por separado para hacer un mejor uso de su infraestructura y, al mismo tiempo, conservar la seguridad que tendría con sistemas separados LFTP transferencia de archivos desde la consola de comandos.
  • 9. INTRODUCCIÓN PIPELINE Conjunto de scripts (Jobs) que se definen en .gitlab-ci.yml JOB Funcionalidades únicas. RUNNERS Proceso encargado de ejecutar las instrucciones definidas en archivos .gitlab-ci.yml
  • 10. CONFIGURACIÓN EN GITLAB Configurar el repositorio de Gitlab + FTP 02.
  • 11. PASO #1: Push a master/main git push -u origin master / main merge request PASO #2: Despliegue del código desde Gitlab hacia nuestro servidor (cPanel/ HestiaCP/ Plesk) a través de FTP Ambiente de desarrollo. GitFlow
  • 12. CONFIGURACIÓN EN GITLAB PRECONFIGURACIÓN Antes de iniciar con la configuración es importante conocer la siguiente información del proyecto / repositorio: 1. La rama que desencadenará el despliegue (regularmente master o main). 2. Si el servidor destino, soporta conexiones por FTP / SFTP (SSH) / ETC. 3. Que carpetas o archivos solo necesitan subirse una vez, para descartarlos en el archivo de configuración “.gitlab-ci.yml”, como por ej. a. system/ b. vendor/ c. config/ d. .git/ e. .gitignore f. .gitlab-ci.yml g. etc. 4. Tener un repositorio en Gitlab a. Rol “Maintainer“ o “Owner”
  • 13. CONFIGURACIÓN EN GITLAB CREACIÓN DE CUENTA FTP ● HestiaCP ○ Login en el Web Panel ○ Web > *Seleccionar dominio/subdominio > Additional FTP account(s) ■ FTP #1 ● Username: admin_gitlab ● Password: wq3HownaqQ2Ly1um ● Path: /home/admin/web/witsoftplus.com/public_html/gitlab_ftp ● Servidor: http://witsoftplus.com/ ● Url: http://witsoftplus.com/gitlab_ftp
  • 16. CONFIGURACIÓN EN GITLAB CONFIGURAR VARIABLES ● En el repositorio que estamos configurando > clic en el menú de la izquierda > Settings > CI / CD ● En la sección de “Variables” expandir y dar de alta las siguientes 3 variables: ○ FTP_SERVER: ftp.witsoftplus.com ○ FTP_USERNAME: admin_gitlab ○ FTP_PASSWORD: wq3HownaqQ2Ly1um
  • 17. CONFIGURACIÓN EN GITLAB CREACIÓN DE ARCHIVO “.gitlab-ci.yml” EN GITLAB ● Iniciar sesión en Gitlab: https://gitlab.com/ ● Agregar un archivo llamado “.gitlab-ci.yml” en el directorio root del repositorio. ○ https://gitlab.com/g.-mizael-mtz-hdz/gitflow-en-gitlab ● Notas: ○ No necesariamente se tiene que utilizar la imagen de docker: ubuntu:18.04. ○ No agregar la etiqueta -e o --delete: ya que si no existen los archivos del repositorio en el servidor, se eliminarán. ○ Es recomendable excluir aquellas carpetas que solo se necesitan subir una vez, como por ej. system/ (core de codeigniter), vendor/ (a menos que se actualicen los paquetes que se están utilizando), etc. ● Ejemplos de archivo .gitlab-ci.yml ○ https://gist.github.com/gmizaelmtzhdz/a66376dbac8e5e73363f40f2413591ac ○ https://gist.github.com/gmizaelmtzhdz/b89cc754e7a27daf806350adfdfe7cd3 ○ https://gist.github.com/gmizaelmtzhdz/4abafafce454719db3e653d1bdfdfc3a ○ https://gist.github.com/gmizaelmtzhdz/1ea7eaf788335d325dd5c22c22b53160
  • 18. RESULTADO Mostrar el resultado de la configuración del repositorio 03.
  • 19. PROBANDO EL DEPLOY Analizar el despliegue Cuota de uso Job
  • 20. HACIENDO CAMBIOS EN EL “.gitlab-ci.yml” Gitlab
  • 22. ¡Gracias! ¿Tienes alguna duda? G. Mizael Mtz Hdz SOFTWARE ENGINEER