Custom Domain
Custom domain configuration documentation.
IaaS (Infrastructure as a Service) is a Reapit internal tool for hosting and deploying single page web apps. The aim of IaaS is to provide engineering teams with a platform allowing apps to be deployed quickly without needing involvement from other teams.
Developers can host their React applications on Reapit infrastructure which negates the need to setup project specific infrastructure.
The guide below assumes you are familiar with the Vite Starter Template for React
Creating and Configuring a Pipeline (App)
What is a Pipeline?
Each application you want to deploy with IaaS has a pipeline. Think of this as a CI/CD runner for your app, that responds to events in GitHub, such as a pull request being merged. These events will trigger a deployment which contains four distinct stages:
Download Source - the source code is downloaded from GitHub to the IaaS runner environment.
Install - any dependencies are installed. As part of the pipeline configuration you specify which package manager you are using, and the IaaS runner will execute install for that package manager (ie
yarn installwhen the package manager is set to Yarn)Build - the project gets built. The IaaS runner will execute whatever build command you specify in the pipeline configuration for the chosen package manager (ie
yarn build)Deploy - the project gets deployed. The IaaS runner will take the built deployment bundle and host it on a dedicated domain which is a system generated web address. Custom domains can be associated to your IaaS environment so more friendly public URLs are available for us.
IaaS is currently deployed to the eu-west-2 region. As it uses global Cloudfront, apps developed in other regions can still be deployed using this feature and will be served at the edge for low latency, but your pipeline needs to be configured in the Europe DeveloperPortal
Pipeline Creation
A pipeline requires a Client Side App to be created from the DeveloperPortal. A newly created Client Side App will automatically trigger the creation of a pipeline which will have a status of Pre Provisioned, meaning that it’s ready for use.


Configure Pipeline
Before configuring your pipeline, make sure the Reapit GitHub app is installed the repository or organisation you wish to use IaaS with. For information about how to do this, click here
The Configure tab is used to link your IaaS pipeline to your GitHub repository, and setup the commands which will be executed by the IaaS runner environment.

The name of the pipeline will default to that of your app. As this is a system generated name, you may want to change this. It’s useful to ensure you can identify a pipeline from the main IaaS page, accessed from the top navigation menu in the DeveloperPortal
The deployment branch is the name of the branch in your GitHub repository that should invoke the IaaS pipeline runner when anything is pushed to that branch. Typically this will be main or master, but you may also have separate development or feature branches that you wish to deploy. Different environments (ie Development and Production) should use different apps in the DeveloperPortal which would have isolated pipelines with different Deployment Branch configurations.
Next, attach the pipeline to your GitHub repository by clicking the GitHub Repository field. A modal will appear that will allow you to sign into GitHub and select from the list of repositories you have access to. If you have access to repositories across different GitHub accounts - for example where you are a collaborator on an external repository - it will also be listed here.

Clicking the Login with GitHub to continue button, you’ll be navigated to GitHub where you’ll be asked to select your the user you wish to authenticate with if you have multiple active sessions in your browser:

Once you’re logged in, you’ll be navigated back to the pipeline you were configuring. The repository selection modal will appear again and show you the GitHub accounts available to your logged in user, based on where the Reapit GitHub app is installed:

Once you’ve selected an installation, you’ll be able to select a repository attached to that installation.

Next, select the Package Manager that your project uses. Typically this is Yarn or Npm, and it’s recommended you configure the same package manager as you use locally for the project.
The build command defines the command that the IaaS pipeline will execute to build your deployable app bundle.
The build directory defines the directory where the IaaS pipeline will look for deployment assets that have been built as part of the build process.
Don’t forget to hit Save Config after you’ve finished configuring the pipeline.

Installing the Reapit Github App to your repository
Reapit Internal users can skip this step as the app is installed Globally in our Enterprise tenant - if there are any issues with this, please contact an admin.
Our Github app is the glue between the IaaS system and GitHub. You can able to install it for all repositories or specific repositories in an account or organisation. On the app page on GitHub, if you have permission to do so, you’ll see a Configure button which will enable you to configure your repositories. Please note that the app is installed globally in the reapit-global enterprise organisation.

Once you’ve selected your installation you’ll be prompted with the app settings page where you’ll be able to find the repository access section. Here you’ll be able to configure which repositories the Reapit App has access to.

Within Reapit Github Organisations a relevant admin will be required to manage repository access.
Customising DNS
When creating new pipelines, a system generated DNS name will be used when deploying your app for the first time. This is typically in the format foo-bar.iaas.paas.reapit.cloud. It’s likely you will want to customise this so that more friendly domain names can be used externally.
To setup a custom domain, use the Custom DNS tab which is available on the IaaS Pipeline page for your app in the DeveloperPortal. You can use external domains or the existing reapit.cloud domain. Please note that only employees with the Reapit Connect group membership FoundationsDeveloperAdmin can create custom DNS configurations. Administrators can promote users as required in the DeveloperPortal.

Clicking Setup Custom DNS will present the setup modal as shown below:

Enter the custom domain you wish to use for your app and click Next. IaaS will start to provision SSL certificates and generate DNS records that need to be added to your DNS database. If you are configuring a reapit.cloud domain the creation of CNAME records will be handled for you. This process involves a PR to the DevOps team to setup the DNS records in the right namespace. Once this is done, the Certificate Status will change to Verified. Any other domain requires you to setup the records as described onscreen yourself.

Once the Certificate Status changes to Verified. you will be able to reach your deploy app at your chosen domain.
Demo
You can watch a demo of IaaS in action below
FAQs
Q: I’ve created a custom domain but need to change it. What should I do? A: You will need to delete your pipeline completely. This process can take a number of minutes, after which you can setup a brand new one as needed
Q: I’ve created a custom domain using
reapit.cloudbut the Certificate Status still says Unverified after a number of days. What should I do? A: The certificate validation process requires certain DNS records to be present. Until the certificate validation process can access these records, it will not issue the certificate for your chosen domain. When using thereapit.clouddomain, the IaaS backend opens a pull request (PR) in the UK DevOps GitHub repository to setup the DNS records required by this process. It’s likely that this PR has not yet been merged and changes deployed. Once this happens, the certificate should validate so that your custom domain can be usedQ: I cannot see the IaaS options in the DeveloperPortal. Why is this? A: As the DeveloperPortal is used by both internal and external developers, access needs to be granted to your developer organisation. Most colleagues will already be part of an organisation that has access, but if not, please click here to send an email.
Q: My deployment keeps failing. Who should I contact? A: When deployments are in progress, logs will become available on the Deployments tab. These can indicate problems with your build process. If you are unable to resolve the problem, please click here to send an email
Last updated