3/03/2025

Jira CLI

 

Example Workflow to Create a Jira Ticket Using Jira CLI



To create a Jira ticket using the Jira CLI, you can use the jira-cli tool, which is a feature-rich command-line interface for interacting with Jira. Below is an example workflow:

Step 1: Install Jira CLI
First, ensure you have the jira-cli tool installed. You can install it using npm:

bash


npm install -g jira-cli

Step 2: Configure Jira CLI
Set up the Jira CLI by providing your Jira instance URL, email, and API token. Run the following command:
bash


jira configure
You will be prompted to enter:
Jira Base URL (e.g., https://yourcompany.atlassian.net)
Email address
API token (you can generate this from your Jira account settings).


Step 3: Create a Jira Ticket
Once configured, you can create a Jira ticket using the jira issue create command. Here's an example:
bash


jira issue create \
  --project "PROJECT_KEY" \
  --type "Task" \
  --summary "This is a sample ticket summary" \
  --description "Detailed description of the issue or task."

Replace PROJECT_KEY with the key of your Jira project (e.g., DEV, IT, etc.).

Replace "Task" with the issue type (e.g., Bug, Story, etc.).

Provide a meaningful summary and description for the ticket.


Step 4: Automate Ticket Creation (Optional)
You can integrate this command into a script or CI/CD pipeline (e.g., GitHub Actions) to automate ticket creation. For example, in a shell script:
bash


#!/bin/bash

jira issue create \
  --project "PROJECT_KEY" \
  --type "Bug" \
  --summary "Automated Bug Report" \
  --description "This bug was automatically reported by the CI/CD pipeline."
This script can be triggered whenever a specific event occurs, such as a failed build or test.
Additional Features
The jira-cli tool also supports other features like:
Transitioning tickets between statuses.
Adding comments to tickets.
Searching for issues.

For more advanced workflows, refer to the official documentation of  Jira Command Line Interface (CLI) | Atlassian Marketplace


More details: GitHub - ankitpokhrel/jira-cli: 🔥 Feature-rich interactive Jira command line.

Create issue based on template:

# Load description from template file
$ jira issue create --template /path/to/template.tmpl

# Get description from standard input
$ jira issue create --template -

# Or, use pipe to read input directly from standard input
$ echo "Description from stdin" | jira issue create -s"Summary" -tTask

2/24/2025

kubectl/k8s Cheat Sheet

 

  • Namespaces
    • List all namespaces: kubectl get namespace
    • Set a namespace: kubens <namespace-name>
    • See currently set namespace: kubens -c
  • Pods
    • List all pods: kubectl get pods
    • List all pods in specific namespace: kubectl get pods -n <namespace>
    • Kill a pod: kubectl delete pod <pod-name>
    • Describe/get details of pod: kubectl describe pods <pod-name>
    • InitContainers
      • Get logs: First describe the pod and look for the name of the init container. Then run kubectl logs <pod-name> -c <init-container-name>
  • Deployments
    • Get the manifest for a deployment: kubectl get deploy <deployment-name> -o yaml
    • Scaling a deployment: kubectl scale --replicas=<n> deployment/<deployment-name>
    • Gen env vars defined on a pod: kubectl exec <pod> -- env
  • ConfigMaps
    • View data in a ConfigMap: kubectl describe configmaps <name>

12/16/2024

Accessing ConfigMap Data in Quarkus

Accessing ConfigMap Data in Quarkus


To retrieve configuration data from a Kubernetes ConfigMap in a Quarkus application, you can utilize the quarkus-kubernetes-config extension, which simplifies the integration of Kubernetes ConfigMaps and Secrets into your application. 
Here’s how you can do it:


Step 1: Add the Extension

First, ensure that you have the quarkus-kubernetes-config extension added to your Quarkus project. You can add it using the following command:
bash
./mvnw quarkus:add-extension -Dextensions="kubernetes-config"


Step 2: Create a ConfigMap

Create a ConfigMap in your Kubernetes cluster that contains the configuration properties you want to use. For example, you can create a ConfigMap named app-config with the following YAML:
yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
  greeting: "Hello, Quarkus!"
  port: "8080"
Apply this ConfigMap to your Kubernetes cluster:
bash
kubectl apply -f configmap.yaml


Step 3: Configure Quarkus to Use the ConfigMap

In your application.properties file, you can specify that Quarkus should read configuration values from the ConfigMap. For example:
properties
quarkus.kubernetes-config.config-map=app-config


Step 4: Access the Configuration in Your Application

You can access the values stored in the ConfigMap using the @ConfigProperty annotation in your Quarkus application. Here’s an example of how to do this:
java
import io.quarkus.arc.properties.UnlessBuildProfile;
import io.quarkus.runtime.Startup;
import org.eclipse.microprofile.config.inject.ConfigProperty;

import javax.enterprise.context.ApplicationScoped;

@ApplicationScoped
@Startup
public class GreetingService {

    @ConfigProperty(name = "greeting")
    String greeting;

    @ConfigProperty(name = "port")
    int port;

    public String getGreeting() {
        return greeting;
    }

    public int getPort() {
        return port;
    }
}


Conclusion

By following these steps, you can easily access configuration data from a Kubernetes ConfigMap in your Quarkus application. This approach allows you to manage your application's configuration dynamically, making it more adaptable to different environments without changing the codebase. The use of ConfigMaps enhances the flexibility and maintainability of your applications deployed on Kubernetes.

QUARKUS & GraphQL

 QUARKUS & GraphQL https://www.geeksforgeeks.org/graphql-tutorial/ https://quarkus.io/guides/smallrye-graphql-client https://www.mastert...