Add docker building gitlab ci pipeline

Change-Id: Ia9da21ad5a803677ea9925f207a55690fc445a68
diff --git a/.gitignore b/.gitignore
index 57d3696..1146018 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,12 +1,193 @@
-.*
-!/.gitignore
-!/.github
-plugin/target
+# Compiled class files
+*.class
+
+# Log files
+*.log
+
+# BlueJ files
+*.ctxt
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files
+*.jar
+*.war
+*.nar
+*.ear
+*.zip
+*.tar.gz
+*.rar
+
+# Virtual machine crash logs
+hs_err_pid*
+replay_pid*
+
+# Maven
+target/
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+pom.xml.next
+release.properties
 dependency-reduced-pom.xml
+buildNumber.properties
+.mvn/timing.properties
+.mvn/wrapper/maven-wrapper.jar
+
+# Gradle
+.gradle
+build/
+!gradle/wrapper/gradle-wrapper.jar
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+# IntelliJ IDEA
+.idea/
+*.iws
+*.iml
+*.ipr
+out/
+!**/src/main/**/out/
+!**/src/test/**/out/
+
+# Eclipse
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+bin/
+!**/src/main/**/bin/
+!**/src/test/**/bin/
+
+# NetBeans
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+
+# VS Code
+.vscode/
+
+# Mac
+.DS_Store
+
+# Windows
+Thumbs.db
+ehthumbs.db
+Desktop.ini
+
+# Linux
+*~
+
+# Temporary files
+*.tmp
+*.temp
+*#
+
+# Application specific
 /sandbox
 /Sandbox
-/target
 /plugin
 /src/main/resources/*_exportPlugin.conf
-/bin/
-*#
+
+# Docker
+.dockerignore
+
+# GitLab CI
+.gitlab-ci-local/
+
+# Logs
+logs/
+*.log
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Coverage directory used by tools like istanbul
+coverage/
+*.lcov
+
+# nyc test coverage
+.nyc_output
+
+# Dependency directories
+node_modules/
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Microbundle cache
+.rpt2_cache/
+.rts2_cache_cjs/
+.rts2_cache_es/
+.rts2_cache_umd/
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variables file
+.env
+.env.test
+.env.production
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+# parcel-bundler cache (https://parceljs.org/)
+.cache
+.parcel-cache
+
+# Next.js build output
+.next
+
+# Nuxt.js build / generate output
+.nuxt
+dist
+
+# Gatsby files
+.cache/
+public
+
+# Storybook build outputs
+.out
+.storybook-out
+
+# Temporary folders
+tmp/
+temp/
+
+# Editor directories and files
+.vscode/
+.idea/
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
+
+# OS generated files
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..b7d5225
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,84 @@
+# GitLab CI/CD Pipeline for Kalamar-Plugin-Export
+# This pipeline runs tests on pushes and builds Docker containers on tag pushes and manual triggers
+
+stages:
+  - test
+  - build
+  - deploy
+
+variables:
+  MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
+  MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version"
+  DOCKER_IMAGE_NAME: "korap/kalamar-plugin-export"
+
+# Cache Maven dependencies
+cache:
+  paths:
+    - .m2/repository/
+
+# Test stage - runs on all pushes
+test:
+  stage: test
+  image: eclipse-temurin:22-jdk-alpine
+  before_script:
+    - apk add --no-cache maven
+    - export MAVEN_OPTS="$MAVEN_OPTS"
+  script:
+    - mvn $MAVEN_CLI_OPTS clean test
+  artifacts:
+    reports:
+      junit:
+        - target/surefire-reports/TEST-*.xml
+    paths:
+      - target/surefire-reports/
+    expire_in: 1 week
+  only:
+    - pushes
+    - merge_requests
+
+# Build Docker image stage - available on all branches but only runs manually
+build-docker:
+  stage: build
+  image: docker:24.0.5
+  services:
+    - docker:24.0.5-dind
+  before_script:
+    - apk add --no-cache xz
+  script:
+    - export IMAGE_TAG=${CI_COMMIT_TAG:-latest}
+    - export ARTIFACT_NAME=kalamar-plugin-export-${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}.tar.xz
+    - docker build -t $DOCKER_IMAGE_NAME:$IMAGE_TAG .
+    - docker build -t $DOCKER_IMAGE_NAME:latest .
+    - docker save $DOCKER_IMAGE_NAME:$IMAGE_TAG | xz -c > $ARTIFACT_NAME
+    - ls -lh $ARTIFACT_NAME
+  artifacts:
+    name: "$ARTIFACT_NAME"
+    paths:
+      - "*.tar.xz"
+    expire_in: 30 days
+  when: manual
+  allow_failure: false
+
+# Security scan stage (optional)
+security-scan:
+  stage: build
+  image: eclipse-temurin:22-jdk-alpine
+  before_script:
+    - apk add --no-cache maven
+  script:
+    - mvn $MAVEN_CLI_OPTS clean compile
+  allow_failure: true
+  when: manual
+
+# Deploy stage (placeholder for actual deployment)
+deploy:
+  stage: deploy
+  image: alpine:latest
+  before_script:
+    - apk add --no-cache curl
+  script:
+    - curl --version
+  only:
+    - tags
+  when: manual
+  allow_failure: false