Self Hosted
More about deploying Adapptio on your own infrastructure.
Last updated
Was this helpful?
Was this helpful?
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>" 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}"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>cd <your-workspace-folder>
docker-compose uphttps://localhost:8080