Using Onboardbase CLI with self-hosted version
Onboardbase SDK connects directly with the Cloud Service without any configuration. With the Self-Hosted version, some configurations are required with any client to point the SDK/CLI to the hosted service.
Onboardbase CLI
The CLI has a config:set
command that updates its configuration as a context for the next set of commands.
To connect the CLI to a hosted backend service at https://onboardase-api-service.host.local, and the frontend https://onboardase-frontend-service.host.local, run the below command:
onboardbase config:set \
--api-host=https://onboardase-api-service.host.local
--api-host=https://onboardase-frontend-service.host.local
Now, when you run any command, e.g onboardbase secrets -p PROJECT -e ENV
, the CLI sends this request to your hosted version instead of the cloud service.
or a Dockerfile
FROM node:alpine
WORKDIR workdir
ARG ONBOARDBASE_TOKEN=""
ARG ONBOARDBASE_PROJECT_NAME=""
ARG ONBOARDBASE_ENVIRONMENT=""
ENV ONBOARDBASE_TOKEN=${ONBOARDBASE_TOKEN}
ENV ONBOARDBASE_PROJECT=${ONBOARDBASE_PROJECT}
ENV ONBOARDBASE_ENVIRONMENT=${ONBOARDBASE_ENVIRONMENT}
RUN yarn global add @onboardbase/cli@latest
RUN onboardbase config:set \
--token=${ONBOARDBASE_TOKEN}
--api-host=https://onboardase-api-service.host.local
--api-host=https://onboardase-frontend-service.host.local
RUN onboardbase run "build" -p $ONBOARDBASE_PROJECT -e $ONBOARDBASE_ENVIRONMENT
# the -p, -e flags are not required since there are both part of the environment variables
# the CLI picks up the values of ONBOARDBASE_TOKEN, ONBOARDBASE_PROJECT, ONBOARDBASE_ENVIRONMENT
# from the environment variables if they are set, if not
# it expects both environment and project to be set when calling the run command through flags
# or the .onboardbase.yaml file
# a cleaner version could be
#
# RUN onboardbase config:set \
# --api-host=https://onboardase-api-service.host.local
# --api-host=https://onboardase-frontend-service.host.local
#
# RUN onboardbase run "build"
# CMD ["onboardbase", "run 'node /workdir/index.js'"]
#
# which includes the config:set, and build commands as well
CMD ["onboardbase", "run 'node /workdir/index.js'", "-e ${ONBOARDBASE_ENVIRONMENT}", "-p ${ONBOARDBASE_PROJECT}"]
Updated about 2 months ago