Kitchen is a sample Spring Boot web application demonstrating the use of Feature Flags via Config Server for Tanzu Application Service. (For information on the Config Server product in Tanzu Application Service, please see the documentation.)
This project supports both Gradle and Maven build systems. It uses Spring Enterprise artifacts from Broadcom's repository, which requires authentication.
Before building with either Gradle or Maven, you must configure your Spring Enterprise repository credentials.
Both Gradle and Maven can use these environment variables:
export SEC_ARTIFACTORY_USERNAME=your_username
export SEC_ARTIFACTORY_PASSWORD=your_passwordFor Gradle:
Gradle is automatically configured to use the environment variables above. Alternatively, you can add them to your ~/.gradle/gradle.properties file:
secArtifactoryUsername=your_username
secArtifactoryPassword=your_passwordFor Maven:
Maven requires you to add the spring-enterprise server to your ~/.m2/settings.xml file. The configuration below will read the environment variables you set in step 1:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>spring-enterprise</id>
<username>${env.SEC_ARTIFACTORY_USERNAME}</username>
<password>${env.SEC_ARTIFACTORY_PASSWORD}</password>
</server>
</servers>
</settings>./gradlew build
./gradlew bootRun# Using Maven wrapper (recommended)
./mvnw clean compile
./mvnw clean package
./mvnw spring-boot:run
# Or if you have Maven installed globally
mvn clean compile
mvn clean package
mvn spring-boot:runcf create-service p.config-server standard kitchen-config-server \
-c '{ "git": { "uri": "https://github.com/pivotal-cf/scs-public-config-repo" }}'Using Gradle:
./gradlew build && cf push -p build/libs/kitchen-0.0.1-SNAPSHOT.jarUsing Maven:
./mvnw clean package && cf push -p target/kitchen-0.0.1-SNAPSHOT.jarVisit your application route (e.g. https://kitchen.<your-app-domain>), and log in by providing a sample email address.
You may use the tester email addresses listed in the config repo to see the dishes that are only available for beta testers.
You can also enable dev profile and restart the app to verify that theme is changing to green.
cf set-env kitchen SPRING_PROFILES_ACTIVE dev && cf restart kitchen