├── .gitignore ├── ci ├── set-pipeline.sh └── pipeline.yml ├── sdkman.config ├── sdkman ├── sdkman-wrapper.sh └── sdkman-exec.sh ├── push.sh ├── README.md ├── Dockerfile ├── docker-lib.sh ├── LICENSE.txt └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | credentials.yml 2 | -------------------------------------------------------------------------------- /ci/set-pipeline.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo y | fly -t main sp -p alpine-java-bash-git -c pipeline.yml -l credentials.yml 3 | -------------------------------------------------------------------------------- /sdkman.config: -------------------------------------------------------------------------------- 1 | # make gvm non-interactive, great for CI environments 2 | sdkman_auto_answer=true 3 | 4 | # don't prompt user to selfupdate on new shell 5 | sdkman_suggestive_selfupdate=false 6 | 7 | # don't perform automatic selfupdates 8 | sdkman_auto_selfupdate=false -------------------------------------------------------------------------------- /sdkman/sdkman-wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # A quick wrapper to source the gvm env and run it 4 | # This is used to run gvm in Dockerfile RUN commands 5 | # since the RUN commands does not use interactive shells 6 | 7 | [[ -s "/root/.sdkman/bin/sdkman-init.sh" ]] && source "/root/.sdkman/bin/sdkman-init.sh" && sdk $@ -------------------------------------------------------------------------------- /sdkman/sdkman-exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # A quick wrapper to source the gvm env and run a command 4 | # This is used to run sdkman in Dockerfile RUN commands 5 | # since the RUN commands does not use interactive shells 6 | 7 | [[ -s "/root/.sdkman/bin/sdkman-init.sh" ]] && source "/root/.sdkman/bin/sdkman-init.sh" && exec "$@" -------------------------------------------------------------------------------- /push.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -e 4 | 5 | export pipelineBaseTag=0.7.0 6 | echo -e "\n\nBUILDING THE IMAGE\n\n" 7 | docker build -t cloudpipelines/pipeline-base . --no-cache 8 | imageId="$( docker images cloudpipelines/pipeline-base | grep "${pipelineBaseTag}" | awk '{print $3}' )" 9 | echo -e "\n\nFOUND THE IMAGE WITH ID [${imageId}]\n\n" 10 | // find the proper image e.g. 95610717ba45 11 | // pick proper version e.g. 0.7.0 12 | docker tag "${imageId}" cloudpipelines/pipeline-base:"${pipelineBaseTag}" 13 | docker tag "${imageId}" cloudpipelines/pipeline-base:latest 14 | docker login 15 | docker push cloudpipelines/pipeline-base 16 | git tag v"${pipelineBaseTag}" 17 | git push origin v"${pipelineBaseTag}" 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cloudpipeline-base is no longer actively maintained by VMware, Inc. 2 | 3 | # Pipeline-base 4 | 5 | [![](https://images.microbadger.com/badges/image/cloudpipelines/pipeline-base-git.svg)](https://microbadger.com/images/cloudpipelines/pipeline-base "Get your own image badge on microbadger.com") 6 | 7 | Alpine docker image with openjdk and git and bash, ruby and other libraries required 8 | for the opinionated pipeline. 9 | 10 | ## How to do it 11 | 12 | Follow the instructions starting from [https://docs.docker.com/engine/getstarted/step_four/](here) 13 | 14 | ``` 15 | $ docker build -t pipeline-base . --no-cache 16 | $ docker images 17 | // find the proper image e.g. 95610717ba45 18 | // pick proper version e.g. 0.1.0 19 | $ docker tag 95610717ba45 cloudpipelines/pipeline-base:0.1.0 20 | $ docker tag 95610717ba45 cloudpipelines/pipeline-base:latest 21 | $ docker login 22 | $ docker push cloudpipelines/pipeline-base 23 | ``` 24 | -------------------------------------------------------------------------------- /ci/pipeline.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | jobs: 4 | - name: build-ship-it 5 | serial: true 6 | public: true 7 | plan: 8 | - aggregate: 9 | - get: alpine-docker-image 10 | trigger: true 11 | # params: 12 | # skip_download: true 13 | - get: alpine-bash-git 14 | trigger: true 15 | - put: version 16 | params: {bump: minor} 17 | - put: alpine-bash-docker-image 18 | params: 19 | build: alpine-bash-git/ 20 | tag: version/number 21 | tag_as_latest: true 22 | - put: alpine-bash-git 23 | params: 24 | repository: alpine-bash-git 25 | tag: version/number 26 | 27 | resources: 28 | - name: alpine-bash-git 29 | type: git 30 | source: 31 | uri: git@github.com:spring-cloud/alpine-java-bash-git.git 32 | branch: master 33 | private_key: {{github-private-key}} 34 | 35 | - name: alpine-bash-docker-image 36 | type: docker-image 37 | source: 38 | repository: {{docker-repo}} 39 | email: {{docker-email}} 40 | username: {{docker-username}} 41 | password: {{docker-password}} 42 | 43 | - name: alpine-docker-image 44 | type: docker-image 45 | source: 46 | repository: openjdk 47 | tag: 8-jdk-alpine 48 | 49 | - name: version 50 | type: semver 51 | source: 52 | uri: git@github.com:spring-cloud/alpine-java-bash-git.git 53 | branch: version 54 | private_key: {{github-private-key}} 55 | file: version 56 | driver: git 57 | initial_version: 0.9.0 58 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:19.04 2 | 3 | MAINTAINER Toshiaki Maki 4 | MAINTAINER Marcin Grzejszczak 5 | 6 | ARG SDKMAN_JAVA_INSTALLATION=8.0.242.j9-adpt 7 | ARG UBUNTU_VERSION=19.04 8 | 9 | ENV RUBY_VERSION 2.3.1 10 | ENV TERM dumb 11 | ENV ENTRYKIT_VERSION=0.4.0 12 | ENV DEBIAN_FRONTEND noninteractive 13 | 14 | # Create a user that we can use besides root when building app 15 | RUN groupadd -g 999 appuser && \ 16 | useradd -r -u 999 -m -g appuser appuser 17 | 18 | RUN apt-get -y update 19 | RUN apt-get -y install \ 20 | sudo \ 21 | software-properties-common \ 22 | bash \ 23 | git \ 24 | tar \ 25 | openssh-client \ 26 | zip \ 27 | curl \ 28 | ruby \ 29 | build-essential \ 30 | wget \ 31 | libssl-dev \ 32 | libxml2-dev \ 33 | libsqlite3-dev \ 34 | libxslt1-dev \ 35 | libpq-dev \ 36 | bsdtar \ 37 | unzip \ 38 | python \ 39 | gem \ 40 | xvfb \ 41 | x11-xkb-utils \ 42 | xfonts-100dpi \ 43 | xfonts-75dpi \ 44 | xfonts-scalable \ 45 | xfonts-cyrillic \ 46 | x11-apps \ 47 | libqtwebkit-dev \ 48 | qt4-qmake \ 49 | jq \ 50 | apt-transport-https 51 | 52 | RUN wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - 53 | RUN echo "deb https://packages.cloudfoundry.org/debian stable main" | tee /etc/apt/sources.list.d/cloudfoundry-cli.list 54 | 55 | RUN apt-get update && \ 56 | apt-get dist-upgrade -y 57 | 58 | ## Remove any existing JDKs 59 | RUN apt-get --purge remove openjdk* 60 | 61 | # Install sdkman and java 62 | RUN curl -s https://get.sdkman.io/ | bash 63 | COPY sdkman.config /.sdkman/etc/config 64 | COPY sdkman/ /usr/local/bin/ 65 | RUN /bin/bash -c "chmod +x /usr/local/bin/sdkman-exec.sh && chmod +x /usr/local/bin/sdkman-wrapper.sh && chmod +x /root/.sdkman/bin/sdkman-init.sh" 66 | RUN /bin/bash -c "source /root/.sdkman/bin/sdkman-init.sh" 67 | RUN sdkman-wrapper.sh install java "${SDKMAN_JAVA_INSTALLATION}" 68 | ENV JAVA_HOME /root/.sdkman/candidates/java/current/ 69 | ENV PATH "${PATH}:${JAVA_HOME}/bin" 70 | 71 | RUN apt-get -y update 72 | RUN apt-get -y install \ 73 | cf-cli 74 | 75 | # Install entrykit 76 | RUN curl -L https://github.com/progrium/entrykit/releases/download/v${ENTRYKIT_VERSION}/entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz | tar zx && \ 77 | chmod +x entrykit && \ 78 | mv entrykit /bin/entrykit && \ 79 | entrykit --symlink 80 | 81 | # Making docker in docker possible 82 | #USER root 83 | RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y install apt-transport-https ca-certificates && \ 84 | echo "deb https://apt.dockerproject.org/repo debian-jessie main" | tee /etc/apt/sources.list.d/docker.list && \ 85 | apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \ 86 | DEBIAN_FRONTEND=noninteractive apt-get update && \ 87 | apt-get install --assume-yes docker-engine && \ 88 | echo 'Defaults env_keep += "HOME"' >> /etc/sudoers 89 | 90 | # Include useful functions to start/stop docker daemon in garden-runc containers in Concourse CI. 91 | # Example: source /docker-lib.sh && start_docker 92 | COPY docker-lib.sh /docker-lib.sh 93 | 94 | # DOTNET 95 | RUN wget -q https://packages.microsoft.com/config/ubuntu/${UBUNTU_VERSION}/packages-microsoft-prod.deb && dpkg -i packages-microsoft-prod.deb 96 | RUN apt-get -y install apt-transport-https 97 | RUN apt-get update 98 | RUN apt-get -y install dotnet-sdk-2.1 99 | 100 | # NODEJS 101 | RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - 102 | RUN apt-get install -y nodejs 103 | 104 | # PHP 105 | ENV LANG=C.UTF-8 106 | RUN add-apt-repository -y ppa:ondrej/php 107 | RUN apt-get -y update && apt-get -y install php7.2 108 | RUN apt-get -y install php-pear php7.2-curl php7.2-dev php7.2-gd php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xml 109 | 110 | ENTRYPOINT [ \ 111 | "switch", \ 112 | "shell=/bin/sh", "--", \ 113 | "codep", \ 114 | "/bin/docker daemon" \ 115 | ] 116 | -------------------------------------------------------------------------------- /docker-lib.sh: -------------------------------------------------------------------------------- 1 | # Ref: https://github.com/concourse/docker-image-resource/blob/master/assets/common.sh 2 | 3 | LOG_FILE=${LOG_FILE:-/tmp/docker.log} 4 | SKIP_PRIVILEGED=${SKIP_PRIVILEGED:-false} 5 | STARTUP_TIMEOUT=${STARTUP_TIMEOUT:-120} 6 | 7 | sanitize_cgroups() { 8 | mkdir -p /sys/fs/cgroup 9 | mountpoint -q /sys/fs/cgroup || \ 10 | mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup 11 | 12 | mount -o remount,rw /sys/fs/cgroup 13 | 14 | sed -e 1d /proc/cgroups | while read sys hierarchy num enabled; do 15 | if [ "$enabled" != "1" ]; then 16 | # subsystem disabled; skip 17 | continue 18 | fi 19 | 20 | grouping="$(cat /proc/self/cgroup | cut -d: -f2 | grep "\\<$sys\\>")" || true 21 | if [ -z "$grouping" ]; then 22 | # subsystem not mounted anywhere; mount it on its own 23 | grouping="$sys" 24 | fi 25 | 26 | mountpoint="/sys/fs/cgroup/$grouping" 27 | 28 | mkdir -p "$mountpoint" 29 | 30 | # clear out existing mount to make sure new one is read-write 31 | if mountpoint -q "$mountpoint"; then 32 | umount "$mountpoint" 33 | fi 34 | 35 | mount -n -t cgroup -o "$grouping" cgroup "$mountpoint" 36 | 37 | if [ "$grouping" != "$sys" ]; then 38 | if [ -L "/sys/fs/cgroup/$sys" ]; then 39 | rm "/sys/fs/cgroup/$sys" 40 | fi 41 | 42 | ln -s "$mountpoint" "/sys/fs/cgroup/$sys" 43 | fi 44 | done 45 | 46 | if ! test -e /sys/fs/cgroup/systemd ; then 47 | mkdir /sys/fs/cgroup/systemd 48 | mount -t cgroup -o none,name=systemd none /sys/fs/cgroup/systemd 49 | fi 50 | } 51 | 52 | start_docker() { 53 | mkdir -p /var/log 54 | mkdir -p /var/run 55 | 56 | if [ "$SKIP_PRIVILEGED" = "false" ]; then 57 | sanitize_cgroups 58 | 59 | # check for /proc/sys being mounted readonly, as systemd does 60 | if grep '/proc/sys\s\+\w\+\s\+ro,' /proc/mounts >/dev/null; then 61 | mount -o remount,rw /proc/sys 62 | fi 63 | fi 64 | 65 | local mtu=$(cat /sys/class/net/$(ip route get 8.8.8.8|awk '{ print $5 }')/mtu) 66 | local server_args="--mtu ${mtu}" 67 | local registry="" 68 | 69 | server_args="${server_args} --max-concurrent-downloads=$1 --max-concurrent-uploads=$2" 70 | 71 | for registry in $3; do 72 | server_args="${server_args} --insecure-registry ${registry}" 73 | done 74 | 75 | if [ -n "$4" ]; then 76 | server_args="${server_args} --registry-mirror $4" 77 | fi 78 | 79 | try_start() { 80 | dockerd --data-root /scratch/docker ${server_args} >$LOG_FILE 2>&1 & 81 | echo $! > /tmp/docker.pid 82 | 83 | sleep 1 84 | 85 | echo waiting for docker to come up... 86 | until docker info >/dev/null 2>&1; do 87 | sleep 1 88 | if ! kill -0 "$(cat /tmp/docker.pid)" 2>/dev/null; then 89 | return 1 90 | fi 91 | done 92 | } 93 | 94 | export server_args LOG_FILE 95 | declare -fx try_start 96 | trap stop_docker EXIT 97 | 98 | if ! timeout -t ${STARTUP_TIMEOUT} bash -ce 'while true; do try_start && break; done'; then 99 | echo Docker failed to start within ${STARTUP_TIMEOUT} seconds. 100 | return 1 101 | fi 102 | } 103 | 104 | stop_docker() { 105 | local pid=$(cat /tmp/docker.pid) 106 | if [ -z "$pid" ]; then 107 | return 0 108 | fi 109 | 110 | kill -TERM $pid || echo "Failed to kill docker" 111 | } 112 | 113 | log_in() { 114 | local username="$1" 115 | local password="$2" 116 | local registry="$3" 117 | 118 | if [ -n "${username}" ] && [ -n "${password}" ]; then 119 | echo "${password}" | docker login -u "${username}" --password-stdin ${registry} 120 | else 121 | mkdir -p ~/.docker 122 | echo '{"credsStore":"ecr-login"}' >> ~/.docker/config.json 123 | fi 124 | } 125 | 126 | private_registry() { 127 | local repository="${1}" 128 | 129 | if echo "${repository}" | fgrep -q '/' ; then 130 | local registry="$(extract_registry "${repository}")" 131 | if echo "${registry}" | fgrep -q '.' ; then 132 | return 0 133 | fi 134 | fi 135 | 136 | return 1 137 | } 138 | 139 | extract_registry() { 140 | local repository="${1}" 141 | 142 | echo "${repository}" | cut -d/ -f1 143 | } 144 | 145 | extract_repository() { 146 | local long_repository="${1}" 147 | 148 | echo "${long_repository}" | cut -d/ -f2- 149 | } 150 | 151 | image_from_tag() { 152 | docker images --no-trunc "$1" | awk "{if (\$2 == \"$2\") print \$3}" 153 | } 154 | 155 | image_from_digest() { 156 | docker images --no-trunc --digests "$1" | awk "{if (\$3 == \"$2\") print \$4}" 157 | } 158 | 159 | certs_to_file() { 160 | local raw_ca_certs="${1}" 161 | local cert_count="$(echo $raw_ca_certs | jq -r '. | length')" 162 | 163 | for i in $(seq 0 $(expr "$cert_count" - 1)); 164 | do 165 | local cert_dir="/etc/docker/certs.d/$(echo $raw_ca_certs | jq -r .[$i].domain)" 166 | mkdir -p "$cert_dir" 167 | echo $raw_ca_certs | jq -r .[$i].cert >> "${cert_dir}/ca.crt" 168 | done 169 | } 170 | 171 | set_client_certs() { 172 | local raw_client_certs="${1}" 173 | local cert_count="$(echo $raw_client_certs | jq -r '. | length')" 174 | 175 | for i in $(seq 0 $(expr "$cert_count" - 1)); 176 | do 177 | local cert_dir="/etc/docker/certs.d/$(echo $raw_client_certs | jq -r .[$i].domain)" 178 | [ -d "$cert_dir" ] || mkdir -p "$cert_dir" 179 | echo $raw_client_certs | jq -r .[$i].cert >> "${cert_dir}/client.cert" 180 | echo $raw_client_certs | jq -r .[$i].key >> "${cert_dir}/client.key" 181 | done 182 | } 183 | 184 | docker_pull() { 185 | GREEN='\033[0;32m' 186 | RED='\033[0;31m' 187 | NC='\033[0m' # No Color 188 | 189 | pull_attempt=1 190 | max_attempts=3 191 | while [ "$pull_attempt" -le "$max_attempts" ]; do 192 | printf "Pulling ${GREEN}%s${NC}" "$1" 193 | 194 | if [ "$pull_attempt" != "1" ]; then 195 | printf " (attempt %s of %s)" "$pull_attempt" "$max_attempts" 196 | fi 197 | 198 | printf "...\n" 199 | 200 | if docker pull "$1"; then 201 | printf "\nSuccessfully pulled ${GREEN}%s${NC}.\n\n" "$1" 202 | return 203 | fi 204 | 205 | echo 206 | 207 | pull_attempt=$(expr "$pull_attempt" + 1) 208 | done 209 | 210 | printf "\n${RED}Failed to pull image %s.${NC}" "$1" 211 | exit 1 212 | } 213 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2015-Present Pivotal Software Inc. 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | 204 | 205 | 206 | --------------------------------------------------------------------------------