Coder Social home page Coder Social logo

servoy-tomcat-builder's Introduction

servoy-tomcat-builder

This GitHub Action allows users to create Tomcat Docker images that come bundled with a WAR built from our Servoy WAR Builder action.

See the LICENSE for more information on the dual licensing for commercial projects.

Examples

Note: We rely on the Docker Login action to authenticate with whichever Docker container registry you would like to use. We only list some of the ways you can login and upload your images below, but any of the services listed in the Docker Login action should function properly with this action.

Upload to GitHub Container Registry

name: Servoy WAR Build & Tomcat GHCR
on: push
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
     - name: Checkout                            # Checkout the repo
       uses: actions/checkout@v2
     - name: Docker Login                        # Login to the GitHub Container Registry
       uses: docker/login-action@v3
       with:
         registry: ghcr.io
         username: ${{ github.actor }}
         password: ${{ secrets.GITHUB_TOKEN }}
     - name: Servoy WAR Build                    # Build our WAR file
       uses: itechpros/servoy-war-builder@v1
       with:
         servoy-version: 2023.03.2.3844
         # ...
         war-file-name: MySolution.war
     - name: Build and upload Tomcat image       # Generate and push a Docker image that contains our generated WAR file to the GitHub Container Registry
       uses: itechpros/servoy-tomcat-builder@v1
       with:
         tomcat-version: 10
         java-version: 11
         war-file: MySolution.war

Upload to Docker Hub

name: Servoy WAR Build & Tomcat Docker Hub
on: push
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
     - name: Checkout                            # Checkout the repo
       uses: actions/checkout@v2
     - name: Docker Login                        # Login to Docker Hub
       uses: docker/login-action@v3
       with:
         username: ${{ secrets.DOCKERHUB_USERNAME }}
         password: ${{ secrets.DOCKERHUB_TOKEN }}
     - name: Servoy WAR Build                    # Build our WAR file
       uses: itechpros/servoy-war-builder@v1
       with:
         servoy-version: 2023.03.2.3844
         # ...
         war-file-name: MySolution.war
     - name: Build and upload Tomcat image       # Generate and push a Docker image that contains our generated WAR file to Docker Hub
       uses: itechpros/servoy-tomcat-builder@v1
       with:
         tomcat-version: 10
         java-version: 11
         war-file: MySolution.war
         image-name: myorg/myrepo                # Image name in a Docker Hub-friendly format

Upload to Amazon ECR

name: Servoy WAR Build & Tomcat Amazon ECR
on: push
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
     - name: Checkout                                   # Checkout the repo
       uses: actions/checkout@v2
     - name: Docker Login                               # Login to your AWS ECR
       uses: docker/login-action@v3
       with:
         registry: <aws-account-number>.dkr.ecr.<region>.amazonaws.com
         username: ${{ secrets.AWS_ACCESS_KEY_ID }}
         password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
     - name: Servoy WAR Build                           # Build our WAR file
       uses: itechpros/servoy-war-builder@v1
       with:
         servoy-version: 2023.03.2.3844
         # ...
         war-file-name: MySolution.war
     - name: Build and upload Tomcat image              # Generate and push a Docker image that contains our generated WAR file to the AWS ECR
       uses: itechpros/servoy-tomcat-builder@v1
       with:
         tomcat-version: 10
         java-version: 11
         war-file: MySolution.war
         image-name: <aws-account-number>.dkr.ecr.<region>.amazonaws.com/hello-world  # Image name in a AWS ECR-friendly format

Upload to Azure Container Registry

name: Servoy WAR Build & Tomcat Azure CR
on: push
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
     - name: Checkout                                   # Checkout the repo
       uses: actions/checkout@v2
     - name: Docker Login                               # Login to your Azure Container Registry
       uses: docker/login-action@v3
       with:
         registry: <registry-name>.azurecr.io
         username: ${{ secrets.AZURE_CLIENT_ID }}
         password: ${{ secrets.AZURE_CLIENT_SECRET }}
     - name: Servoy WAR Build                           # Build our WAR file
       uses: itechpros/servoy-war-builder@v1
       with:
         servoy-version: 2023.03.2.3844
         # ...
         war-file-name: MySolution.war
     - name: Build and upload Tomcat image              # Generate and push a Docker image that contains our generated WAR file to the Azure CR
       uses: itechpros/servoy-tomcat-builder@v1
       with:
         tomcat-version: 10
         java-version: 11
         war-file: MySolution.war
         image-name: <registry-name>.azurecr.io/myrepo  # Image name in a Azure Container Registry-friendly format

Upload to DigitalOcean Container Registry

name: Servoy WAR Build & Tomcat DigitalOcean
on: push
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
     - name: Checkout                                   # Checkout the repo
       uses: actions/checkout@v2
     - name: Docker Login                               # Login to your Digital Ocean Registry
       uses: docker/login-action@v3
       with:
         registry: registry.digitalocean.com
         username: ${{ secrets.DIGITALOCEAN_TOKEN }}
         password: ${{ secrets.DIGITALOCEAN_TOKEN }}
     - name: Servoy WAR Build                           # Build our WAR file
       uses: itechpros/servoy-war-builder@v1
       with:
         servoy-version: 2023.03.2.3844
         # ...
         war-file-name: MySolution.war
     - name: Build and upload Tomcat image              # Generate and push a Docker image that contains our generated WAR file to DigitalOcean
       uses: itechpros/servoy-tomcat-builder@v1
       with:
         tomcat-version: 10
         java-version: 11
         war-file: MySolution.war
         image-name: registry.digitalocean.com/myorg/myrepo  # Image name in a DigitalOcean-friendly format

Options

  • tomcat-version ๐Ÿ”ด required (see note)
    Version of Tomcat to use in your Docker image. Supported options are: 8, or 9.
    Note: Our Tomcat images are updated monthly with operating system updates as well as the latest minor & patch version of the provided Tomcat version.
    Note: One of the following conditions need to be met:
    • tomcat-version and java-version are specified
    • base-image is specified
  • java-version ๐Ÿ”ด required (see note)
    Version of Java to use in your Docker image. Supported versions are: 8, 11, or 17.
    Note: One of the following conditions need to be met:
    • tomcat-version and java-version are specified
    • base-image is specified
  • base-image ๐Ÿ”ด required (see note)
    Alternate base image to use for the resulting Docker image.
    Note: One of the following conditions need to be met:
    • tomcat-version and java-version are specified
    • base-image is specified
  • war-file ๐Ÿ”ด required
    Path and name of the WAR file to be included in the Docker image. Path should be relative to the root directory of your GitHub repository.
    Examples:
    with:
      # ...
      war-file: MySolution.war      # Use the MySolution.war file in the root directory of the repository
      war-file: bin/MySolution.war  # Use the MySolution.war file in the "bin" directory of the repository
  • tomcat-extras-folder
    Path of the directory that contains files and folders that should be overlayed on top of the existing Tomcat install. This allows you to overwrite files such as conf/server.xml, conf/tomcat-users.xml, conf/web.xml, add any JARs via the lib folder, etc.
    Examples:
    with:
      # ...
      tomcat-extras-folder: my_tomcat_extras  # Overlay the contents of the my_tomcat_extras folder on top of the existing Tomcat install in the Docker image
  • ports
    Comma-delimited list of ports that should be exposed in the Docker image (default: 8080). Note that changing this value requires a change to the port number in the conf/server.xml file.
    Examples:
    with:
      # ...
      ports: 80, 443, 8080  # Allow external connections into the Docker container on ports 80, 443, and 8080.
  • timezone
    Update the timezone that the operating system uses.
    Examples:
    with:
      # ...
      timezone: America/New_York  # Run the operating system on New York time (EST/EDT)
      timezone: UTC               # Run the operating system on UTC time
  • ep-files
    Path of files relative to the Tomcat install directory that should be ran through envplate on server startup.
    Examples:
    with:
      # ...
      ep-files: |
        conf/server.xml
        conf/tomcat-users.xml
        conf/web.xml
  • image-name
    Name of the Docker image. Defaults to the GitHub Container Registry (GHCR) using the user/organization and repository name. For example, if your GitHub repository was octocat/hello-world, the image name would default to ghcr.io/octocat/hello-world.
    Examples:
    with:
      # ...
      image-name: ghcr.io/octocat/hello-world                                  # Build for GitHub Container Registry (GHCR.IO)
      image-name: octocat/hello-world                                          # Build for Docker Hub
      image-name: <aws_account_id>.dkr.ecr.<region>.amazonaws.com/hello-world  # Build for Amazon ECR
      image-name: <registry>.azurecr.io/hello-world                            # Build for Azure Container Registry
  • tag-name
    Name of the tag (version) to use with the Docker image.
    If not specified, the action will look at the most recent commit at the time the build was created and look for [tag-name=mytag123] in the commit message. If the text is found, it uses the value between the equal sign (=) and the right bracket (]), in this case, mytag123 and uses it as the Docker tag name.
    If no tag name was specified in the latest commmit message, it uses the current timestamp in yyyy-MM-dd_HH-mm-ss format.
    Examples:
    with:
      # ...
      tag-name: latest             # Use 'latest' as the Docker image tag
      tag-name: ${{ github.ref }}  # Use the current branch/Git tag/pull request number as the Docker tag

servoy-tomcat-builder's People

Contributors

pbromwelljr avatar sbutlerjr avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.