Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 39 additions & 2 deletions .github/workflows/snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,38 @@ jobs:
with:
name: artifacts
path: ublhub-container-image.tar

operator-container:
name: Operator container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: maven
- name: Build container image
run: |
mvn -U -B package --file pom.xml -DskipTests \
-Dquarkus.native.container-build=true \
-Dquarkus.container-image.push=false \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.registry=quay.io \
-Dquarkus.container-image.group=projectopenubl \
-Dquarkus.container-image.name=ublhub-operator \
-Dquarkus.container-image.tag=latest \
-P native \
-f operator
- name: Save container image
run: docker save -o ublhub-operator-container-image.tar quay.io/projectopenubl/ublhub-operator:latest
- name: Upload container image
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ublhub-operator-container-image.tar

publish-container:
needs: [ application-container ]
needs: [ application-container, operator-container ]
name: Publish container
runs-on: ubuntu-latest
steps:
Expand All @@ -62,11 +91,19 @@ jobs:
run: |
# Load images from .tar
docker load -i artifacts/ublhub-container-image.tar
docker load -i artifacts/ublhub-operator-container-image.tar

# Tag images
docker tag quay.io/projectopenubl/ublhub:latest quay.io/projectopenubl/ublhub:nightly
docker tag quay.io/projectopenubl/ublhub:latest ghcr.io/project-openubl/ublhub/ublhub:nightly

docker tag quay.io/projectopenubl/ublhub-operator:latest quay.io/projectopenubl/ublhub-operator:nightly
docker tag quay.io/projectopenubl/ublhub-operator:latest ghcr.io/project-openubl/ublhub/ublhub-operator:nightly

- name: Push images to registry
run: |
docker push quay.io/projectopenubl/ublhub:nightly
docker push ghcr.io/project-openubl/ublhub/ublhub:nightly

docker push quay.io/projectopenubl/ublhub-operator:nightly
docker push ghcr.io/project-openubl/ublhub/ublhub-operator:nightly
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ nb-configuration.xml
.env

# Distribution
!src/main/distribution/*
!application/src/main/distribution/*

workspace/*
src/jreleaser/templates/article/openapi.*
application/workspace/*
jreleaser/templates/article/openapi.*
48 changes: 3 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,13 @@

Microservicio que administra tus XMLs emitidos a la SUNAT.

## Ejecutar en modo desarrollo

### Iniciar servidor

Puedes ejecutar la aplicación en modo desarrollo con:

```shell script
./mvnw compile quarkus:dev
```

### Iniciar UI

Instala las dependencias npm:

```shell
npm install --prefix src/main/webapp
```

Inicia la UI en modo desarrollo:

```shell
npm run start --prefix src/main/webapp
```

## Desplegar en Minikube

- Instala e inicia una instancia de Minikube
- Create un namespace `openubl`
- Create un PVC para la base de datos
- Despliega Ublhub

```shell
minikube start
kubectl create ns openubl
kubectl create -f src/main/kubernetes/minikube-pvc.yml -n openubl
eval $(minikube -p minikube docker-env)
mvn clean package -Dquarkus.kubernetes.deploy=true -Dquarkus.kubernetes.namespace=openubl -DskipTests
```

Expone Ublhub usando:

```shell
minikube service ublhub -n openubl
```
- [Application](./application)
- [Operator](./operator)

## Links

- [Documentación](https://project-openubl.github.io)
- [Discusiones](https://github.com/project-openubl/ublhub/discussions)
- [Discusiones](https://github.com/project-openubl/searchpe/discussions)

## License

Expand Down
7 changes: 1 addition & 6 deletions application/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
![CI](https://github.com/project-openubl/ublhub/workflows/CI/badge.svg)
[![License](https://img.shields.io/badge/Apache-2.0-green.svg)](https://www.apache.org/licenses/LICENSE-2.0)

[![Project Chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg?style=for-the-badge&logo=zulip)](https://projectopenubl.zulipchat.com/)

# Ublhub

Microservicio que administra tus XMLs emitidos a la SUNAT.
Expand All @@ -14,7 +9,7 @@ Microservicio que administra tus XMLs emitidos a la SUNAT.
Puedes ejecutar la aplicación en modo desarrollo con:

```shell script
./mvnw compile quarkus:dev
mvn compile quarkus:dev
```

### Iniciar UI
Expand Down
141 changes: 141 additions & 0 deletions application/src/main/distribution/bin/standalone.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
@REM
@REM Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
@REM and other contributors as indicated by the @author tags.
@REM
@REM Licensed under the Apache License, Version 2.0 (the "License");
@REM you may not use this file except in compliance with the License.
@REM You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing, software
@REM distributed under the License is distributed on an "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@REM See the License for the specific language governing permissions and
@REM limitations under the License.
@REM

@echo off
rem -------------------------------------------------------------------------
rem Ublhub Bootstrap Script for Windows
rem -------------------------------------------------------------------------

@if not "%ECHO%" == "" echo %ECHO%
setlocal

if "%OS%" == "Windows_NT" (
set "DIRNAME=%~dp0%"
) else (
set DIRNAME=.\
)

:MAIN
rem $Id$
)

pushd "%DIRNAME%.."
set "RESOLVED_UBLHUB_HOME=%CD%"
popd

if "x%UBLHUB_HOME%" == "x" (
set "UBLHUB_HOME=%RESOLVED_UBLHUB_HOME%"
)

pushd "%UBLHUB_HOME%"
set "SANITIZED_UBLHUB_HOME=%CD%"
popd

if /i "%RESOLVED_UBLHUB_HOME%" NEQ "%SANITIZED_UBLHUB_HOME%" (
echo.
echo WARNING: UBLHUB_HOME may be pointing to a different installation - unpredictable results may occur.
echo.
echo UBLHUB_HOME: "%UBLHUB_HOME%"
echo.
)

if "x%JAVA_HOME%" == "x" (
set JAVA=java
echo JAVA_HOME is not set. Unexpected results may occur.
echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
) else (
if not exist "%JAVA_HOME%" (
echo JAVA_HOME "%JAVA_HOME%" path doesn't exist
goto END
) else (
if not exist "%JAVA_HOME%\bin\java.exe" (
echo "%JAVA_HOME%\bin\java.exe" does not exist
goto END_NO_PAUSE
)
echo Setting JAVA property to "%JAVA_HOME%\bin\java"
set "JAVA=%JAVA_HOME%\bin\java"
)
)

"%JAVA%" --add-modules=java.se -version >nul 2>&1 && (set MODULAR_JDK=true) || (set MODULAR_JDK=false)

if not "%PRESERVE_JAVA_OPTS%" == "true" (
rem Add -client to the JVM options, if supported (32 bit VM), and not overriden
echo "%JAVA_OPTS%" | findstr /I \-server > nul
if errorlevel == 1 (
"%JAVA%" -client -version 2>&1 | findstr /I /C:"Client VM" > nul
if not errorlevel == 1 (
set "JAVA_OPTS=-client %JAVA_OPTS%"
)
)
)

rem Find quarkus-run.jar, or we can't continue
if exist "%UBLHUB_HOME%\quarkus-run.jar" (
set "RUNJAR=%UBLHUB_HOME%\quarkus-run.jar"
) else (
echo Could not locate "%UBLHUB_HOME%\quarkus-run.jar".
echo Please check that you are in the bin directory when running this script.
goto END
)

rem Setup JBoss specific properties

rem Setup directories, note directories with spaces do not work
setlocal EnableDelayedExpansion
set "CONSOLIDATED_OPTS=%JAVA_OPTS% %SERVER_OPTS%"
set baseDirFound=false
set configDirFound=false
set logDirFound=false
for %%a in (!CONSOLIDATED_OPTS!) do (
if !baseDirFound! == true (
set "UBLHUB_BASE_DIR=%%~a"
set baseDirFound=false
)
)
setlocal DisableDelayedExpansion

rem Set the standalone base dir
if "x%UBLHUB_BASE_DIR%" == "x" (
set "UBLHUB_BASE_DIR=%UBLHUB_HOME%\standalone"
)

echo ===============================================================================
echo.
echo Ublhub Bootstrap Environment
echo.
echo UBLHUB_HOME: "%UBLHUB_HOME%"
echo.
echo JAVA: "%JAVA%"
echo.
echo ===============================================================================
echo.

cd "%UBLHUB_HOME%"

:RESTART
"%JAVA%" %JAVA_OPTS% ^
-jar "%UBLHUB_HOME%\quarkus-run.jar"

if %errorlevel% equ 10 (
goto RESTART
)

:END
if "x%NOPAUSE%" == "x" pause

:END_NO_PAUSE
Loading