|
|
@@ -12,31 +12,29 @@ Crear un proyecto.
|
|
|
|
|
|
A continuación añadir una app desde Agregar, importar desde git.
|
|
|
|
|
|
- oc new-app http://gitea.reymota.es/creylopez/ReyMotaAppsOC.git -e APP_VERSION="15.0.0" -e DEBUG="False" -e OPENSHIFT="True" --name='reymota'
|
|
|
+ oc new-app http://forgejo.reymota.es/creylopez/misfinanzas.git -e APP_VERSION="1.0.0" -e DEBUG="False" -e OPENSHIFT="True" --name='finanzas'
|
|
|
|
|
|
Tal y como está la estructura de directorios, deberia detectar automáticamente una compilación Python
|
|
|
|
|
|
## asignación de los volúmenes
|
|
|
### Si la pvc no está creada
|
|
|
|
|
|
- oc set volume deployment.apps/reymota --add -t pvc --claim-size=300M --name=reymota-lyrics-migrations --claim-name='reymota-lyrics-migrations' --mount-path='/app/lyrics/migrations'
|
|
|
- oc set volume deployment.apps/reymota --add -t pvc --claim-size=300M --name=reymota-media --claim-name='reymota-media' --mount-path='/app/mediafiles'
|
|
|
- oc set volume deployment.apps/reymota --add -t pvc --claim-size=300M --name=reymota-repostajes-migrations --claim-name='reymota-repostajes-migrations' --mount-path='/app/repostajes/migrations'
|
|
|
- oc set volume deployment.apps/reymota --add -t pvc --claim-size=300M --name=reymota-reymotausers-migrations --claim-name='reymota-reymotausers-migrations' --mount-path='/app/reymotausers/migrations'
|
|
|
- oc set volume deployment.apps/reymota --add -t pvc --claim-size=50G --name=static-volume --claim-name='static-volume' --mount-path='/app/staticfiles'
|
|
|
+ oc set volume deployment.apps/finanzas --add -t pvc --claim-size=300M --name=finanzas-media --claim-name='finanzas-media' --mount-path='/app/mediafiles'
|
|
|
+ oc set volume deployment.apps/finanzas --add -t pvc --claim-size=300M --name=finanzas-finanzas-migrations --claim-name='finanzas-finanzas-migrations' --mount-path='/app/finanzas/migrations'
|
|
|
+ oc set volume deployment.apps/finanzas --add -t pvc --claim-size=300M --name=finanzas-reymotausers-migrations --claim-name='finanzas-reymotausers-migrations' --mount-path='/app/reymotausers/migrations'
|
|
|
+ oc set volume deployment.apps/finanzas --add -t pvc --claim-size=50G --name=static-volume --claim-name='static-volume' --mount-path='/app/staticfiles'
|
|
|
|
|
|
|
|
|
### Si la pvc ya está creada
|
|
|
|
|
|
- oc set volume deployment.apps/reymota --add -t pvc --name=reymota-lyrics-migrations --claim-name='reymota-lyrics-migrations' --mount-path='/app/lyrics/migrations'
|
|
|
- oc set volume deployment.apps/reymota --add -t pvc --name=reymota-media --claim-name='reymota-media' --mount-path='/app/mediafiles'
|
|
|
- oc set volume deployment.apps/reymota --add -t pvc --name=reymota-repostajes-migrations --claim-name='reymota-repostajes-migrations' --mount-path='/app/repostajes/migrations'
|
|
|
- oc set volume deployment.apps/reymota --add -t pvc --name=reymota-reymotausers-migrations --claim-name='reymota-reymotausers-migrations' --mount-path='/app/reymotausers/migrations'
|
|
|
- oc set volume deployment.apps/reymota --add -t pvc --name=static-volume --claim-name='static-volume' --mount-path='/app/staticfiles'
|
|
|
+ oc set volume deployment.apps/finanzas --add -t pvc --name=finanzas-media --claim-name='finanzas-media' --mount-path='/app/mediafiles'
|
|
|
+ oc set volume deployment.apps/finanzas --add -t pvc --name=finanzas-finanzas-migrations --claim-name='finanzas-finanzas-migrations' --mount-path='/app/finanzas/migrations'
|
|
|
+ oc set volume deployment.apps/finanzas --add -t pvc --name=finanzas-reymotausers-migrations --claim-name='finanzas-reymotausers-migrations' --mount-path='/app/reymotausers/migrations'
|
|
|
+ oc set volume deployment.apps/finanzas --add -t pvc --name=static-volume --claim-name='static-volume' --mount-path='/app/staticfiles'
|
|
|
|
|
|
|
|
|
## Exponer el servicio
|
|
|
- oc expose deployment.apps/reymota --type=NodePort --port=8080
|
|
|
+ oc expose deployment.apps/finanzas --type=NodePort --port=8080
|
|
|
|
|
|
### postgresql
|
|
|
Se hace desde el yaml
|
|
|
@@ -48,7 +46,7 @@ Se hace desde el yaml
|
|
|
|
|
|
Una vez realizadas las modificaciones al código y se hayan subido a gitea, hay que reconstruir el proyecto.
|
|
|
|
|
|
- oc start-build reymota
|
|
|
+ oc start-build finanzas
|
|
|
|
|
|
## Comandos a ejecutar la primera vez o cuando haya cambios en las bases de datos
|
|
|
|
|
|
@@ -65,7 +63,7 @@ Con la shell entraPsql.sh:
|
|
|
|
|
|
\l para listar las BD
|
|
|
|
|
|
- \c reymota para usar nuestra db
|
|
|
+ \c finanzas para usar nuestra db
|
|
|
\dt para ver las tablas
|
|
|
|
|
|
# De dónde cogí ideas
|