You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2014/08/25 11:57:28 UTC

[1/5] git commit: Add first cut of a docker image for a puppet master

Repository: stratos
Updated Branches:
  refs/heads/master c3158ec7b -> 1c802d6a8


Add first cut of a docker image for a puppet master


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/3528a20c
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/3528a20c
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/3528a20c

Branch: refs/heads/master
Commit: 3528a20c92454331d620ff61fe25cc2bdc618db9
Parents: b60c67b
Author: Chris Snow <ch...@apache.org>
Authored: Sun Aug 3 15:52:42 2014 +0000
Committer: Chris Snow <ch...@apache.org>
Committed: Sun Aug 3 15:55:47 2014 +0000

----------------------------------------------------------------------
 tools/stratos-docker-images/puppet/Dockerfile   | 51 +++++++++++++++++
 .../puppet/docker-build.sh                      | 60 ++++++++++++++++++++
 .../puppet/files/.gitignore                     | 25 ++++++++
 tools/stratos-docker-images/puppet/run          | 58 +++++++++++++++++++
 .../stratos-docker-images/puppet/run-example.sh | 46 +++++++++++++++
 tools/stratos-docker-images/run-example.sh      | 14 +++++
 6 files changed, 254 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/3528a20c/tools/stratos-docker-images/puppet/Dockerfile
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/puppet/Dockerfile b/tools/stratos-docker-images/puppet/Dockerfile
new file mode 100755
index 0000000..2fbd4d5
--- /dev/null
+++ b/tools/stratos-docker-images/puppet/Dockerfile
@@ -0,0 +1,51 @@
+# ----------------------------------------------------------------------------
+#
+#  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 ubuntu:14.04
+
+RUN apt-get update -qq 
+RUN apt-get install -y wget
+
+RUN wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
+RUN dpkg -i puppetlabs-release-precise.deb
+RUN apt-get update -qq 
+RUN apt-get install -y puppetmaster
+
+RUN mkdir -p /etc/puppet/modules/agent/files
+RUN mkdir -p /etc/puppet/modules/java/files
+RUN mkdir -p /etc/puppet/modules/tomcat/files
+
+COPY files/manifests /etc/puppet/manifests
+COPY files/modules /etc/puppet/modules
+
+ADD files/jdk-7u51-linux-x64.tar.gz /etc/puppet/modules/java/files/
+ADD files/apache-tomcat-7.0.52.tar.gz /etc/puppet/modules/tomcat/files/
+
+ADD files/agentfiles.tgz /tmp/
+
+RUN mv /tmp/apache-stratos-cartridge-agent-*.zip /etc/puppet/modules/agent/files/
+RUN mv /tmp/apache-stratos-load-balancer-*.zip /etc/puppet/modules/agent/files/
+
+ADD run /usr/local/bin/run
+RUN chmod +x /usr/local/bin/run
+
+CMD ["/usr/local/bin/run"]
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/3528a20c/tools/stratos-docker-images/puppet/docker-build.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/puppet/docker-build.sh b/tools/stratos-docker-images/puppet/docker-build.sh
new file mode 100755
index 0000000..4ea8c27
--- /dev/null
+++ b/tools/stratos-docker-images/puppet/docker-build.sh
@@ -0,0 +1,60 @@
+#!/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.
+#
+# ----------------------------------------------------------------------------
+
+set -e # exit on error
+
+if [[ -z $STRATOS_SOURCE ]]; then
+  echo "STRATOS_SOURCE environment variable must be set"
+  exit 1
+fi
+
+ACTIVEMQ_URL="http://archive.apache.org/dist/activemq/5.9.1/apache-activemq-5.9.1-bin.tar.gz"
+
+MYSQLJ_URL="http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.29/mysql-connector-java-5.1.29.jar"
+
+# if you change the tomcat version, you will need to change the version in the Dockerfile too
+TOMCAT_URL="http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.52/bin/apache-tomcat-7.0.52.tar.gz"
+
+HAWTBUF_URL="http://repo1.maven.org/maven2/org/fusesource/hawtbuf/hawtbuf/1.2/hawtbuf-1.2.jar"
+
+# if you change the JDK version, you will need to change the version in the Dockerfile too
+JDK_URL="http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz"
+
+wget -N -c -P files $TOMCAT_URL
+
+wget -N -c -P files \
+  --no-cookies --no-check-certificate \
+  --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
+  ${JDK_URL}
+
+cp -rf $STRATOS_SOURCE/tools/puppet3/manifests files/
+cp -rf $STRATOS_SOURCE/tools/puppet3/modules files/
+
+cp -f $STRATOS_SOURCE/products/cartridge-agent/modules/distribution/target/apache-stratos-cartridge-agent-*.zip files/
+
+cp -f $STRATOS_SOURCE/products/load-balancer/modules/distribution/target/apache-stratos-load-balancer-*.zip files/
+
+cd files/
+tar -cvzf agentfiles.tgz apache-stratos-cartridge-agent-*.zip apache-stratos-load-balancer-*.zip 
+cd ..
+
+sudo docker build -t=apachestratos/puppet .

http://git-wip-us.apache.org/repos/asf/stratos/blob/3528a20c/tools/stratos-docker-images/puppet/files/.gitignore
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/puppet/files/.gitignore b/tools/stratos-docker-images/puppet/files/.gitignore
new file mode 100755
index 0000000..9fcfe3a
--- /dev/null
+++ b/tools/stratos-docker-images/puppet/files/.gitignore
@@ -0,0 +1,25 @@
+# ----------------------------------------------------------------------------
+#
+#  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.
+#
+# ----------------------------------------------------------------------------
+
+# Ignore everything in this directory
+*
+# Except this file
+!.gitignore

http://git-wip-us.apache.org/repos/asf/stratos/blob/3528a20c/tools/stratos-docker-images/puppet/run
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/puppet/run b/tools/stratos-docker-images/puppet/run
new file mode 100755
index 0000000..80a4840
--- /dev/null
+++ b/tools/stratos-docker-images/puppet/run
@@ -0,0 +1,58 @@
+#!/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.
+#
+# ----------------------------------------------------------------------------
+
+set -e
+
+TIMEZONE=${TIMEZONE:-"Etc/UTC"}
+
+echo =============================
+echo Environment Variable Settings
+echo =============================
+echo Setting DOMAIN=${DOMAIN}
+echo Setting MASTERHOSTNAME=${MASTERHOSTNAME}
+echo Setting TIMEZONE=${TIMEZONE}
+echo Setting MB_HOSTNAME=${MB_HOSTNAME}
+echo Setting MB_PORT=${MB_PORT}
+echo Setting TRUSTSTORE_PASSWORD=${TRUSTSTORE_PASSWORD}
+echo =============================
+
+echo "${TIMEZONE}" > /etc/timezone
+dpkg-reconfigure --frontend noninteractive tzdata
+
+sed -i 's/START=no/START=yes/' /etc/default/puppetmaster
+echo -e "*.${DOMAIN}" > /etc/puppet/autosign.conf
+sed -i "2i server=${MASTERHOSTNAME}" /etc/puppet/puppet.conf
+sed -i "3i dns_alt_names=${MASTERHOSTNAME}" /etc/puppet/puppet.conf
+
+
+PUPPET_FILE=/etc/puppet/manifests/nodes/base.pp
+
+# TODO java version is hard coded
+sed -i -E "s:(\s*[$]java_name.*=).*$:\1 \"jdk1.7.0_51\":g" $PUPPET_FILE
+sed -i -E "s:(\s*[$]java_distribution.*=).*$:\1 \"jdk-7u51-linux-x64.tar.gz\":g" $PUPPET_FILE
+
+sed -i -E "s:(\s*[$]local_package_dir.*=).*$:\1 \"/mnt/packs\":g" $PUPPET_FILE
+sed -i -E "s:(\s*[$]mb_ip.*=).*$:\1 \"$MB_HOSTNAME\":g" $PUPPET_FILE
+sed -i -E "s:(\s*[$]mb_port.*=).*$:\1 \"$MB_PORT\":g" $PUPPET_FILE
+sed -i -E "s:(\s*[$]truststore_password.*=).*$:\1 \"$TRUSTSTORE_PASSWORD\":g" $PUPPET_FILE
+
+puppet master --no-daemonize --logdest console

http://git-wip-us.apache.org/repos/asf/stratos/blob/3528a20c/tools/stratos-docker-images/puppet/run-example.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/puppet/run-example.sh b/tools/stratos-docker-images/puppet/run-example.sh
new file mode 100755
index 0000000..d42f436
--- /dev/null
+++ b/tools/stratos-docker-images/puppet/run-example.sh
@@ -0,0 +1,46 @@
+#!/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.
+#
+# ----------------------------------------------------------------------------
+
+DOMAIN=stratos.com
+MASTERHOSTNAME=puppet.stratos.com
+MB_HOSTNAME=
+MB_PORT=
+TRUSTSTORE_PASSWORD=wso2carbon
+
+
+# To run interactively:
+# sudo docker run -i -t -e "DOMAIN=${DOMAIN}" -e "MASTERHOSTNAME=${MASTERHOSTNAME}" -p 8140 apachestratos/puppet /bin/bash
+
+PUPPET_ID=$(sudo docker run -d -e "DOMAIN=${DOMAIN}" -e "MASTERHOSTNAME=${MASTERHOSTNAME}" -p 8140 apachestratos/puppet)
+PUPPET_IP_ADDR=$(sudo docker inspect --format '{{ .NetworkSettings.Gateway }}' $PUPPET_ID)
+PUPPET_PORT=$(sudo docker port $PUPPET_ID 8140 | awk -F':' '{ print $2 }')
+
+echo Puppet container ID: ${PUPPET_ID}
+echo Puppet master reachable on IP address: ${PUPPET_IP_ADDR}
+echo Puppet master reachable on port: ${PUPPET_PORT}
+
+
+echo Connection test:
+echo puppet agent --server puppet.stratos.com --masterport ${PUPPET_PORT} --test --verbose --debug
+
+echo View container logs:
+echo sudo docker logs -f ${PUPPET_ID}

http://git-wip-us.apache.org/repos/asf/stratos/blob/3528a20c/tools/stratos-docker-images/run-example.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/run-example.sh b/tools/stratos-docker-images/run-example.sh
index 714fa8b..a47a054 100755
--- a/tools/stratos-docker-images/run-example.sh
+++ b/tools/stratos-docker-images/run-example.sh
@@ -33,6 +33,20 @@ MB_IP_ADDR=$(sudo docker inspect --format '{{ .NetworkSettings.Gateway }}' $MB_I
 MB_PORT=$(sudo docker port $MB_ID 61616 | awk -F':' '{ print $2 }')
 
 #
+# Start Puppet Container
+#
+
+DOMAIN=stratos.com
+MASTERHOSTNAME=puppet.stratos.com
+MB_HOSTNAME=${MB_IP_ADDR}
+MB_PORT=${MB_PORT}
+TRUSTSTORE_PASSWORD=wso2carbon
+
+PUPPET_ID=$(sudo docker run -d -e "DOMAIN=${DOMAIN}" -e "MASTERHOSTNAME=${MASTERHOSTNAME}" -e "MB_HOSTNAME=${MB_HOSTNAME}" -e "MB_PORT=${MB_PORT}" -e "TRUSTSTORE_PASSWORD=${TRUSTSTORE_PASSWORD}" -p 8140 apachestratos/puppet)
+PUPPET_IP_ADDR=$(sudo docker inspect --format '{{ .NetworkSettings.Gateway }}' $PUPPET_ID)
+PUPPET_PORT=$(sudo docker port $PUPPET_ID 8140 | awk -F':' '{ print $2 }')
+
+#
 # Start mysql docker container 
 # (skip this step if you already have mysql already installed that has a Stratos schema)
 # 


[2/5] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/stratos

Posted by ni...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/stratos


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/5fd8b08d
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/5fd8b08d
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/5fd8b08d

Branch: refs/heads/master
Commit: 5fd8b08df3a446e19f21d66c86b935b67e1b234a
Parents: 3528a20 75d3efb
Author: Chris Snow <ch...@apache.org>
Authored: Sun Aug 3 16:50:00 2014 +0000
Committer: Chris Snow <ch...@apache.org>
Committed: Sun Aug 3 16:50:00 2014 +0000

----------------------------------------------------------------------
 .../stratos/cli/completer/CommandCompleter.java |  9 ++++
 .../cli/completer/StratosFileNameCompleter.java | 48 ++++++++++++++++++++
 2 files changed, 57 insertions(+)
----------------------------------------------------------------------



[3/5] git commit: Merge branch 'puppet-docker' of https://github.com/snowch/stratos

Posted by ni...@apache.org.
Merge branch 'puppet-docker' of https://github.com/snowch/stratos


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/02fe8ced
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/02fe8ced
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/02fe8ced

Branch: refs/heads/master
Commit: 02fe8ced56f0422efcbea636bddf51a8aa51136f
Parents: c3158ec 5fd8b08
Author: Nirmal Fernando <ni...@gmail.com>
Authored: Sun Aug 24 20:04:33 2014 +0530
Committer: Nirmal Fernando <ni...@gmail.com>
Committed: Sun Aug 24 20:04:33 2014 +0530

----------------------------------------------------------------------
 tools/stratos-docker-images/puppet/Dockerfile   | 51 +++++++++++++++++
 .../puppet/docker-build.sh                      | 60 ++++++++++++++++++++
 .../puppet/files/.gitignore                     | 25 ++++++++
 tools/stratos-docker-images/puppet/run          | 58 +++++++++++++++++++
 .../stratos-docker-images/puppet/run-example.sh | 46 +++++++++++++++
 tools/stratos-docker-images/run-example.sh      | 14 +++++
 6 files changed, 254 insertions(+)
----------------------------------------------------------------------



[5/5] git commit: Revert "Add first cut of a docker image for a puppet master"

Posted by ni...@apache.org.
Revert "Add first cut of a docker image for a puppet master"

This reverts commit 3528a20c92454331d620ff61fe25cc2bdc618db9.


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/1c802d6a
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/1c802d6a
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/1c802d6a

Branch: refs/heads/master
Commit: 1c802d6a86be6241799e5c626f7954a4d704ef80
Parents: 2cec550
Author: Nirmal Fernando <ni...@gmail.com>
Authored: Mon Aug 25 15:25:39 2014 +0530
Committer: Nirmal Fernando <ni...@gmail.com>
Committed: Mon Aug 25 15:25:39 2014 +0530

----------------------------------------------------------------------
 tools/stratos-docker-images/puppet/Dockerfile   | 51 -----------------
 .../puppet/docker-build.sh                      | 60 --------------------
 .../puppet/files/.gitignore                     | 25 --------
 tools/stratos-docker-images/puppet/run          | 58 -------------------
 .../stratos-docker-images/puppet/run-example.sh | 46 ---------------
 tools/stratos-docker-images/run-example.sh      | 14 -----
 6 files changed, 254 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/1c802d6a/tools/stratos-docker-images/puppet/Dockerfile
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/puppet/Dockerfile b/tools/stratos-docker-images/puppet/Dockerfile
deleted file mode 100755
index 2fbd4d5..0000000
--- a/tools/stratos-docker-images/puppet/Dockerfile
+++ /dev/null
@@ -1,51 +0,0 @@
-# ----------------------------------------------------------------------------
-#
-#  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 ubuntu:14.04
-
-RUN apt-get update -qq 
-RUN apt-get install -y wget
-
-RUN wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
-RUN dpkg -i puppetlabs-release-precise.deb
-RUN apt-get update -qq 
-RUN apt-get install -y puppetmaster
-
-RUN mkdir -p /etc/puppet/modules/agent/files
-RUN mkdir -p /etc/puppet/modules/java/files
-RUN mkdir -p /etc/puppet/modules/tomcat/files
-
-COPY files/manifests /etc/puppet/manifests
-COPY files/modules /etc/puppet/modules
-
-ADD files/jdk-7u51-linux-x64.tar.gz /etc/puppet/modules/java/files/
-ADD files/apache-tomcat-7.0.52.tar.gz /etc/puppet/modules/tomcat/files/
-
-ADD files/agentfiles.tgz /tmp/
-
-RUN mv /tmp/apache-stratos-cartridge-agent-*.zip /etc/puppet/modules/agent/files/
-RUN mv /tmp/apache-stratos-load-balancer-*.zip /etc/puppet/modules/agent/files/
-
-ADD run /usr/local/bin/run
-RUN chmod +x /usr/local/bin/run
-
-CMD ["/usr/local/bin/run"]
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/1c802d6a/tools/stratos-docker-images/puppet/docker-build.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/puppet/docker-build.sh b/tools/stratos-docker-images/puppet/docker-build.sh
deleted file mode 100755
index 4ea8c27..0000000
--- a/tools/stratos-docker-images/puppet/docker-build.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/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.
-#
-# ----------------------------------------------------------------------------
-
-set -e # exit on error
-
-if [[ -z $STRATOS_SOURCE ]]; then
-  echo "STRATOS_SOURCE environment variable must be set"
-  exit 1
-fi
-
-ACTIVEMQ_URL="http://archive.apache.org/dist/activemq/5.9.1/apache-activemq-5.9.1-bin.tar.gz"
-
-MYSQLJ_URL="http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.29/mysql-connector-java-5.1.29.jar"
-
-# if you change the tomcat version, you will need to change the version in the Dockerfile too
-TOMCAT_URL="http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.52/bin/apache-tomcat-7.0.52.tar.gz"
-
-HAWTBUF_URL="http://repo1.maven.org/maven2/org/fusesource/hawtbuf/hawtbuf/1.2/hawtbuf-1.2.jar"
-
-# if you change the JDK version, you will need to change the version in the Dockerfile too
-JDK_URL="http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz"
-
-wget -N -c -P files $TOMCAT_URL
-
-wget -N -c -P files \
-  --no-cookies --no-check-certificate \
-  --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
-  ${JDK_URL}
-
-cp -rf $STRATOS_SOURCE/tools/puppet3/manifests files/
-cp -rf $STRATOS_SOURCE/tools/puppet3/modules files/
-
-cp -f $STRATOS_SOURCE/products/cartridge-agent/modules/distribution/target/apache-stratos-cartridge-agent-*.zip files/
-
-cp -f $STRATOS_SOURCE/products/load-balancer/modules/distribution/target/apache-stratos-load-balancer-*.zip files/
-
-cd files/
-tar -cvzf agentfiles.tgz apache-stratos-cartridge-agent-*.zip apache-stratos-load-balancer-*.zip 
-cd ..
-
-sudo docker build -t=apachestratos/puppet .

http://git-wip-us.apache.org/repos/asf/stratos/blob/1c802d6a/tools/stratos-docker-images/puppet/files/.gitignore
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/puppet/files/.gitignore b/tools/stratos-docker-images/puppet/files/.gitignore
deleted file mode 100755
index 9fcfe3a..0000000
--- a/tools/stratos-docker-images/puppet/files/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-# ----------------------------------------------------------------------------
-#
-#  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.
-#
-# ----------------------------------------------------------------------------
-
-# Ignore everything in this directory
-*
-# Except this file
-!.gitignore

http://git-wip-us.apache.org/repos/asf/stratos/blob/1c802d6a/tools/stratos-docker-images/puppet/run
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/puppet/run b/tools/stratos-docker-images/puppet/run
deleted file mode 100755
index 80a4840..0000000
--- a/tools/stratos-docker-images/puppet/run
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/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.
-#
-# ----------------------------------------------------------------------------
-
-set -e
-
-TIMEZONE=${TIMEZONE:-"Etc/UTC"}
-
-echo =============================
-echo Environment Variable Settings
-echo =============================
-echo Setting DOMAIN=${DOMAIN}
-echo Setting MASTERHOSTNAME=${MASTERHOSTNAME}
-echo Setting TIMEZONE=${TIMEZONE}
-echo Setting MB_HOSTNAME=${MB_HOSTNAME}
-echo Setting MB_PORT=${MB_PORT}
-echo Setting TRUSTSTORE_PASSWORD=${TRUSTSTORE_PASSWORD}
-echo =============================
-
-echo "${TIMEZONE}" > /etc/timezone
-dpkg-reconfigure --frontend noninteractive tzdata
-
-sed -i 's/START=no/START=yes/' /etc/default/puppetmaster
-echo -e "*.${DOMAIN}" > /etc/puppet/autosign.conf
-sed -i "2i server=${MASTERHOSTNAME}" /etc/puppet/puppet.conf
-sed -i "3i dns_alt_names=${MASTERHOSTNAME}" /etc/puppet/puppet.conf
-
-
-PUPPET_FILE=/etc/puppet/manifests/nodes/base.pp
-
-# TODO java version is hard coded
-sed -i -E "s:(\s*[$]java_name.*=).*$:\1 \"jdk1.7.0_51\":g" $PUPPET_FILE
-sed -i -E "s:(\s*[$]java_distribution.*=).*$:\1 \"jdk-7u51-linux-x64.tar.gz\":g" $PUPPET_FILE
-
-sed -i -E "s:(\s*[$]local_package_dir.*=).*$:\1 \"/mnt/packs\":g" $PUPPET_FILE
-sed -i -E "s:(\s*[$]mb_ip.*=).*$:\1 \"$MB_HOSTNAME\":g" $PUPPET_FILE
-sed -i -E "s:(\s*[$]mb_port.*=).*$:\1 \"$MB_PORT\":g" $PUPPET_FILE
-sed -i -E "s:(\s*[$]truststore_password.*=).*$:\1 \"$TRUSTSTORE_PASSWORD\":g" $PUPPET_FILE
-
-puppet master --no-daemonize --logdest console

http://git-wip-us.apache.org/repos/asf/stratos/blob/1c802d6a/tools/stratos-docker-images/puppet/run-example.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/puppet/run-example.sh b/tools/stratos-docker-images/puppet/run-example.sh
deleted file mode 100755
index d42f436..0000000
--- a/tools/stratos-docker-images/puppet/run-example.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/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.
-#
-# ----------------------------------------------------------------------------
-
-DOMAIN=stratos.com
-MASTERHOSTNAME=puppet.stratos.com
-MB_HOSTNAME=
-MB_PORT=
-TRUSTSTORE_PASSWORD=wso2carbon
-
-
-# To run interactively:
-# sudo docker run -i -t -e "DOMAIN=${DOMAIN}" -e "MASTERHOSTNAME=${MASTERHOSTNAME}" -p 8140 apachestratos/puppet /bin/bash
-
-PUPPET_ID=$(sudo docker run -d -e "DOMAIN=${DOMAIN}" -e "MASTERHOSTNAME=${MASTERHOSTNAME}" -p 8140 apachestratos/puppet)
-PUPPET_IP_ADDR=$(sudo docker inspect --format '{{ .NetworkSettings.Gateway }}' $PUPPET_ID)
-PUPPET_PORT=$(sudo docker port $PUPPET_ID 8140 | awk -F':' '{ print $2 }')
-
-echo Puppet container ID: ${PUPPET_ID}
-echo Puppet master reachable on IP address: ${PUPPET_IP_ADDR}
-echo Puppet master reachable on port: ${PUPPET_PORT}
-
-
-echo Connection test:
-echo puppet agent --server puppet.stratos.com --masterport ${PUPPET_PORT} --test --verbose --debug
-
-echo View container logs:
-echo sudo docker logs -f ${PUPPET_ID}

http://git-wip-us.apache.org/repos/asf/stratos/blob/1c802d6a/tools/stratos-docker-images/run-example.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/run-example.sh b/tools/stratos-docker-images/run-example.sh
index a47a054..714fa8b 100755
--- a/tools/stratos-docker-images/run-example.sh
+++ b/tools/stratos-docker-images/run-example.sh
@@ -33,20 +33,6 @@ MB_IP_ADDR=$(sudo docker inspect --format '{{ .NetworkSettings.Gateway }}' $MB_I
 MB_PORT=$(sudo docker port $MB_ID 61616 | awk -F':' '{ print $2 }')
 
 #
-# Start Puppet Container
-#
-
-DOMAIN=stratos.com
-MASTERHOSTNAME=puppet.stratos.com
-MB_HOSTNAME=${MB_IP_ADDR}
-MB_PORT=${MB_PORT}
-TRUSTSTORE_PASSWORD=wso2carbon
-
-PUPPET_ID=$(sudo docker run -d -e "DOMAIN=${DOMAIN}" -e "MASTERHOSTNAME=${MASTERHOSTNAME}" -e "MB_HOSTNAME=${MB_HOSTNAME}" -e "MB_PORT=${MB_PORT}" -e "TRUSTSTORE_PASSWORD=${TRUSTSTORE_PASSWORD}" -p 8140 apachestratos/puppet)
-PUPPET_IP_ADDR=$(sudo docker inspect --format '{{ .NetworkSettings.Gateway }}' $PUPPET_ID)
-PUPPET_PORT=$(sudo docker port $PUPPET_ID 8140 | awk -F':' '{ print $2 }')
-
-#
 # Start mysql docker container 
 # (skip this step if you already have mysql already installed that has a Stratos schema)
 # 


[4/5] git commit: Removing sudo from the docker scripts. After this you have to run these docker scripts as root user.

Posted by ni...@apache.org.
Removing sudo from the docker scripts. After this you have to run these docker scripts as root user.


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/2cec5507
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/2cec5507
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/2cec5507

Branch: refs/heads/master
Commit: 2cec5507cdf6600535644c0dc85fbfc8f81f90f0
Parents: 02fe8ce
Author: Nirmal Fernando <ni...@gmail.com>
Authored: Mon Aug 25 15:22:59 2014 +0530
Committer: Nirmal Fernando <ni...@gmail.com>
Committed: Mon Aug 25 15:22:59 2014 +0530

----------------------------------------------------------------------
 tools/stratos-docker-images/activemq/docker-build.sh | 2 +-
 tools/stratos-docker-images/activemq/docker-run.sh   | 2 +-
 tools/stratos-docker-images/mysql/docker-build.sh    | 8 ++++----
 tools/stratos-docker-images/stratos/docker-build.sh  | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/2cec5507/tools/stratos-docker-images/activemq/docker-build.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/activemq/docker-build.sh b/tools/stratos-docker-images/activemq/docker-build.sh
index eebaf21..81daa41 100755
--- a/tools/stratos-docker-images/activemq/docker-build.sh
+++ b/tools/stratos-docker-images/activemq/docker-build.sh
@@ -23,4 +23,4 @@
 #  Server configuration script for Apache Stratos
 # ----------------------------------------------------------------------------
 
-sudo docker build -t=apachestratos/activemq .
+docker build -t=apachestratos/activemq .

http://git-wip-us.apache.org/repos/asf/stratos/blob/2cec5507/tools/stratos-docker-images/activemq/docker-run.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/activemq/docker-run.sh b/tools/stratos-docker-images/activemq/docker-run.sh
index cabfa75..197d74f 100755
--- a/tools/stratos-docker-images/activemq/docker-run.sh
+++ b/tools/stratos-docker-images/activemq/docker-run.sh
@@ -23,4 +23,4 @@
 #  Server configuration script for Apache Stratos
 # ----------------------------------------------------------------------------
 
-sudo docker run -p=61616:61616 -p=8161:8161 -d apache-stratos/activemq
+docker run -p=61616:61616 -p=8161:8161 -d apachestratos/activemq

http://git-wip-us.apache.org/repos/asf/stratos/blob/2cec5507/tools/stratos-docker-images/mysql/docker-build.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/mysql/docker-build.sh b/tools/stratos-docker-images/mysql/docker-build.sh
index 3a6a3b3..98346d1 100755
--- a/tools/stratos-docker-images/mysql/docker-build.sh
+++ b/tools/stratos-docker-images/mysql/docker-build.sh
@@ -25,7 +25,7 @@
 # NOTE: mysql container uses--init-file option which does not like comments 
 # and likes each command on its own line
 
-cp -f /home/vagrant/stratos-source/tools/stratos-installer/resources/mysql.sql files/mysql.tmp.0
+cp -f $STRATOS_SOURCE/tools/stratos-installer/resources/mysql.sql files/mysql.tmp.0
 
 # strip singleline comments
 grep -v '^--.*$' files/mysql.tmp.0 > files/mysql.tmp.1
@@ -34,14 +34,14 @@ grep -v '^--.*$' files/mysql.tmp.0 > files/mysql.tmp.1
 perl -0777 -pe 's{/\*.*?\*/}{}gs' files/mysql.tmp.1 > files/mysql.sql
 
 # remove newlines
-sed -i ':a;N;$!ba;s/\n/ /g' files/mysql.sql
+sed -i -e ':a;N;$!ba;s/\n/ /g' files/mysql.sql
 
 # replace ; with ;\n
-sed -i 's/;/;\n/g' files/mysql.sql
+sed -i -e 's/;/;\n/g' files/mysql.sql
 
 rm files/mysql.tmp.*
 
 ### build docker
 
-sudo docker build -t=apachestratos/mysql .
+docker build -t=apachestratos/mysql .
 #sudo docker push apachestratos/mysql

http://git-wip-us.apache.org/repos/asf/stratos/blob/2cec5507/tools/stratos-docker-images/stratos/docker-build.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-docker-images/stratos/docker-build.sh b/tools/stratos-docker-images/stratos/docker-build.sh
index 0c33bba..fc890cc 100755
--- a/tools/stratos-docker-images/stratos/docker-build.sh
+++ b/tools/stratos-docker-images/stratos/docker-build.sh
@@ -28,8 +28,8 @@ wget -N -q -P files/ http://archive.apache.org/dist/activemq/5.9.1/apache-active
 
 wget -N -q -P files/ http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.29/mysql-connector-java-5.1.29.jar
 
-cp -rf $STRATOS_SOURCE/tools/stratos-installer/ files/
+cp -rf $STRATOS_SOURCE/tools/stratos-installer files/
 
 cp -rf $STRATOS_SOURCE/extensions/ files/
 
-sudo docker build -t=apachestratos/stratos .
+docker build -t=apachestratos/stratos .