Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try in Red Hat DevSpaces #449

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
fddae88
Create devfile.yaml
maximilianoPizarro Sep 5, 2024
3299fbe
Try in Red Hat DevSpaces
maximilianoPizarro Sep 5, 2024
a6bcc3d
Try in Red Hat DevSpaces
maximilianoPizarro Sep 5, 2024
b5a074d
Try in Red Hat DevSpaces
maximilianoPizarro Sep 5, 2024
b5ee13f
Try in Red Hat DevSpaces
maximilianoPizarro Sep 5, 2024
f26cd66
devfile.yaml
maximilianoPizarro Sep 5, 2024
a5f0c9c
devfile.yaml
maximilianoPizarro Sep 5, 2024
9db8f55
devfile.yaml
maximilianoPizarro Sep 5, 2024
a8df883
devfile.yaml
maximilianoPizarro Sep 5, 2024
b70ce10
devfile.yaml
maximilianoPizarro Sep 5, 2024
789d507
devfile.yaml
maximilianoPizarro Sep 5, 2024
81e46cd
devfile.yaml
maximilianoPizarro Sep 5, 2024
bafebda
works with mariadb
maximilianoPizarro Sep 5, 2024
c29e01c
application-dev
maximilianoPizarro Sep 6, 2024
69113e4
application-dev.yaml
maximilianoPizarro Sep 6, 2024
bc6abfc
Tekton Pipeline
maximilianoPizarro Sep 6, 2024
8f4cb13
README
maximilianoPizarro Sep 6, 2024
8e78436
tkn pipeline start
maximilianoPizarro Sep 6, 2024
bc6a0d9
readme tekton pipeline
maximilianoPizarro Sep 6, 2024
5e34ca9
create with openshift
maximilianoPizarro Sep 9, 2024
b067a1e
Actualizar devfile.yaml
maximilianoPizarro Sep 10, 2024
e62f3f6
Actualizar devfile.yaml
maximilianoPizarro Sep 10, 2024
5585dea
devfile openshift generate application
maximilianoPizarro Sep 10, 2024
196677a
devfile.yaml
maximilianoPizarro Sep 10, 2024
5fae660
jhipster.devspaces and jhipster-pipeline inside of the repo
maximilianoPizarro Sep 10, 2024
a62bb18
devfile.yaml
maximilianoPizarro Sep 10, 2024
398faef
fix url-devfile and url-pipeline
maximilianoPizarro Sep 10, 2024
262e9aa
add more options to OpenShift Generator. Visibility port devfile.yaml
maximilianoPizarro Sep 11, 2024
a6a324f
update jhipster-pipeline.yaml
maximilianoPizarro Sep 11, 2024
3d6cf0e
Update devfile.yaml
maximilianoPizarro Sep 12, 2024
d16b1e1
Update devfile.yaml
maximilianoPizarro Sep 12, 2024
d596fe3
openshift-generator.componenet
maximilianoPizarro Sep 12, 2024
291f50b
jhipster-pipeline-run
maximilianoPizarro Sep 13, 2024
35aaba8
Merge remote-tracking branch 'origin/openshift'
maximilianoPizarro Sep 13, 2024
bfce7d5
yq task integration
maximilianoPizarro Sep 16, 2024
7c35634
Merge branch 'openshift'
maximilianoPizarro Sep 16, 2024
38b8124
fix yq-script
maximilianoPizarro Sep 17, 2024
1538ed0
Merge branch 'openshift'
maximilianoPizarro Sep 17, 2024
ac8a51f
Open in Developer DevSpaces
maximilianoPizarro Sep 17, 2024
113a57b
Merge branch 'openshift'
maximilianoPizarro Sep 17, 2024
0811d86
add vscode extensions
maximilianoPizarro Sep 17, 2024
bad50be
Merge branch 'openshift'
maximilianoPizarro Sep 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ out/
######################
# Visual Studio Code
######################
.vscode/
#.vscode/

######################
# Maven
Expand Down
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"vscjava.vscode-java-pack"
]
}
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Current File",
"request": "launch",
"mainClass": "${file}"
},
{
"type": "java",
"name": "JhonlineApp",
"request": "launch",
"mainClass": "io.github.jhipster.online.JhonlineApp",
"projectName": "jhonline"
}
]
}
37 changes: 37 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "devfile",
"command": "oc apply -f src/main/kubernetes/mysql.yaml",
"workdir": "${PROJECT_SOURCE}",
"component": "tools",
"problemMatcher": [],
"label": "devfile: OpenShift apply MariaDB Instance (OpenShift cluster)"
},
{
"type": "devfile",
"command": "yarn install",
"workdir": "${PROJECT_SOURCE}",
"component": "tools",
"problemMatcher": [],
"label": "devfile: Package the application"
},
{
"type": "devfile",
"command": "yarn start",
"workdir": "${PROJECT_SOURCE}",
"component": "tools",
"problemMatcher": [],
"label": "devfile: Start Frontend"
},
{
"type": "devfile",
"command": "chmod 777 ./mvnw && ./mvnw",
"workdir": "${PROJECT_SOURCE}",
"component": "tools",
"problemMatcher": [],
"label": "devfile: Start JHipster Online"
}
]
}
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# JHipster Online

[![Build Status][github-actions-jhonline-image]][github-actions-url] [![Docker Pulls](https://img.shields.io/docker/pulls/jhipster/jhipster-online.svg)](https://hub.docker.com/r/jhipster/jhipster-online/)
[![Build Status][github-actions-jhonline-image]][github-actions-url] [![Docker Pulls](https://img.shields.io/docker/pulls/jhipster/jhipster-online.svg)](https://hub.docker.com/r/jhipster/jhipster-online/) [![Open](https://img.shields.io/static/v1?label=Open%20in&message=Developer%20Sandbox&logo=eclipseche&color=FDB940&labelColor=525C86)](https://workspaces.openshift.com/#https://github.com/maximilianoPizarro/jhipster-online)

JHipster Online is a Web application that allows to generate [JHipster applications](https://www.jhipster.tech/)
without installing JHipster on your machine.
Expand Down Expand Up @@ -183,6 +183,50 @@ Then run:
docker compose -f src/main/docker/app.yml up -d
```

### Using Developer Sandbox

- Launch Red Hat Dev Spaces

```
Import from Git and Open Terminal
```

- Update application-dev.yml file, database seccion.

```
# url: jdbc:mariadb://mariadb:3306/jhipsteronline
# username: jhipster
# password: jhipster
```

- Run the database:

```
oc apply -f src/main/kubernetes/mysql.yaml
```

- Install and run the front-end:

```
yarn install && yarn start
```

- Update application-dev.yaml. Configure the URL of the devfile.yaml and pipeline.yaml files seccion that you will need to add to the project generated by jhipster. By default this is the values: (optional)

```
openshift:
devspace:
url-devfile: https://raw.githubusercontent.com/maximilianoPizarro/jhipster-online/main/src/main/kubernetes/jhipster-devspaces.yaml
tekton:
url-pipeline: https://raw.githubusercontent.com/maximilianoPizarro/jhipster-online/main/src/main/kubernetes/jhipster-pipeline.yaml
```

- Run the back-end in other terminal:

```
./mvnw -Pdev
```

## Deployment to Google App Engine (GAE) Flexible Environment

- The project can be deployed to [GAE flexible environment](https://cloud.google.com/appengine/docs/flexible/) by simply [creating a tagged release](https://github.com/jhipster/jhipster-online/releases).
Expand Down
118 changes: 118 additions & 0 deletions devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
schemaVersion: 2.2.2
metadata:
name: jhipster-online
version: 2.33.0
description: Stack with the JHipster Online on DevSpaces Red Hat OpenShift
displayName: JHipster Online
icon: https://raw.githubusercontent.com/maximilianoPizarro/ecommerce-oracle/main/jhipster-icon.png
website: https://start.jhipster.tech
tags:
- Java
- JHipster
- Angular
- Spring
language: Java
projectType: springboot
projects:
- name: jhipster-online
git:
remotes:
origin: 'https://github.com/maximilianoPizarro/jhipster-online'
checkoutFrom:
revision: openshift
components:
- name: tools
container:
image: 'quay.io/maximilianopizarro/jhipster-devspace@sha256:c27aefcf6ce158479bafae63758c1f0993c430a6ee15f76cf369fc889e54eae5'
mountSources: true
cpuLimit: '4'
cpuRequest: '1'
memoryLimit: '8G'
memoryRequest: '4G'
volumeMounts:
- name: m2
path: /home/user/.m2
- name: config
path: /home/user/.config
- name: npm
path: /home/user/.npm
endpoints:
- exposure: public
name: backend
protocol: https
targetPort: 8080
- exposure: public
name: debug
targetPort: 4200
- exposure: public
name: frontend
protocol: https
targetPort: 9000
- exposure: public
name: debug-frontend
protocol: https
targetPort: 9001
- exposure: public
name: browser-sync
protocol: https
targetPort: 3001
env:
- value: '-XX:MaxRAMPercentage=50.0 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom -Duser.home=/home/jboss'
name: JAVA_OPTS
- value: $(JAVA_OPTS)
name: MAVEN_OPTS
- value: '/home/tooling/.sdkman/candidates/java/11.0.15-tem'
name: JAVA_HOME
- name: m2
volume:
size: 512Mi
- name: config
volume:
size: 512Mi
- name: npm
volume:
size: 512Mi
commands:
- id: kubectl-add-mysql
exec:
label: 'Kubernetes apply MariaDB Instance (Kubernetes cluster)'
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: 'kubectl apply -f src/main/kubernetes/mysql.yaml'
- id: oc-add-mysql
exec:
label: 'OpenShift apply MariaDB Instance (OpenShift cluster)'
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: 'oc apply -f src/main/kubernetes/mysql.yaml'
- id: yarn-install
exec:
label: 'Package the application'
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: 'yarn install'
group:
kind: build
isDefault: true
- id: start-frontend
exec:
label: 'Start Frontend'
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: 'yarn start'
group:
kind: run
isDefault: true
- id: start-backend
exec:
label: 'Start JHipster Online'
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: 'chmod 777 ./mvnw && ./mvnw'
group:
kind: run
isDefault: false
events:
postStart:
- oc-add-mysql
- yarn-install
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public class ApplicationProperties {

private NpmCmd npmCmd = new NpmCmd();

private YqCmd yqCmd = new YqCmd();

private final Github github = new Github();

private final Gitlab gitlab = new Gitlab();
Expand All @@ -45,6 +47,14 @@ public JhipsterCmd getJhipsterCmd() {
return jhipsterCmd;
}

public YqCmd getYqCmd() {
return yqCmd;
}

public void setYqCmd(YqCmd yqCmd) {
this.yqCmd = yqCmd;
}

public NpmCmd getNpmCmd() {
return npmCmd;
}
Expand Down Expand Up @@ -121,6 +131,28 @@ public void setTimeout(Integer timeout) {
}
}

public static class YqCmd {

private String cmd = "yq";
private Integer timeout = 120;

public String getCmd() {
return cmd;
}

public void setCmd(String cmd) {
this.cmd = cmd;
}

public Integer getTimeout() {
return timeout;
}

public void setTimeout(Integer timeout) {
this.timeout = timeout;
}
}

public static class Github {

private String clientId;
Expand Down
Loading