Spring Cloud Skipper
A package manager that installs, upgrades, and rolls back applications on multiple Cloud Platforms.
Supported application types are Spring Boot applications.
Supported Cloud Platforms are Cloud Foundry
, Kubernetes
.
For development experience, Local
deployment is supported.
Skipper can be used as part of implementing the practice of Continuous Deployment. It provides a versioned "single source of truth" that defines what applications were deployed to the cloud. This enables easy rollbacks and upgrades without having to rebuild applications from source code.
Building
Clone the repo and type
$ ./mvnw clean install
which will run the tests as well.
To just create the executables, type
$./mvnw clean package -DskipTests -Dmaven.javadoc.skip=true
To generate just the RESTDocs documentation
./mvnw test -pl spring-cloud-skipper-server-core -Dtest=*Documentation*
To build just the documentation, if the RESTDocs generated from tests are already present
./mvnw -DskipTests -Pfull package -pl spring-cloud-skipper-docs
Quick Tour
There are some sample packages in the test directory that you can use to get started. Create a skipper.yml
file in your home directory
spring:
cloud:
skipper:
server:
packageRepositories:
-
name: test
url: "file:///home/mpollack/projects/spring-cloud-skipper/spring-cloud-skipper-server-core/src/test/resources/repositories/binaries/test/"
Where you replace /home/mpollack/projects/
to the path where you cloned spring-cloud-skipper
.
Then start the Skipper server
$ java -jar spring-cloud-skipper-server/target/spring-cloud-skipper-server-1.0.0.BUILD-SNAPSHOT.jar --spring.config.additional-location=/home/mpollack/skipper.yml
Where you replace /home/mpollack/
with your own home directory.
Then launch the Skipper shell in another terminal
$ java -jar spring-cloud-skipper-shell/target/spring-cloud-skipper-shell-1.0.0.BUILD-SNAPSHOT.jar
The command package search
will search for all available packages. It should then show you the following output
skipper:>package search
βββββββββββββββββββ€ββββββββ€ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Name βVersionβ Description β
β ββββββββββββββββββͺββββββββͺββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
βhelloworld-dockerβ1.0.0 βThe hello world app says hello. β
βlog β1.1.0 βThe log sink uses the application logger to output the data β
β β βfor inspection. β
βlog β2.0.0 βThe log sink uses the application logger to output the data β
β β βfor inspection. β
βlog β1.0.0 βThe log sink uses the application logger to output the data β
β β βfor inspection. β
βlog-docker β1.0.0 βDocker version of the log sink application version β
βlog-docker β2.0.0 βDocker version of the log sink application β
βticktock β1.0.0 βThe ticktock stream sends a time stamp and logs the value. β
βtime β2.0.0 βThe time source periodically emits a timestamp string. β
βββββββββββββββββββ§ββββββββ§ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
In another window you can run watch -n 2 jps
so see which Java processes are running, since by default, the local deployer will be used to deploy packages.
Now deploy the log 1.0.0 package.
skipper:>package install --package-name log --package-version 1.0.0 --release-name mylog
Released mylog. Now at version v1.
Note that the log 1.0.0 package deploys the version 1.2.0.RC1 of the application. You should see the java app named log-sink-rabbit-1.2.0.RC1.jar
running in the output of the jps
command
You can ask for the status using the status command
skipper:>release status --release-name mylog
βββββββββββββββββ€ββββββββββββββββββββββββββββββββββββββββββββββββββ
βLast Deployed βFri Oct 27 15:44:00 IST 2017 β
βStatus βDEPLOYED β
βPlatform StatusβAll applications have been successfully deployed.β
β β[mylog.log-v1], State = [mylog.log-v1-0=deployed]β
βββββββββββββββββ§ββββββββββββββββββββββββββββββββββββββββββββββββββ
The manifest for this release that represents the file instructions to deploy onto the platform, can be shown using the get manifest
command.
skipper:>manifest get --release-name mylog
---
# Source: log.yml
apiVersion: skipper/v1
kind: SpringBootApp
metadata:
name: log
count: 1
type: sink
spec:
resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit:1.2.0.RC1
resourceMetadata: maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:1.2.0.RC1
applicationProperties:
deploymentProperties:
Now update the release with a newer version
skipper:>release upgrade --release-name mylog --package-name log --package-version 2.0.0
mylog has been upgraded. Now at version v2.
You should see the java app named log-sink-rabbit-1.2.0.RELEASE.jar
running in the output of the jps
command.
The status command should shortly show it has been deployed successfully. Note you can type !status
to execute the last command that started with the word status
skipper:>release status --release-name mylog
βββββββββββββββββ€ββββββββββββββββββββββββββββββββββββββββββββββββββ
βLast Deployed βFri Oct 27 15:45:43 IST 2017 β
βStatus βDEPLOYED β
βPlatform StatusβAll applications have been successfully deployed.β
β β[mylog.log-v2], State = [mylog.log-v2-0=deployed]β
βββββββββββββββββ§ββββββββββββββββββββββββββββββββββββββββββββββββββ
Next rollback to the previous release
skipper:>release rollback --release-name mylog
mylog has been rolled back. Now at version v3.
You should see the java app named log-sink-rabbit-1.2.0.RC1.jar
running in the output of the jps
command
The status command should shortly show it has been deployed successfully.
skipper:>release status --release-name mylog
βββββββββββββββββ€ββββββββββββββββββββββββββββββββββββββββββββββββββ
βLast Deployed βFri Oct 27 15:48:03 IST 2017 β
βStatus βDEPLOYED β
βPlatform StatusβAll applications have been successfully deployed.β
β β[mylog.log-v3], State = [mylog.log-v3-0=deployed]β
βββββββββββββββββ§ββββββββββββββββββββββββββββββββββββββββββββββββββ
The history
command shows you the various releases that were made
skipper:>release history --release-name mylog
βββββββββ€βββββββββββββββββββββββββββββ€βββββββββ€βββββββββββββ€ββββββββββββββββ€βββββββββββββββββ
βVersionβ Last updated β Status βPackage NameβPackage Versionβ Description β
β ββββββββͺβββββββββββββββββββββββββββββͺβββββββββͺβββββββββββββͺββββββββββββββββͺβββββββββββββββββ£
β3 βFri Oct 27 15:48:03 IST 2017βDEPLOYEDβlog β1.0.0 βUpgrade completeβ
β2 βFri Oct 27 15:45:43 IST 2017βDELETED βlog β2.0.0 βDelete complete β
β1 βFri Oct 27 15:44:00 IST 2017βDELETED βlog β1.0.0 βDelete complete β
βββββββββ§βββββββββββββββββββββββββββββ§βββββββββ§βββββββββββββ§ββββββββββββββββ§βββββββββββββββββ
Now delete the release.
skipper:>release delete --release-name mylog
mylog has been deleted.
You should not see any log-sink-rabbit
apps in the jps
command.
Code formatting guidelines
-
The directory ./etc/eclipse has two files for use with code formatting,
eclipse-code-formatter.xml
for the majority of the code formatting rules andeclipse.importorder
to order the import statements. -
In eclipse you import these files by navigating
Windows β Preferences
and then the menu itemsPreferences > Java > Code Style > Formatter
andPreferences > Java > Code Style > Organize Imports
respectfully. -
In
IntelliJ
, install the pluginEclipse Code Formatter
. You can find it by searching the "Browse Repositories" under the plugin option withinIntelliJ
(Once installed you will need to reboot Intellij for it to take effect). Then navigate toIntellij IDEA > Preferences
and select the Eclipse Code Formatter. Select theeclipse-code-formatter.xml
file for the fieldEclipse Java Formatter config file
and the fileeclipse.importorder
for the fieldImport order
. Enable theEclipse code formatter
by clickingUse the Eclipse code formatter
then click the OK button.-
NOTE: If you configure the
Eclipse Code Formatter
fromFile > Other Settings > Default Settings
it will set this policy across all of your Intellij projects.
-