LogoLogo
  • Adapptio User Documentation
  • Getting Started
    • Quickstart
    • Architecture Overview
      • Views
      • Actions
      • Integrations
      • API Endpoints
      • Routes
      • Events
      • Assets
    • Editor
      • Main Menu
        • Create New Resources
        • Manage the Application
        • Monitoring Errors
      • Main Toolbar
        • Deploying the Application
        • Opening the Application
        • Preview Mode
        • Error Monitor
      • Components Panel
        • Components
        • Inspector
        • View Settings
      • Outline Panel
        • Data Variables
          • State Variable
          • Data From Action
      • Data Explorer
      • Console
    • Playground
  • Working with Adapptio
    • Best Practices
    • Tutorials
      • 1. Hello World
      • 2. Visualize Data from API
      • 3. Advanced Layout Application
      • 4. Application with In-Memory Database
    • How To
      • Custom Auth
      • Action Logic
        • Transform Node
      • UI Logic
        • Logout
        • Conditional Render
        • One Of
      • Data & Dynamic values
        • Custom Variable
        • Data from Action
        • Dynamic Value
        • Change Value from Event
        • Loading Data from Action to Form
        • Sending Data to Action from a Form
        • Server-side Dropdown Autocompletion
      • Visual
        • Styling Icon Button
      • Layouts
        • Centered Box
        • Header & Sidebar Layout
        • Grid Form Layout
        • Stretched Layout in Row
    • Components
      • Composed Chart
      • Advanced Table
      • Custom Component
    • Examples of Applications
      • SaaS Platforms
      • Customers Portals
      • Information Systems
      • Internal Tools
        • Color Picker
      • IoT Applications
      • Smart Portals
      • Analytics & Calculators
      • Statistics & Monitoring Panels
      • API Data Visualization
      • Simple Games
  • DEPLOYMENT
    • Cloud Hosted
    • Self Hosted
  • REFERENCE GUIDE
    • Components List
      • Application Header
      • Box
      • Container
      • Grid
      • Sidebar Layout
      • View
      • Text Input
      • Number
      • Checkbox
      • Option
      • Date and Time
      • File Upload
    • Properties
      • ACCEPT
      • CUSTOM PLACEHOLDER
      • DESCRIPTION
      • ENABLED
      • FONT SIZE
      • FOREGROUND COLOR
      • FORM DATA KEY
      • HEADERS
      • ICON
      • ID
      • LABEL
      • METHOD
      • MULTIPLE
      • MAX FILE SIZE
      • REQUEST TIMEOUT
      • REQUIRED
      • READ-ONLY
      • SIZE
      • TEXT ALIGNMENT
      • TEXT STYLE
      • URL
      • UPLOAD IMMEDIATELY
      • VALIDATE
      • VALUE
    • Functions
      • Array
      • Date
      • Generators
      • JSON
      • Logic
      • Math
      • Object
      • String
      • Types
      • Util
  • Support
    • Get in touch
    • Release Notes
  • Legal
    • Terms and Conditions
    • GDPR
Powered by GitBook
On this page
  • Building image with GitLab CI/CD pipeline
  • Testing deployment using Docker compose

Was this helpful?

  1. DEPLOYMENT

Self Hosted

More about deploying Adapptio on your own infrastructure.

First you need to obtain token allows you to access Adapptio repository. For this, please, contact us.

Building image with GitLab CI/CD pipeline

Create new repositry

Once you have created a new repository, you also need to add several variables to your pipeline. Go to the CI/CD Gitlab settings (Settings -> CI/CD -> Variables) and add:

  1. ARTIFACTS_LOGIN = <your-app-id>

  2. ARTIFACTS_TOKEN = <obtained-token>

Dockerfile

Add to your repository this dockerfile.

prod.Dockerfile
ARG BASE_TAG

FROM ${BASE_IMAGE}:${BASE_TAG} as runtime

ARG BLUEPRINTS_DIR

# add blueprints
RUN rm -rf ./repo
ADD ${BLUEPRINTS_DIR} ./repo

CI/CD pipeline

And finaly add the CI/CD files and fill all the variables in the .param.yaml and .gitlab-ci.yaml file (section between lines 16 and 24).

.params.yaml
variables:
  # Change this to update Adapptio runtime image
  # Example "v9597de1b-master"
  BASE_TAG: "<adapptio-image-version>"
  # Change this to update application version
  # Example: "v3"
  BLUEPRINT_TAG: "<application-version>"
.gitlab-ci.yml
 include: ".params.yaml"
 
 services:
   - docker:20.10.2-dind

stages:
  - download-blueprints
  - build-image

variables:
  IMAGE_NAME: ${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}
  IMAGE_TAG: v${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_REF_SLUG}
  BASE_IMAGE: "artifacts.adapptio.app:5000/adapptio/hae/app"
  REPO_BASE_URL: "https://artifacts.adapptio.app:5001/artifacts"
  
  # ---
  # SETUP THIS VARIABLES
  # Set UUID of your organization
  # Example: "b9fbdcb2-fe44-45a6-836e-585715b3457a"
  REPO_ORG_ID: "<your-org-id>"
  # Set UUID of your application
  # Example: "83110cc7-ea98-4a8f-a2ef-68f9d6fe1b27"
  REPO_APP_ID: "<your-app-id>"
  # ---
  
download-blueprints:
  stage: download-blueprints
  image:
    name: ubuntu:latest
  script:
    - apt-get update && apt-get -y install wget
    - |
      wget \
        --user="${ARTIFACTS_LOGIN}" \
        --password="${ARTIFACTS_TOKEN}" \
        -O ./blueprints.tar.gz \
        ${REPO_BASE_URL}/${REPO_ORG_ID}/${REPO_APP_ID}/${BLUEPRINT_TAG}.tar.gz
    - tar -xf ./blueprints.tar.gz
  artifacts:
    paths:
      - ./${REPO_APP_ID}
    expire_in: 1 hour

build-image:
  stage: build-image
  image:
    name: gcr.io/kaniko-project/executor:v1.9.0-debug
    entrypoint: [""]
  before_script:
    - echo "Building ${IMAGE_NAME}:${IMAGE_TAG}"
    - echo -n ${IMAGE_TAG} > version
    - mkdir -p /kaniko/.docker
    - |
      echo "{ \"auths\": { \"$CI_REGISTRY\": { \"username\": \"${CI_REGISTRY_USER}\", \"password\": \"${CI_REGISTRY_PASSWORD}\" }, \"artifacts.adapptio.app:5000\": { \"username\": \"${ARTIFACTS_LOGIN}\", \"password\": \"${ARTIFACTS_TOKEN}\" }} }" > /kaniko/.docker/config.json
  script:
    - |
      /kaniko/executor  --context ${CI_PROJECT_DIR} \
                        --dockerfile ${CI_PROJECT_DIR}/prod.Dockerfile \
                        --destination ${IMAGE_NAME}:${IMAGE_TAG} \
                        --build-arg BASE_IMAGE="${BASE_IMAGE}" \
                        --build-arg BASE_TAG="${BASE_TAG}" \
                        --build-arg BLUEPRINTS_DIR="./${REPO_APP_ID}"

Testing deployment using Docker compose

Create docker compose file in a workspace on your computer.

docker-compose.yaml
services:
  adapptio:
    image: "registry.gitlab.com/<your-gitlab-project>:<app-image-version>"
    ports:
      - "8080:8080"
    environment:
      - NODE_ENV=production
      - APP_MANIFEST_PATH=/app/hae-bld-app/repo
      - APP_ID=<your-application-id>
      - APP_ENV_ID=<your-application-environment-id>
      - APP_NAME=<application-name>
      - APP_URL=localhost:8080
      - APP_URL_PROTOCOL=<http|https>
      - SESSION_SECRET=<session-secret>
      - ...<YOUR_OWN_ENV_VARS>

Run docker and type:

cd <your-workspace-folder>
docker-compose up

The application should be available at URL:

https://localhost:8080
PreviousCloud HostedNextComponents List

Last updated 2 years ago

Was this helpful?