Entradas

Mostrando entradas de noviembre, 2021

Create a docker image from a spring boot project

In order to create a docker image from a spring boot project, First, your pom.xml has to be configured. <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!-- Cofiguration for creating a docker image --> <image> <name>chamow01/${project.artifactId}</name> </image> </configuration> </plugin> </plugins> </build> Then, the next maven command needs to be applied, so spring boot uses paketo-buildpacks in order to create a docker image based on you Java code mvn spring-boot:build-image ... [INFO] > Running creator [INFO] [creator] ===> DETECTING [INFO] [creator] 6 of 24 buildpacks participating [INFO] [creator] paketo-buildpacks/ca-certificates 3.2.0 [INFO] [creator] paketo-buildpacks/bellsoft-liberica 9.3.2 [INFO]

Comandos en Angular-CLI

Comando usados en Angular CLI Comando Descripcion ng new nombre-app Permite crear una nueva aplicación Angular ng serve -o Permite levantar el servidor embebido y abrirlo en el navegador ng generate componente nombre ng g c nombre Permite Genear un componente de angular (con una carpeta.ts, .html, .css, .spec.ts) y actualiza el app.module.ts TES Fuentes https://angular.io/clim

Configuración de Profiles para Spring-Boot

Proceso para crear profiles para un proyecto Spring-boot Configurar en el pom.xml los perfiles deseados, por ejemplo, a continuación se configura dos profiles para dev y prod <profiles> <profile> <id>dev</id> <properties> <activatedProperties>dev</activatedProperties> </properties> <activation> <activeByDefault>true</activeByDefault> </activation> </profile> <profile> <id>prod</id> <properties> <activatedProperties>prod</activatedProperties> </properties> </profile> </profiles> Configurar los recursos que se van a cargar con el profile activo <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plu

Deploy de un jar en Heroku

Proceso para deployar un jar en Heroku Logearse en heroku con el comando: heroku login Instalar el siguiente plugin: heroku plugins:install heroku-cli-deploy Crear un nuevo proyecto en Heroku y enlazarlo con el proyecto local: heroku git:remote -a dc-homepay-rest Deployar el jar en Heroku con el siguiente comando: heroku deploy:jar target/homepay-controller-1.0.0-SNAPSHOT.jar Si se debea ver los logs de la aplicación se debe ejecutar el siguiente comando: heroku logs heroku logs --tail Fuentes https://devcenter.heroku.com/articles/deploying-java