Application Backlog

Dialogue

Application Backlog

Phase 1

  • Create a Spring project
  • Basic Welcome Page
  • Basic User authentication
  • Welcome page for authenticated users

Phase 2 + 3

  • Difference dev/prod
  • Differences for users
  • Basic Upload page
  • All photos page

Phase 4

Checkstyle

Checkstyle configuration

Execution is via
mvn checkstyle:checkstyle to only have the report
mvn checkstyle:checkfor failing if errors exist

The plugin to add to the pom

	<build>
		<plugins>
			[...]
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>3.5.0</version>
				<configuration>
					<configLocation>checkstyle.xml</configLocation>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>com.puppycrawl.tools</groupId>
						<artifactId>checkstyle</artifactId>
						<version>10.9.3</version>
					</dependency>
				</dependencies>
			</plugin>
			[...]
		</plugins>
	</build>

Example Checkstyle Configuration, needs to be at the root of the project

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">

<!--
    This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
    Checkstyle-Configuration: metavonics
    Description: none
-->
<module name="Checker">
  <property name="severity" value="warning"/>
  <module name="TreeWalker">
    <module name="RegexpSinglelineJava">
      <property name="severity" value="error"/>
      <property name="format" value="^\t* "/>
      <property name="message" value="Indent must use tab characters"/>
      <property name="ignoreComments" value="true"/>
    </module>
    <module name="SuppressWarningsHolder"/>
    <module name="MissingOverride">
      <property name="severity" value="error"/>
    </module>
    <module name="Indentation">
      <property name="severity" value="error"/>
      <property name="basicOffset" value="8"/>
      <property name="caseIndent" value="0"/>
      <property name="throwsIndent" value="8"/>
      <property name="arrayInitIndent" value="8"/>
      <property name="lineWrappingIndentation" value="8"/>
    </module>
    <module name="MissingJavadocType">
      <property name="severity" value="error"/>
    </module>
    <module name="ConstantName">
      <property name="severity" value="error"/>
    </module>
    <module name="MemberName"/>
    <module name="MethodName">
      <property name="severity" value="error"/>
    </module>
    <module name="MethodTypeParameterName">
      <property name="severity" value="error"/>
    </module>
    <module name="ParameterName">
      <property name="severity" value="error"/>
      <property name="ignoreOverridden" value="true"/>
    </module>
    <module name="MethodLength">
      <property name="severity" value="error"/>
    </module>
    <module name="ParameterNumber">
      <property name="severity" value="error"/>
      <property name="max" value="4"/>
    </module>
    <module name="RecordComponentNumber"/>
    <module name="WhitespaceAround">
      <property name="severity" value="error"/>
    </module>
    <module name="NeedBraces">
      <property name="severity" value="error"/>
    </module>
    <module name="ArrayTypeStyle"/>
    <module name="MethodParamPad"/>
    <module name="VisibilityModifier">
      <property name="protectedAllowed" value="true"/>
    </module>
    <module name="MultipleVariableDeclarations">
      <property name="severity" value="error"/>
    </module>
    <module name="MissingSwitchDefault">
      <property name="severity" value="error"/>
    </module>
    <module name="DefaultComesLast">
      <property name="severity" value="error"/>
    </module>
    <module name="InnerAssignment">
      <property name="severity" value="error"/>
    </module>
    <module name="MagicNumber"/>
    <module name="SimplifyBooleanReturn"/>
    <module name="SimplifyBooleanExpression"/>
    <module name="FinalClass">
      <property name="severity" value="error"/>
    </module>
    <module name="StringLiteralEquality">
      <property name="severity" value="error"/>
    </module>
    <module name="HideUtilityClassConstructor"/>
    <module name="FinalLocalVariable">
      <property name="severity" value="error"/>
    </module>
    <module name="ParameterAssignment">
      <property name="severity" value="error"/>
    </module>
    <module name="LocalVariableName"/>
    <module name="StaticVariableName"/>
    <module name="LocalFinalVariableName"/>
    <module name="ModifiedControlVariable">
      <property name="severity" value="error"/>
    </module>
    <module name="EmptyCatchBlock">
      <property name="severity" value="error"/>
    </module>
    <module name="IllegalCatch"/>
    <module name="OneStatementPerLine"/>
    <module name="EmptyBlock"/>
    <module name="NestedForDepth">
      <property name="max" value="2"/>
    </module>
    <module name="NestedIfDepth">
      <property name="severity" value="error"/>
      <property name="max" value="3"/>
    </module>
    <module name="NestedTryDepth">
      <property name="max" value="3"/>
    </module>
    <module name="CyclomaticComplexity"/>
    <module name="NestedForDepth">
      <property name="severity" value="error"/>
      <property name="max" value="3"/>
    </module>
    <module name="AnnotationLocation"/>
    <module name="SuppressionCommentFilter"/>
    <module name="MissingDeprecated"/>
    <module name="AvoidDoubleBraceInitialization"/>
    <module name="EmptyStatement"/>
    <module name="EqualsAvoidNull"/>
    <module name="FinalLocalVariable"/>
    <module name="FinalLocalVariable">
      <property name="tokens" value="VARIABLE_DEF,PARAMETER_DEF"/>
    </module>
    <module name="IllegalCatch"/>
    <module name="MultipleStringLiterals">
      <property name="allowedDuplicates" value="2"/>
    </module>
    <module name="NestedForDepth"/>
    <module name="PackageDeclaration"/>
    <module name="Indentation">
      <property name="basicOffset" value="8"/>
      <property name="caseIndent" value="0"/>
      <property name="throwsIndent" value="8"/>
      <property name="arrayInitIndent" value="8"/>
      <property name="lineWrappingIndentation" value="8"/>
    </module>
  </module>
  <module name="FileLength">
    <property name="severity" value="error"/>
  </module>
  <module name="LineLength">
    <property name="max" value="160"/>
  </module>
  <module name="FileTabCharacter">
    <property name="severity" value="ignore"/>
    <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="error"/>
  </module>
  <module name="SuppressWarningsFilter"/>
</module>

DevOps Maturity

Focus on Continuous Deployment

Article from Andreas Rehn, Tobias Palmborg and Patrik Boström, published on InfoQ

The Continuous Delivery Maturity Model

The principles and methods of Continuous Delivery are rapidly gaining recognition as a successful strategy for true business agility. For many organizations the question is no longer “why?”, but rather “how?” How do you start with Continuous Delivery, and how do you transform your organization to ensure sustainable results. This Maturity Model aims to give structure and understanding to some of the key aspects you need to consider when adopting Continuous Delivery in your organization.

[Read More]

Dialogue on Instagram

Photo dialogue

Dialogue on Instagram

Projet de David Campany & Anastasia Samoylova


Dialogue is a transatlantic visual conversation. David Campany (New York/London) and Anastasia Samoylova (Miami) make photographs in response to each other’s photographs. No rules, no expectations. What has emerged is a long, winding, unbroken ‘sentence’ of observational pictures. It moves between theme and form, exploring reflexively the visual grammar, syntax, resonances, and conventions of contemporary imagery, all with a heightened sense of place.

[Read More]

Discord Script

Discord Script usage

Usage:

  • Copy the script at the root of your project (as send.sh)
  • Define a global variable for WEBHOOK_URL
  • Create according jobs for notifications
  • Modify/Create rules for execution of each notification job

Example notification stage

stages:
  - notification
success_notification:
  stage: notification
  script:
    - chmod +x send.sh
    - ./send.sh success $WEBHOOK_URL
  when: on_success
failure_notification:
  stage: notification
  script:
    - chmod +x send.sh
    - ./send.sh failure $WEBHOOK_URL
  when: on_failure

Discord Script to be used in pipeline

[Read More]

Dokku

Dokku and mi-git usage

Deployment

.gitlab-ci.yml (extract)

# Name of the job
deploy-job:
  # Stage of the job execution 
  stage: deploy
  # Image to use for job. Here we use the officila dokku image,
  # https://dokku.com/docs/deployment/continuous-integration/gitlab-ci/
  image: dokku/ci-docker-image
  # Setting some variables, local to the job
  variables:
    # We don't need history, just the last version
    GIT_DEPTH: 0
    # The name of our application, here we use something for our preprod
    # It will result in https://$DOKKU_APP_NAME.dokku.tecture.de as URL
    DOKKU_APP_NAME: geisel-spring-app-staging
    # The URL of the git repository on the dokku server
    GIT_REMOTE_URL: ssh://dokku@192.168.1.120:22/$DOKKU_APP_NAME
  # Restrict the job to dev branch
  only:
    - dev
  # The script of the job. Here we deploy
  script: 
    - dokku-deploy

system.properties (needed at the application root to define the right java version)

[Read More]