You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2018/03/15 11:05:11 UTC

[isis] branch maint-1.16.2 updated (9cc64a3 -> 529112d)

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a change to branch maint-1.16.2
in repository https://gitbox.apache.org/repos/asf/isis.git.


    from 9cc64a3  ISIS-1916: recreating simpleapp archetype
     new 32f8228  ISIS-1916: updates from testing that example simpleapp works with gitlab-ci
     new 529112d  ISIS-1916: updates docs for gitlab-ci support

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ..._ugfun_getting-started_simpleapp-archetype.adoc |  69 ++++++++++++++++++++-
 .../images/getting-started/dockerhub-tags.png      | Bin 0 -> 52693 bytes
 example/application/simpleapp/.gitlab-ci.yml       |  15 +++--
 example/application/simpleapp/.m2/settings.xml     |   6 +-
 example/application/simpleapp/pom.xml              |   2 +-
 5 files changed, 79 insertions(+), 13 deletions(-)
 create mode 100644 adocs/documentation/src/main/asciidoc/guides/ugfun/images/getting-started/dockerhub-tags.png

-- 
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.

[isis] 01/02: ISIS-1916: updates from testing that example simpleapp works with gitlab-ci

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch maint-1.16.2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 32f82285221c91fc659a0fb3e90b1d24f6828093
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Mar 15 09:43:24 2018 +0000

    ISIS-1916: updates from testing that example simpleapp works with gitlab-ci
---
 example/application/simpleapp/.gitlab-ci.yml   | 15 +++++++++------
 example/application/simpleapp/.m2/settings.xml |  6 +++---
 example/application/simpleapp/pom.xml          |  2 +-
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/example/application/simpleapp/.gitlab-ci.yml b/example/application/simpleapp/.gitlab-ci.yml
index f7519b1..8b1e37a 100644
--- a/example/application/simpleapp/.gitlab-ci.yml
+++ b/example/application/simpleapp/.gitlab-ci.yml
@@ -1,8 +1,11 @@
 #
 # requires the following gitlab secret variables
-# - DOCKER_HUB_USERNAME
-# - DOCKER_HUB_PASSWORD
-# - DOCKER_HUB_EMAIL
+# - DOCKER_REGISTRY_USERNAME
+# - DOCKER_REGISTRY_PASSWORD
+# - DOCKER_REGISTRY_EMAIL
+#
+# Adjust "DOCKER_REGISTRY_REPOSITORY" variable (below) to be the name of the repository in the specified registry.
+#
 #
 
 image: maven:3.5.3-jdk-8
@@ -18,9 +21,9 @@ variables:
   DOCKER_DRIVER: overlay2
   MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
   MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dskip.cloudbees-estatio-repositories -Dskip.sonatype-snapshots -Dskip.apache-snapshots"
-  APP_NAME: "isis-demoapp-simpleapp"
   DOCKER_REGISTRY_ID: "docker-hub"
   DOCKER_REGISTRY_URL: "https://index.docker.io/v1/"
+  DOCKER_REGISTRY_REPOSITORY: "simpleapp"
 
 stages:
   - build-package-push
@@ -34,7 +37,7 @@ build-package-push:
           clean install \
           -Drevision=$REVISION \
           -Dmavenmixin-docker \
-          -Ddocker-plugin.imageName=$DOCKER_HUB_USERNAME/$APP_NAME
+          -Ddocker-plugin.imageName=$DOCKER_REGISTRY_USERNAME/$DOCKER_REGISTRY_REPOSITORY
     - >
       mvn $MAVEN_CLI_OPTS \
           docker:push@push-image-tagged \
@@ -43,7 +46,7 @@ build-package-push:
           -DskipTests \
           -Dskip.isis-swagger \
           -Dmavenmixin-docker \
-          -Ddocker-plugin.imageName=$DOCKER_HUB_USERNAME/$APP_NAME \
+          -Ddocker-plugin.imageName=$DOCKER_REGISTRY_USERNAME/$DOCKER_REGISTRY_REPOSITORY \
           -Ddocker-plugin.serverId=$DOCKER_REGISTRY_ID \
           -Ddocker.registryUrl=$DOCKER_REGISTRY_URL
 
diff --git a/example/application/simpleapp/.m2/settings.xml b/example/application/simpleapp/.m2/settings.xml
index aa4567d..d481ccb 100644
--- a/example/application/simpleapp/.m2/settings.xml
+++ b/example/application/simpleapp/.m2/settings.xml
@@ -5,10 +5,10 @@
   <servers>
     <server>
       <id>${env.DOCKER_REGISTRY_ID}</id>
-      <username>${env.DOCKER_HUB_USERNAME}</username>
-      <password>${env.DOCKER_HUB_PASSWORD}</password>
+      <username>${env.DOCKER_REGISTRY_USERNAME}</username>
+      <password>${env.DOCKER_REGISTRY_PASSWORD}</password>
       <configuration>
-        <email>${env.DOCKER_HUB_EMAIL}</email>
+        <email>${env.DOCKER_REGISTRY_EMAIL}</email>
       </configuration>
     </server>
   </servers>
diff --git a/example/application/simpleapp/pom.xml b/example/application/simpleapp/pom.xml
index 38669c2..fc54732 100644
--- a/example/application/simpleapp/pom.xml
+++ b/example/application/simpleapp/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.incode</groupId>
         <artifactId>incode-build</artifactId>
-        <version>2.3</version>
+        <version>2.4</version>
     </parent>
 
     <groupId>org.apache.isis.example.application</groupId>

-- 
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.

[isis] 02/02: ISIS-1916: updates docs for gitlab-ci support

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch maint-1.16.2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 529112d646aba734adb50ccf1d1d73868682bfe1
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Mar 15 10:04:16 2018 +0000

    ISIS-1916: updates docs for gitlab-ci support
---
 ..._ugfun_getting-started_simpleapp-archetype.adoc |  69 ++++++++++++++++++++-
 .../images/getting-started/dockerhub-tags.png      | Bin 0 -> 52693 bytes
 2 files changed, 66 insertions(+), 3 deletions(-)

diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_getting-started_simpleapp-archetype.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_getting-started_simpleapp-archetype.adoc
index 20f660c..63a1132 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_getting-started_simpleapp-archetype.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_getting-started_simpleapp-archetype.adoc
@@ -3,7 +3,7 @@
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 :_basedir: ../../
 :_imagesdir: images/
-
+:toc:
 
 The quickest way to get started building an application "for real" is to run the `simpleapp` archetype.
 Like the xref:ugfun.adoc#_ugfun_getting-started_helloworld-archetype[helloworld archetype], this too will generate a very simple one-class domain model (an entity called `SimpleObject` with a couple of properties).
@@ -638,6 +638,71 @@ image::{_imagesdir}getting-started/using-simple-app/070-home-page.png[width="600
 
 
 
+== Using GitLab CI and DockerHub
+
+The archetype provides configuration files to allow you to build and package the application using link:https://gitlab.com/[GitLab] (for continuous integration pipelines) and link:https://hub.docker.com/[Docker Hub] (as a registry of Docker images).
+
+To use, you'll need an account on both GitLab and DockerHub.
+
+=== DockerHub
+
+Simply create Docker repository "myapp" in DockerHub.
+
+
+=== Source code
+
+In the `.gitlab-ci.yml` file, update the name of the Docker repository on DockerHub:
+
+[source,yml]
+----
+variables:
+  ...
+  DOCKER_REGISTRY_REPOSITORY: "myapp"
+----
+
+=== GitLab
+
+Create a git repository "myapp" in GitLab.
+
+Using Settings > CI/CD, specify the following _Secret Variables_:
+
+* `DOCKER_REGISTRY_USERNAME` - corresponds to user account name on DockerHub
+* `DOCKER_REGISTRY_PASSWORD` - corresponding password
+* `DOCKER_REGISTRY_EMAIL` - associated email for the user account
+
+Finally, push a copy of the generated application to this repository using the instructions provided by GitLab.
+
+This will kick off a pipeline that will build the image and push to DockerHub.
+
+image::{_imagesdir}getting-started/dockerhub-tags.png[width="600px",link="{_imagesdir}getting-started/dockerhub-tags.png"]
+
+The tag name is based on a combination of the date, the branch and the git shaId.
+
+
+=== Running the Image
+
+You can run the image in a new container using:
+
+[source,bash]
+----
+docker run -p 8080:8080 -d XXX/YYY:ZZZ
+----
+
+where
+
+* `XXX` is your DockerHub account name (`DOCKER_REGISTRY_USERNAME` secret variable in GitLab CI)
+* `YYY` is the name of the DockerHub registry (`DOCKER_REGISTRY_REPOSITORY` in the `.gitlab-ci.yml` file)
+* `ZZZ` is the tag of the image to run
+
+
+For example, using the screenshot above, that image could be run using:
+
+[source,bash]
+----
+docker run -p 8080:8080 -d danhaywood/simpleapp:20180315.0935.master.4521215
+----
+
+
 == Modifying the App
 
 Once you are familiar with the generated app, you'll want to start modifying it.
@@ -645,5 +710,3 @@ There is plenty of guidance on this site; start with this guide (fundamentals) a
 
 If you use IntelliJ IDEA or Eclipse, do also install the xref:../dg/dg.adoc#__dg_ide_intellij_live-templates[live templates (for IntelliJ)] / xref:../dg/dg.adoc#__dg_ide_eclipse_editor-templates[editor templates (for Eclipse)]; these will help you follow the Apache Isis naming conventions.
 
-
-
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/images/getting-started/dockerhub-tags.png b/adocs/documentation/src/main/asciidoc/guides/ugfun/images/getting-started/dockerhub-tags.png
new file mode 100644
index 0000000..b25eb10
Binary files /dev/null and b/adocs/documentation/src/main/asciidoc/guides/ugfun/images/getting-started/dockerhub-tags.png differ

-- 
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.