You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2017/09/16 13:45:12 UTC

[myfaces-tobago] branch master updated: TOBAGO-1794: Deploy different versions of Tobago demo in the VM

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

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 27bf2b3  TOBAGO-1794: Deploy different versions of Tobago demo in the VM
     new c8761b4  Merge remote-tracking branch 'origin/master'
27bf2b3 is described below

commit 27bf2b31c48fcfd09a6df1a96b8acb84dd399411
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Sat Sep 16 15:40:14 2017 +0200

    TOBAGO-1794: Deploy different versions of Tobago demo in the VM
---
 .../tobago-vm/docker/apache-proxy/000-default.conf | 62 ++++++++++++++++
 .../main/tobago-vm/docker/apache-proxy/Dockerfile  | 39 ++++++++++
 .../src/main/tobago-vm/docker/docker-compose.yml   | 86 ++++++++++++++++++++++
 .../src/main/tobago-vm/docker/tomcat/Dockerfile    | 30 ++++++++
 .../main/tobago-vm/docker/tomcat/deploy-and-run.sh | 31 ++++++++
 5 files changed, 248 insertions(+)

diff --git a/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/apache-proxy/000-default.conf b/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/apache-proxy/000-default.conf
new file mode 100644
index 0000000..520d173
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/apache-proxy/000-default.conf
@@ -0,0 +1,62 @@
+# 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 agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+ServerTokens ProductOnly
+ServerSignature Off
+
+<VirtualHost *:80>
+
+	ServerName tobago-vm.apache.org
+	ServerAdmin dev@myfaces.apache.org
+
+	ErrorLog ${APACHE_LOG_DIR}/error.log
+	CustomLog ${APACHE_LOG_DIR}/access.log combined
+
+  <Location /demo-4-snapshot/>
+    ProxyPass "http://demo-4-snapshot:8080/demo-4-snapshot/"
+    ProxyPassReverse "http://demo-4-snapshot:8080/demo-4-snapshot/"
+  </Location>
+
+  <Location /demo-3-snapshot/>
+    ProxyPass "http://demo-3-snapshot:8080/demo-3-snapshot/"
+    ProxyPassReverse "http://demo-3-snapshot:8080/demo-3-snapshot/"
+  </Location>
+
+  <Location /demo-3-release/>
+    ProxyPass "http://demo-3-release:8080/demo-3-release/"
+    ProxyPassReverse "http://demo-3-release:8080/demo-3-release/"
+  </Location>
+
+  <Location /demo-2-snapshot/>
+    ProxyPass "http://demo-2-snapshot:8080/demo-2-snapshot/"
+    ProxyPassReverse "http://demo-2-snapshot:8080/demo-2-snapshot/"
+  </Location>
+
+  <Location /demo-2-release/>
+    ProxyPass "http://demo-2-release:8080/demo-2-release/"
+    ProxyPassReverse "http://demo-2-release:8080/demo-2-release/"
+  </Location>
+
+  <Location /demo-1-5-release/>
+    ProxyPass "http://demo-1-5-release:8080/demo-1-5-release/"
+    ProxyPassReverse "http://demo-1-5-release:8080/demo-1-5-release/"
+  </Location>
+
+  <Location /demo-1-0-release/>
+    ProxyPass "http://demo-1-0-release:8080/demo-1-0-release/"
+    ProxyPassReverse "http://demo-1-0-release:8080/demo-1-0-release/"
+  </Location>
+
+</VirtualHost>
diff --git a/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/apache-proxy/Dockerfile b/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/apache-proxy/Dockerfile
new file mode 100644
index 0000000..5804913
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/apache-proxy/Dockerfile
@@ -0,0 +1,39 @@
+# 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 agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM debian:stable-slim
+
+RUN apt-get update \
+ && apt-get upgrade -y \
+ && apt-get install -y less vim apache2 \
+ && apt-get clean \
+ && rm -rf /var/lib/apt/lists/* \
+ && a2enmod proxy proxy_http
+
+#COPY 000-default.conf 001-ssl.conf /etc/apache2/sites-enabled/
+COPY 000-default.conf /etc/apache2/sites-enabled/
+
+ENV APACHE_RUN_USER www-data
+ENV APACHE_RUN_GROUP www-data
+ENV APACHE_RUN_DIR /var/run/apache2
+ENV APACHE_LOG_DIR /var/log/apache2
+ENV APACHE_PID_FILE $APACHE_RUN_DIR/apache2.pid
+
+RUN mkdir -p ${APACHE_RUN_DIR} ${APACHE_LOG_DIR}
+
+EXPOSE 80
+
+CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]
+
diff --git a/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/docker-compose.yml b/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/docker-compose.yml
new file mode 100644
index 0000000..3c15c94
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/docker-compose.yml
@@ -0,0 +1,86 @@
+# 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 agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+version: '2'
+services:
+  apache:
+    image: tobago/apache-proxy:latest
+    ports:
+      - "8000:80"
+    links:
+      - demo-4-snapshot
+      - demo-3-snapshot
+      - demo-3-release
+      - demo-2-snapshot
+      - demo-2-release
+      - demo-1-5-release
+      - demo-1-0-release
+    depends_on:
+      - demo-4-snapshot
+      - demo-3-snapshot
+      - demo-3-release
+      - demo-2-snapshot
+      - demo-2-release
+      - demo-1-5-release
+      - demo-1-0-release
+  demo-4-snapshot:
+    image: tobago/tomcat:latest
+    environment:
+      - TOBAGO_VERSION=4.0.0-SNAPSHOT
+      - CONTEXT_PATH=demo-4-snapshot
+    volumes:
+      - /opt/artifacts:/opt/artifacts
+  demo-3-snapshot:
+    image: tobago/tomcat:latest
+    environment:
+      - TOBAGO_VERSION=3.0.6-SNAPSHOT
+      - CONTEXT_PATH=demo-3-snapshot
+    volumes:
+      - /opt/artifacts:/opt/artifacts
+  demo-3-release:
+    image: tobago/tomcat:latest
+    environment:
+      - TOBAGO_VERSION=3.0.5
+      - CONTEXT_PATH=demo-3-release
+    volumes:
+      - /opt/artifacts:/opt/artifacts
+  demo-2-snapshot:
+    image: tobago/tomcat:latest
+    environment:
+      - TOBAGO_VERSION=2.1.1-SNAPSHOT
+      - CONTEXT_PATH=demo-2-snapshot
+    volumes:
+      - /opt/artifacts:/opt/artifacts
+  demo-2-release:
+    image: tobago/tomcat:latest
+    environment:
+      - TOBAGO_VERSION=2.1.0
+      - CONTEXT_PATH=demo-2-release
+    volumes:
+      - /opt/artifacts:/opt/artifacts
+  demo-1-5-release:
+    image: tobago/tomcat:latest
+    environment:
+      - TOBAGO_VERSION=1.5.13
+      - CONTEXT_PATH=demo-1.5-release
+    volumes:
+      - /opt/artifacts:/opt/artifacts
+  demo-1-0-release:
+    image: tobago/tomcat:latest
+    environment:
+      - TOBAGO_VERSION=1.0.42
+      - CONTEXT_PATH=demo-1.0-release
+    volumes:
+      - /opt/artifacts:/opt/artifacts
diff --git a/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/tomcat/Dockerfile b/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/tomcat/Dockerfile
new file mode 100644
index 0000000..a79691e
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/tomcat/Dockerfile
@@ -0,0 +1,30 @@
+# 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 agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM tomcat:8.5-jre8
+MAINTAINER dev@myfaces.apache.org
+
+RUN apt-get update \
+ && apt-get install -y less vim procps ansible python-lxml
+
+RUN rm -r /usr/local/tomcat/webapps/*
+
+COPY deploy-and-run.sh /usr/local/tomcat/bin
+RUN chmod +x /usr/local/tomcat/bin/deploy-and-run.sh
+
+#ENV TOBAGO_VERSION undefined
+#ENV CONTEXT_PATH ROOT
+
+CMD ["deploy-and-run.sh"]
diff --git a/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/tomcat/deploy-and-run.sh b/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/tomcat/deploy-and-run.sh
new file mode 100644
index 0000000..e05c4ff
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/tobago-vm/docker/tomcat/deploy-and-run.sh
@@ -0,0 +1,31 @@
+#! /bin/bash
+
+# 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 agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [[ ${TOBAGO_VERSION} == *-SNAPSHOT ]]; then
+   REPO=https://repository.apache.org/content/repositories/snapshots
+else
+   REPO=https://repository.apache.org/content/repositories/releases
+fi
+
+TARGET=/usr/local/tomcat/webapps/${CONTEXT_PATH}
+ARTIFACT=/opt/artifacts/tobago-example-demo-${TOBAGO_VERSION}.war
+
+ansible localhost -m maven_artifact -a "group_id=org.apache.myfaces.tobago artifact_id=tobago-example-demo version=${TOBAGO_VERSION} extension=war repository_url=${REPO} dest=${ARTIFACT}"
+mkdir ${TARGET}
+unzip -d ${TARGET} ${ARTIFACT}
+
+catalina.sh run

-- 
To stop receiving notification emails like this one, please contact
['"commits@myfaces.apache.org" <co...@myfaces.apache.org>'].