Environment setup for developers
Describes how to set up your developer workstation to start building Configured Commerce solutions.
Prerequisites
To set up your Configured Commerce developer environment, the following must be completed:
- You understand Git technology and command line tools.
- You have created a private GitHub repository and have access to edit collaborators.
- Optimizely has completed the provisioning of the Sandbox and Production Configured Commerce instances.
- Cloud developer workstation works on currently supported Microsoft Windows installations only. Linux and macOS are not supported.
Developer workstation setup process
Clone insite-commerce-cloud repository
Note
This is only allowed for organizations. For personal accounts, Github only allows full access collaborators. To clone the Configured Commerce repo, you need to create a shared service account, and the Configured Commerce hosting team will add you to the group to access git clone
https://github.com/InsiteSoftware/insite-commerce-cloud.git
after you submit a ticket.If you are new to Configured Commerce and are not working on an active project, submit a support ticket requesting an invitation to the Git repository. Create a shared group Git account, as individual accounts are not allowed. For example, partnername-Optimizely not JonDoe-partner.
- Open git bash or command line.
git clone https://github.com/InsiteSoftware/insite-commerce-cloud.git
Install the Configured Commerce Build Service GitHub App
You must install the Configured Commerce Build Service GitHub app on your extensions repository. Optimizely uses this app to receive webhooks that notify the Configured Commerce build service of code changes that must be built and deployed for the extensions repository.
Important
Only complete this section if you are connecting your repo to an environment hosted by Optimizely. This step allows build server access to the repository to pull your extensions into your environment. Do not complete this step if you are completing the developer training course.
See Build service v2 for more information.
Replace default remote origin
- Change directory to the cloned directory.
git remote rm origin
git remote add origin [YourRemoteGitPath]
For example, https://github.com/yourprofile/isccloud.git
Add upstream repository
Add the original upstream repository to receive any new updates deployed by Optimizely to the web project in the repository. This uses git tags to identify releases. Git pull specific releases to test specific versions locally against customizations (theme and extensions).
git remote add upstream https://github.com/InsiteSoftware/insite-commerce-cloud.git
git push --set-upstream origin master
Create a custom Classic Theme or Spire Blueprint
Classic CMS -Â Create a project theme using the PowerShell script provided. Multiple themes can be created in a single repository, however, themes cannot have the same name.
- Locate the local git repository in Windows Explorer and go to the /src folder.
- Open PowerShell and execute the ./createTheme.ps1 Powershell script. For example, ./createTheme.ps1 - themeName "YourCustomTheme".
- Open the Commerce.Web solution in Visual Studio and check that it has an Extension library, Commerce.Web project, and the custom Theme project.
Check Environment Versions – Use the steps in Upgrade Configured Commerce to make sure the version generating the theme is in sync with the deployed version. This prevents merging a code version that is ahead of what you have deployed or are deploying.
Note
The branch tags containing version name are prepended with lts or sts.
- Lts currently uses .NET 4.8.
- Sts currently uses .NET 4.8 and .NET 7. The .NET 7 framework is in beta.
See Long-Term Support overview for more information.
Configure Optimizely NuGet source in Visual Studio
NuGet packages are available on https://nuget.optimizely.com, which does not require authentication.
- Go to Visual Studio > Tools > Options > NuGet Package Manager > Package Sources.
- Click Add:
- Name – Configured Commerce
- Source – https://nuget.optimizely.com/feed/packages.svc
- Restore packages.
Configure the local environment
Open Visual Studio and rebuild the solution.
For SQL, follow these steps:
- Create a database within SQL server
- Run
./database/Insite.Commerce.StartingDatabase.sql
against the database. - Optionally run
./database/Insite.Commerce.SampleData.sql
against the database. - Update
./src/InsiteCommerce.Web/config/connectionStrings.config
so it can connect to your new database.
connectionStrings.default.config
is copied toconnectionStrings.config
during a build. If you skipped step 1, you can copy the file manually.
For IIS, follow these steps:
- Add a new site to IIS, pointing to
./src/InsiteCommerce.Web
. - Set up bindings:
- For simple setups, using a non-standard port like 8080 is fine. The site can then be accessed at
http://localhost:8080
. - If dealing with multiple projects, it can help to have them setup with hostnames on port 80:
projectA.local.com
projectB.local.com
This requires entries inc:\Windows\System32\drivers\etc\hosts
:
127.0.0.1
projectA.local.com
127.0.0.1
projectB.local.com
Note
https
is not required.
- For simple setups, using a non-standard port like 8080 is fine. The site can then be accessed at
- Setup certificate:
- Run powershell
{SDK Folder}\\tools\\generatePfx.ps1
. This generates two files,insiteidentity.pfx
andInsiteIdentityPassword.txt
. - Copy the generated
insiteidentity.pfx
to{Web Project Folder}/AppData/insiteidentity.pfx
. - Copy the password in
InsiteIdentityPassword.txt
into the IdentityServerCertificatePassword node in{Web Project Folder}/config/AppSettings.config
- Run powershell
Once finished with either set of steps, log in to /admin
with the following credentials:
user – admin
password – admin123
Finalize git branching
Create two local branches called sandbox and production, used by the corresponding deployments. Pushing to the remove server automatically creates the remote branch. Optimizely schedules production deployments. Pushing to the remote production branch does not automatically make the theme and server-side customizations go live. Sandbox deployments are automated, and any customizations refresh the insitesandbox.com domain within a few minutes of a git push to the remote sandbox branch.
- Open git bash or command line and open the install location.
- git branch sandbox.
- git branch production
- Verify the Configured Commerce website loads in the browser on the local dev machine.
Note
Git is a distributed version control system. Optimizely only supports pulling the Extensions code from GitHub, but you can use any version control system internally for your workflow. Attach the Github repo to your internal repo as a remote and push code to it.
Updated 3 months ago