Skip to content
Snippets Groups Projects
bitbucket-pipelines.yml 1.38 KiB
Newer Older
Zoey76's avatar
Zoey76 committed
image: eclipse-temurin:21.0.1_12-jdk-ubi9-minimal
Zoey76's avatar
Zoey76 committed
definitions:
   caches:
Zoey76's avatar
Zoey76 committed
      game-server: /opt/atlassian/pipelines/agent/build/l2j-server-game
Zoey76's avatar
Zoey76 committed
   branches:
      develop:
Zoey76's avatar
Zoey76 committed
      -  step:
Zoey76's avatar
Zoey76 committed
            caches:
Zoey76's avatar
Zoey76 committed
            - maven
Zoey76's avatar
Zoey76 committed
            - game-server
Zoey76's avatar
Zoey76 committed
            script:
Zoey76's avatar
Zoey76 committed
            - microdnf update -y
            - microdnf install -y git
            - |
               if [ -d "l2j-server-game" ]; then
                 echo "Directory exists, pulling changes..."
                 cd l2j-server-game
                 git pull
               else
                 echo "Directory does not exist, cloning repository..."
                 git clone --depth=1 https://bitbucket.org/l2jserver/l2j-server-game.git
                 cd l2j-server-game
               fi
            - /bin/sh mvnw clean install -DskipTests -Ddependency-check.skip=true
Zoey76's avatar
Zoey76 committed
            - cd ..
      -  step:
Zoey76's avatar
Zoey76 committed
            caches:
Zoey76's avatar
Zoey76 committed
            - maven
            - game-server
Zoey76's avatar
Zoey76 committed
            script:
            - /bin/sh mvnw clean install
Zoey76's avatar
Zoey76 committed
            artifacts:
Zoey76's avatar
Zoey76 committed
            - target/*.zip
      -  step:
Zoey76's avatar
Zoey76 committed
            deployment: Production
            script:
Zoey76's avatar
Zoey76 committed
            -  pipe: atlassian/ftp-deploy:0.6.0
Zoey76's avatar
Zoey76 committed
               variables:
Zoey76's avatar
Zoey76 committed
                  USER: $FTP_USER
                  PASSWORD: $FTP_PASSWORD
                  SERVER: $FTP_HOST
                  REMOTE_PATH: $FTP_REMOTE_PATH
                  LOCAL_PATH: target/