Deploy to AppSail

After building and testing your application, it has to be deployed to any virtual machine for users to use it. You can customize the deployment flow in the pipeline based on your specific needs. You can either automate the entire process or partially automate it by including an approval job to complete the deployment process.

Here’s a sample YAML code snippet that can be used to deploy a Java application built using Springboot framework in Catalyst AppSail service.

Before executing the pipeline, you will have to configure the following keys as global variables in your pipeline. You can refer this help section to learn about configuring variables.

  • CATALYST_TOKEN : A unique token to access the Catalyst CLI from the YAML. Refer to this help page to learn more about token generation.

  • DOCKER_PASS : The password of your Docker Hub account.

  • BUCKET_NAME : The name of your Stratus bucket.

copy
version: 1.0
runners:
  high:
    config-id: 3
pipeline-when:
  equal:
    - << event.ref >>
    - refs/heads/main
images:
  maven:
    image: maven:3.8.5-openjdk-17
    auth:
      username: ameliaburrows
      password: << env.DOCKER_PASS >>
jobs:
  unit-test:
    steps:
      - mvn surefire-report:report
    artifacts:
      upload:
        - type: zip
          regex:
            -  /catalyst/target/surefire-reports/**
          name: junit.zip
          location: stratus://<< env.BUCKET_NAME >>/
  package:
    steps:
      - mvn clean package -DskipTests=true
    artifacts:
      upload:
        - type: file
          name: SNAPSHOT.jar
          file: target/demo-0.0.1-SNAPSHOT.jar
          location: stratus://<< env.BUCKET_NAME >>/
  catalyst-deploy:
    when:
      equal:
        - << status.build.package >>
        - success
    steps:
      - npm install -g zcatalyst-cli@beta
      - >-
        catalyst deploy appsail --name spring-boot --build-path
        "/catalyst/SNAPSHOT.jar" --stack java17 --platform javase --command "sh
        -c 'java -jar SNAPSHOT.jar
        --server.port=\${X_ZOHO_CATALYST_LISTEN_PORT}'" --verbose
    artifacts:
      download:
        - type: file
          name: SNAPSHOT.jar
          file: /SNAPSHOT.jar
          location: stratus://<< env.BUCKET_NAME >>/
stages:
  - name: test
    image: maven
    jobs:
      - unit-test
  - name: build
    image: maven
    jobs:
      - package
  - name: deploy
    jobs:
      - catalyst-deploy

Last Updated 2025-05-30 16:54:59 +0530 IST

ON THIS PAGE

RELATED LINKS

Catalyst AppSail