From 2c717d2efb8673356594492b57b4faf2bde41fc9 Mon Sep 17 00:00:00 2001
From: Ikhsanul Akbar Rasyid <ikhsanul.akbar@ui.ac.id>
Date: Sat, 7 Jan 2023 13:15:37 +0700
Subject: [PATCH] Update .gitlab-ci.yml file

---
 .gitlab-ci.yml | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ad607bd..f327079 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,33 +1,35 @@
+cache:
+  paths:
+  - ~/.m2/repository
+variables:
+  MAVEN_CLI_OPTS: -s .mvn/settings.xml --batch-mode
+  MAVEN_OPTS: -Dmaven.repo.local=.m2/repository
 stages:
 - build
 - test
 - deploy
-before_script:
-- npm install -g create-react-app
-build-frontend:
+build:
   stage: build
-  image: node
+  image: openjdk:14-jdk
   script:
-  - npm install
-  - npm run build
+  - mvn install
+  - mvn $MAVEN_CLI_OPTS clean package
+  artifacts:
+    paths:
+    - target/*.jar
   only:
   - main
-test-frontend:
+test:
   stage: test
-  image: node
+  image: openjdk:14-jdk
   script:
-  - npm install
-  - CI=true npm test
+  - mvn $MAVEN_CLI_OPTS test
   only:
   - main
-deploy-frontend:
+deploy:
   stage: deploy
-  image: node
+  image: openjdk:14-jdk
   script:
-  - npm run build
-  - cp .env.production build/.env
-  - rsync -avz --delete-after --quiet $CI_PROJECT_DIR/build/ user@yourserver:/var/www/your-react-app/
-  environment:
-    name: production
+  - bash ./deploy.sh
   only:
   - main
-- 
GitLab