From 7abb96b48d38ae7ed60981bdaa93300d7bb641fc Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Sun, 11 Dec 2016 22:12:44 +0100 Subject: [PATCH 1/5] Created __docker_compose type for cdist Features: - Install __docker_compose --- .../conf/type/__docker_compose/gencode-remote | 5 +++ cdist/conf/type/__docker_compose/man.rst | 45 +++++++++++++++++++ cdist/conf/type/__docker_compose/manifest | 24 ++++++++++ cdist/conf/type/__docker_compose/singleton | 0 4 files changed, 74 insertions(+) create mode 100644 cdist/conf/type/__docker_compose/gencode-remote create mode 100644 cdist/conf/type/__docker_compose/man.rst create mode 100644 cdist/conf/type/__docker_compose/manifest create mode 100644 cdist/conf/type/__docker_compose/singleton diff --git a/cdist/conf/type/__docker_compose/gencode-remote b/cdist/conf/type/__docker_compose/gencode-remote new file mode 100644 index 00000000..825dc17a --- /dev/null +++ b/cdist/conf/type/__docker_compose/gencode-remote @@ -0,0 +1,5 @@ +# Download docker-compose file +echo 'curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose' + +# Change permissions +echo 'chmod +x /usr/local/bin/docker-compose' diff --git a/cdist/conf/type/__docker_compose/man.rst b/cdist/conf/type/__docker_compose/man.rst new file mode 100644 index 00000000..2eb1b964 --- /dev/null +++ b/cdist/conf/type/__docker_compose/man.rst @@ -0,0 +1,45 @@ +cdist-type__docker_compose(7) +============================= + +NAME +---- +cdist-type__docker_compose - install docker-compose + + +DESCRIPTION +----------- +Installs latest docker-compose package from dockerproject.org. + + +REQUIRED PARAMETERS +------------------- +None. + + +OPTIONAL PARAMETERS +------------------- +None. + + +BOOLEAN PARAMETERS +------------------ +None. + + +EXAMPLES +-------- + +.. code-block:: sh + + __docker_compose + + +AUTHORS +------- +Dominique Roux + + +COPYING +------- +Copyright \(C) 2016 Dominique Roux. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/cdist/conf/type/__docker_compose/manifest b/cdist/conf/type/__docker_compose/manifest new file mode 100644 index 00000000..2ff80aca --- /dev/null +++ b/cdist/conf/type/__docker_compose/manifest @@ -0,0 +1,24 @@ +#!/bin/sh +# +# 2016 Dominique Roux (dominique.roux at ungleich.ch) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# + +# Needed packages +__docker +__package curl diff --git a/cdist/conf/type/__docker_compose/singleton b/cdist/conf/type/__docker_compose/singleton new file mode 100644 index 00000000..e69de29b From afd0d8c8c824b1c7d921d68bc7997323111c8bfd Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Mon, 12 Dec 2016 09:09:48 +0100 Subject: [PATCH 2/5] Added / Changed license to GPLv3+ --- .../conf/type/__docker_compose/gencode-remote | 20 +++++++++++++++++++ cdist/conf/type/__docker_compose/man.rst | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/cdist/conf/type/__docker_compose/gencode-remote b/cdist/conf/type/__docker_compose/gencode-remote index 825dc17a..93609172 100644 --- a/cdist/conf/type/__docker_compose/gencode-remote +++ b/cdist/conf/type/__docker_compose/gencode-remote @@ -1,3 +1,23 @@ +#!/bin/sh +# +# 2016 Dominique Roux (dominique.roux at ungleich.ch) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# + # Download docker-compose file echo 'curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose' diff --git a/cdist/conf/type/__docker_compose/man.rst b/cdist/conf/type/__docker_compose/man.rst index 2eb1b964..4e57b156 100644 --- a/cdist/conf/type/__docker_compose/man.rst +++ b/cdist/conf/type/__docker_compose/man.rst @@ -42,4 +42,4 @@ Dominique Roux COPYING ------- Copyright \(C) 2016 Dominique Roux. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). +granted under the terms of the GNU General Public License version 3 or later (GPLv3+). From db50e2e9e28d8782d5bf87078547413babc0caa5 Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Mon, 12 Dec 2016 19:43:15 +0100 Subject: [PATCH 3/5] Added parameter --version to define the docker-compose version --- cdist/conf/type/__docker_compose/gencode-remote | 5 ++++- cdist/conf/type/__docker_compose/parameter/default/version | 1 + cdist/conf/type/__docker_compose/parameter/optional | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 cdist/conf/type/__docker_compose/parameter/default/version create mode 100644 cdist/conf/type/__docker_compose/parameter/optional diff --git a/cdist/conf/type/__docker_compose/gencode-remote b/cdist/conf/type/__docker_compose/gencode-remote index 93609172..f22823d3 100644 --- a/cdist/conf/type/__docker_compose/gencode-remote +++ b/cdist/conf/type/__docker_compose/gencode-remote @@ -18,8 +18,11 @@ # along with cdist. If not, see . # +# Variables +version="$(cat "$__object/parameter/version")" + # Download docker-compose file -echo 'curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose' +echo 'curl -L "https://github.com/docker/compose/releases/download/'${version}'/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose' # Change permissions echo 'chmod +x /usr/local/bin/docker-compose' diff --git a/cdist/conf/type/__docker_compose/parameter/default/version b/cdist/conf/type/__docker_compose/parameter/default/version new file mode 100644 index 00000000..f8e233b2 --- /dev/null +++ b/cdist/conf/type/__docker_compose/parameter/default/version @@ -0,0 +1 @@ +1.9.0 diff --git a/cdist/conf/type/__docker_compose/parameter/optional b/cdist/conf/type/__docker_compose/parameter/optional new file mode 100644 index 00000000..088eda41 --- /dev/null +++ b/cdist/conf/type/__docker_compose/parameter/optional @@ -0,0 +1 @@ +version From f180cbcb09d42400d110ef605d44b02fbc34327b Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Tue, 13 Dec 2016 08:09:14 +0100 Subject: [PATCH 4/5] documented --version parameter --- cdist/conf/type/__docker_compose/man.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cdist/conf/type/__docker_compose/man.rst b/cdist/conf/type/__docker_compose/man.rst index 4e57b156..29c47fbf 100644 --- a/cdist/conf/type/__docker_compose/man.rst +++ b/cdist/conf/type/__docker_compose/man.rst @@ -18,7 +18,8 @@ None. OPTIONAL PARAMETERS ------------------- -None. +version + Define docker_compose version. BOOLEAN PARAMETERS @@ -33,6 +34,9 @@ EXAMPLES __docker_compose + # Install version 1.9.0-rc4 + __docker_compose --version 1.9.0-rc4 + AUTHORS ------- From d6f972057e7ed5b357a1709627fef4605b2ead1c Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Tue, 13 Dec 2016 08:16:24 +0100 Subject: [PATCH 5/5] updated documentation --- cdist/conf/type/__docker_compose/man.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cdist/conf/type/__docker_compose/man.rst b/cdist/conf/type/__docker_compose/man.rst index 29c47fbf..720a306e 100644 --- a/cdist/conf/type/__docker_compose/man.rst +++ b/cdist/conf/type/__docker_compose/man.rst @@ -8,7 +8,7 @@ cdist-type__docker_compose - install docker-compose DESCRIPTION ----------- -Installs latest docker-compose package from dockerproject.org. +Installs docker-compose package. REQUIRED PARAMETERS @@ -19,7 +19,7 @@ None. OPTIONAL PARAMETERS ------------------- version - Define docker_compose version. + Define docker_compose version, defaults to "1.9.0" BOOLEAN PARAMETERS