Skip to content

Commit

Permalink
Add info for mailer extension, add note about cronJob deployment bug …
Browse files Browse the repository at this point in the history
…to keep reference
  • Loading branch information
The-Huginn committed Feb 22, 2024
1 parent b2894e3 commit 47b4a14
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 67 deletions.
77 changes: 11 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ Fork this repository to your GitHub account.
3. Add the following variable to the `.env` file:
```env
jira-issue-lottery.access-token=<YOUR TOKEN>
QUARKUS_MAILER_FROM=<email address>
QUARKUS_MAILER_USERNAME=<email address>
QUARKUS_MAILER_PASSWORD=<email password>
**QUARKUS_MAILER_PASSWORD**
value of **<email_password>** is password to the email address corresponding to **QUARKUS_MAILER_USERNAME**. **Note** You probably want to generate it using _Gmail_ > _Settings_ > _Security_ > _2-Step Verification_ > _App passwords_
***Default email service***
is Gmail. To change this behavior or to override predefined parameters in _applications.properties_ file please refer to [Mailer Extension Documentation](https://quarkus.io/guides/mailer-reference#popular)
## Production deployment
1. Log into your Openshift
Expand All @@ -78,7 +87,7 @@ oc create secret generic jira-lottery
--from-literal=QUARKUS_MAILER_USERNAME={TBD}
--from-literal=QUARKUS_MAILER_PASSWORD={TBD}
```
3. Build the application, this step will eventually fail
3. Build the application, this step will eventually fail due to bug in quarkus
> **_NOTE:_** You can use script `deploy.sh` for convenience.
```shell
./mvnw clean package -Dquarkus.openshift.deploy=true
Expand All @@ -91,68 +100,4 @@ And in file `openshift.yml` delete the following line `selector: {}`
5. Deploy the YAML file
```shell
oc apply -f openshift.yml
```


## Running the application in dev mode

You can run your application in dev mode that enables live coding using:
```shell script
./mvnw compile quarkus:dev
```

> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
## Packaging and running the application

The application can be packaged using:
```shell script
./mvnw package
```
It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory.
Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.

The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`.

If you want to build an _über-jar_, execute the following command:
```shell script
./mvnw package -Dquarkus.package.type=uber-jar
```

The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`.

## Creating a native executable

You can create a native executable using:
```shell script
./mvnw package -Pnative
```

Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
```shell script
./mvnw package -Pnative -Dquarkus.native.container-build=true
```

You can then execute your native executable with: `./target/jira-lottery-1.0.0-SNAPSHOT-runner`

If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.

## Related Guides

- Camel Jira ([guide](https://camel.apache.org/camel-quarkus/latest/reference/extensions/jira.html)): Interact with JIRA issue tracker
- Picocli ([guide](https://quarkus.io/guides/picocli)): Develop command line applications with Picocli

## Provided Code

### Picocli Example

Hello and goodbye are civilization fundamentals. Let's not forget it with this example picocli application by changing the <code>command</code> and <code>parameters</code>.

[Related guide section...](https://quarkus.io/guides/picocli#command-line-application-with-multiple-commands)

Also for picocli applications the dev mode is supported. When running dev mode, the picocli application is executed and on press of the Enter key, is restarted.

As picocli applications will often require arguments to be passed on the commandline, this is also possible in dev mode via:
```shell script
./mvnw compile quarkus:dev -Dquarkus.args='Quarky'
```
```
4 changes: 4 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Tracker issue for quarkus bug. This script serves
# as a workaround for the time being.
# issue: https://github.com/quarkusio/quarkus/issues/38880
# Please delete this script once the fix is released
./mvnw clean package -Dquarkus.kubernetes.deploy=true
sed -i '/^\s*selector: {}/d' target/kubernetes/openshift.yml
oc apply -f target/kubernetes/openshift.yml
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ quarkus.openshift.env.secrets=jira-lottery
quarkus.openshift.labels.app=jira-issue-lottery

# These 2 options are disabled to remove labels from selector field. However,
# a manual removal of selector field all together is needed in the generated yml file under target/kubernetes
# a manual removal of selector field all together is needed in the generated yml file under target/kubernetes.
# [Tracker] Currently filled issue in quarkus: https://github.com/quarkusio/quarkus/issues/38880
quarkus.openshift.add-version-to-label-selectors=false
quarkus.openshift.add-name-to-label-selectors=false

Expand Down

0 comments on commit 47b4a14

Please sign in to comment.