├── generate-commitish ├── task.sh └── task.yml ├── generate-github-release ├── task.sh └── task.yml ├── run-maven-itests ├── task.yml └── task.sh ├── generate-release-notes-from-changelog ├── task.yml └── task.sh ├── tar ├── task.yml └── task.sh ├── CHANGELOG.md ├── run-maven-itests-cache ├── task.sh └── task.yml ├── generate-manifest ├── task.yml └── task.sh ├── maven └── settings.xml ├── README.md └── LICENSE /generate-commitish/task.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | git -C project rev-parse HEAD > task-output/commitish 4 | -------------------------------------------------------------------------------- /generate-github-release/task.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | version=$(cat version/version) 4 | 5 | echo v${version} > task-output/release-name 6 | echo v${version} > task-output/release-tag 7 | -------------------------------------------------------------------------------- /generate-commitish/task.yml: -------------------------------------------------------------------------------- 1 | --- 2 | platform: linux 3 | 4 | image_resource: 5 | type: docker-image 6 | source: 7 | repository: concourse/git-resource 8 | 9 | inputs: 10 | - name: pipeline-tasks 11 | - name: project 12 | 13 | outputs: 14 | - name: task-output 15 | 16 | run: 17 | path: pipeline-tasks/generate-commitish/task.sh 18 | -------------------------------------------------------------------------------- /generate-github-release/task.yml: -------------------------------------------------------------------------------- 1 | --- 2 | platform: linux 3 | 4 | image_resource: 5 | type: docker-image 6 | source: 7 | repository: concourse/git-resource 8 | 9 | inputs: 10 | - name: pipeline-tasks 11 | - name: version 12 | 13 | outputs: 14 | - name: task-output 15 | 16 | run: 17 | path: pipeline-tasks/generate-github-release/task.sh 18 | -------------------------------------------------------------------------------- /run-maven-itests/task.yml: -------------------------------------------------------------------------------- 1 | # Builds a maven project and copies the artifact to the task-output folder 2 | --- 3 | platform: linux 4 | 5 | image_resource: 6 | type: docker-image 7 | source: 8 | repository: openjdk 9 | tag: '8-jdk-alpine' 10 | 11 | params: 12 | MAVEN_OPTS: 13 | MAVEN_CONFIG: 14 | MAVEN_PROJECTS: 15 | MAVEN_REPO_MIRROR: 16 | MAVEN_REPO_USERNAME: 17 | MAVEN_REPO_PASSWORD: 18 | 19 | inputs: 20 | - name: pipeline-tasks 21 | - name: project 22 | 23 | run: 24 | path: pipeline-tasks/run-maven-itests/task.sh 25 | -------------------------------------------------------------------------------- /generate-release-notes-from-changelog/task.yml: -------------------------------------------------------------------------------- 1 | --- 2 | platform: linux 3 | 4 | image_resource: 5 | type: docker-image 6 | source: 7 | repository: concourse/git-resource 8 | 9 | params: 10 | CHANGELOG_FILE: CHANGELOG.md 11 | VERSION_FILE: version 12 | RELEASE_NOTES_FILE: RELEASE_NOTES.md 13 | DEBUG: false 14 | 15 | inputs: 16 | - name: pipeline-tasks 17 | - name: task-input 18 | - name: version 19 | 20 | outputs: 21 | - name: task-output 22 | 23 | run: 24 | path: pipeline-tasks/generate-release-notes-from-changelog/task.sh 25 | -------------------------------------------------------------------------------- /run-maven-itests/task.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ash 2 | # 3 | # All UPERCASE variables are provided externally from this script 4 | 5 | set -eu 6 | set -o pipefail 7 | 8 | cd project 9 | 10 | args="" 11 | [ -n "$MAVEN_PROJECTS" ] && args="$args --projects $MAVEN_PROJECTS" 12 | [ -n "$MAVEN_REPO_MIRROR" ] && args="$args -Drepository.url=$MAVEN_REPO_MIRROR"; 13 | [ -n "$MAVEN_REPO_USERNAME" ] && args="$args -Drepository.username=$MAVEN_REPO_USERNAME"; 14 | [ -n "$MAVEN_REPO_PASSWORD" ] && args="$args -Drepository.password=$MAVEN_REPO_PASSWORD"; 15 | 16 | ./mvnw verify $args 17 | 18 | cd .. 19 | -------------------------------------------------------------------------------- /tar/task.yml: -------------------------------------------------------------------------------- 1 | --- 2 | platform: linux 3 | 4 | image_resource: 5 | type: docker-image 6 | source: 7 | repository: busybox 8 | tag: '1.27' 9 | 10 | params: 11 | TAR_MODE: # compress, decompress 12 | TAR_DIR: # the folder contents to add to the tar file 13 | TAR_FILE: # some-file-*.tar.gz 14 | TAR_COMPRESSION: # gzip, xz, bzip2, lzma, none, auto or leave empty for auto-detect by file extension 15 | 16 | inputs: 17 | - name: pipeline-tasks 18 | - name: task-input 19 | 20 | outputs: 21 | - name: task-output 22 | 23 | run: 24 | path: pipeline-tasks/tar/task.sh 25 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 5 | and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 6 | 7 | ## [Unreleased] 8 | 9 | ### Added 10 | - generate-release-notes-from-changelog task. 11 | - "Generate release information" section in README.md. 12 | - Change log file (CHANGELOG.md). 13 | 14 | ### Changed 15 | - Updated `cf-cli-resource` example to use `pivotalpa/cf-cli-resource:latest` in README.md. 16 | -------------------------------------------------------------------------------- /run-maven-itests-cache/task.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ash 2 | # 3 | # All UPERCASE variables are provided externally from this script 4 | 5 | set -eu 6 | set -o pipefail 7 | 8 | cd project 9 | 10 | args="" 11 | [ -n "$MAVEN_PROJECTS" ] && args="$args --projects $MAVEN_PROJECTS" 12 | [ -n "$MAVEN_REPO_MIRROR" ] && args="$args -Drepository.url=$MAVEN_REPO_MIRROR"; 13 | [ -n "$MAVEN_REPO_USERNAME" ] && args="$args -Drepository.username=$MAVEN_REPO_USERNAME"; 14 | [ -n "$MAVEN_REPO_PASSWORD" ] && args="$args -Drepository.password=$MAVEN_REPO_PASSWORD"; 15 | [ "true" = "$MAVEN_REPO_CACHE_ENABLE" ] && args="$args -Dmaven.repo.local=$PWD/.m2repository" 16 | 17 | ./mvnw verify $args 18 | 19 | cd .. 20 | -------------------------------------------------------------------------------- /run-maven-itests-cache/task.yml: -------------------------------------------------------------------------------- 1 | # Builds a maven project and copies the artifact to the task-output folder 2 | --- 3 | platform: linux 4 | 5 | image_resource: 6 | type: docker-image 7 | source: 8 | repository: openjdk 9 | tag: '8-jdk-alpine' 10 | 11 | params: 12 | MAVEN_OPTS: 13 | MAVEN_CONFIG: 14 | MAVEN_PROJECTS: 15 | MAVEN_REPO_MIRROR: 16 | MAVEN_REPO_USERNAME: 17 | MAVEN_REPO_PASSWORD: 18 | MAVEN_REPO_CACHE_ENABLE: false # set this to true in your pipeline to cache your repo on the worker 19 | 20 | inputs: 21 | - name: pipeline-tasks 22 | - name: project 23 | 24 | caches: 25 | - path: project/.m2repository 26 | 27 | run: 28 | path: pipeline-tasks/run-maven-itests-cache/task.sh 29 | -------------------------------------------------------------------------------- /tar/task.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | echo "TAR_MODE=$TAR_MODE" 6 | echo "TAR_DIR=$TAR_DIR" 7 | echo "TAR_FILE=$TAR_FILE" 8 | echo "TAR_COMPRESSION=$TAR_COMPRESSION" 9 | 10 | if [ -z "$TAR_COMPRESSION" ] || [ "auto" = $TAR_COMPRESSION ]; then 11 | TAR_FLAG= 12 | case "$TAR_FILE" in 13 | *.tar.gz|.tgz) TAR_FLAG=z; ;; 14 | *.tar.xz|.txz) TAR_FLAG=J; ;; 15 | *.tar.bz2|*.tb2|*.tbz|*.tbz2) TAR_FLAG=j; ;; 16 | *.tar.lzma|*.tlz) TAR_FLAG=a; ;; 17 | esac 18 | elif [ "none" = "$TAR_COMPRESSION" ]; then 19 | TAR_FLAG= 20 | else 21 | case "$TAR_COMPRESSION" in 22 | gzip) TAR_FLAG=z; ;; 23 | xz) TAR_FLAG=J; ;; 24 | bzip2) TAR_FLAG=j; ;; 25 | lzma) TAR_FLAG=a; ;; 26 | *) echo "[ERROR] Unsupported compression: $TAR_COMPRESSION" >&2 27 | echo "[ERROR] valid values: gzip, xz, bzip2, lzma" >&2 28 | exit 1 29 | ;; 30 | esac 31 | fi 32 | 33 | echo "TAR_FLAG=$TAR_FLAG" 34 | 35 | if [ "$TAR_MODE" = "compress" ]; then 36 | tar -C task-input/$TAR_DIR -c${TAR_FLAG}vf task-output/$TAR_FILE . 37 | elif [ "$TAR_MODE" = "decompress" ]; then 38 | tar -x${TAR_FLAG}vf task-input/$TAR_FILE -C task-output 39 | else 40 | echo "[ERROR] Unknown tar mode: $TAR_MODE" >&2 41 | echo "[ERROR] valid values: compress, decompress" >&2 42 | exit 2 43 | fi 44 | -------------------------------------------------------------------------------- /generate-manifest/task.yml: -------------------------------------------------------------------------------- 1 | --- 2 | platform: linux 3 | 4 | image_resource: 5 | type: docker-image 6 | source: 7 | repository: pivotalpa/cf-cli-resource 8 | tag: 'latest' 9 | 10 | params: 11 | # all examples use in-line yaml syntax for sequences and maps, but you can 12 | # use the normal syntax as well 13 | MF_NAME: #my-app 14 | MF_BUILDPACK: #https://github.com/cloudfoundry/java-buildpack.git#v3.3.0 15 | MF_COMMAND: #bundle exec rake VERBOSE=true 16 | MF_DISK_QUOTA: #1024M 17 | MF_DOMAIN: #unique-example.com 18 | MF_DOMAINS: #[ domain-example1.com, domain-example2.org ] 19 | MF_HEALTH_CHECK_HTTP_ENDPOINT: #/health 20 | MF_HEALTH_CHECK_TYPE: #http 21 | MF_HOST: #my-app 22 | MF_HOSTS: #[ app_host1, app_host2 ] 23 | MF_INSTANCES: #2 24 | MF_MEMORY: #1024M 25 | MF_NO_HOSTNAME: #true 26 | MF_NO_ROUTE: #true 27 | MF_PATH: #/path/to/application/bits 28 | MF_RANDOM_ROUTE: #true 29 | MF_ROUTES: #[ { route: example.com }, { route: www.example.com/foo }, { route: 'tcp-example.com:1234' } ] 30 | MF_STACK: #cflinuxfs2 31 | MF_TIMEOUT: #80 32 | MF_ENV: # { RAILS_ENV: production, RACK_ENV: production, JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: 1.8.0_+ }, memory_calculator: { stack_threads: 200 } }' } 33 | MF_SERVICES: #[ instance_ABC, instance_XYZ ] 34 | 35 | inputs: 36 | - name: pipeline-tasks 37 | 38 | outputs: 39 | - name: task-output 40 | 41 | run: 42 | path: pipeline-tasks/generate-manifest/task.sh 43 | -------------------------------------------------------------------------------- /maven/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | remote-repository 7 | ${repository.username} 8 | ${repository.password} 9 | 10 | 11 | 12 | 13 | remote-repository 14 | * 15 | ${repository.url} 16 | 17 | 18 | 19 | 20 | remote-repository 21 | 22 | 23 | central 24 | http://central 25 | true 26 | true 27 | 28 | 29 | 30 | 31 | central 32 | http://central 33 | true 34 | true 35 | 36 | 37 | 38 | 39 | 40 | remote-repository 41 | 42 | 43 | -------------------------------------------------------------------------------- /generate-release-notes-from-changelog/task.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | set -o pipefail 5 | 6 | [ 'true' = "${DEBUG:-}" ] && set -x 7 | 8 | : "${CHANGELOG_FILE:?not set or empty}" 9 | : "${VERSION_FILE:?not set or empty}" 10 | : "${RELEASE_NOTES_FILE:?not set or empty}" 11 | 12 | function error_and_exit() { 13 | local message=${1:-} 14 | echo "ERROR: $message" >&2 15 | exit 1 16 | } 17 | 18 | [ ! -f "version/$VERSION_FILE" ] && error_and_exit "version file does not exist: version/$VERSION_FILE" 19 | version=$(cat "version/$VERSION_FILE") 20 | 21 | [ ! -f "task-input/$CHANGELOG_FILE" ] && error_and_exit "changelog file does not exist: task-input/$CHANGELOG_FILE" 22 | capture=false 23 | content= 24 | while read line; do 25 | 26 | # Matches variations of start line: ## [2.0.0] - some other text 27 | if ! $capture && echo $line | grep -oEq "^##\s\[{0,}$version]{0,}\s{0,}.*$"; then 28 | capture=true 29 | fi 30 | 31 | # Matches variations of stop line: ## [1.0.0] - some other text 32 | if $capture && [ -n "$content" ] && echo $line | grep -oEq "^##\s\[{0,}.*]{0,}\s{0,}.*$"; then 33 | capture=false 34 | fi 35 | 36 | # Matches markdown links at bottom of file: [1.0.0]: https://... 37 | if $capture && [ -n "$content" ] && echo $line | grep -oEq "^\[.*$"; then 38 | capture=false 39 | fi 40 | 41 | [ $capture = true ] && content+="$line"$'\n' 42 | 43 | done <"task-input/$CHANGELOG_FILE" 44 | 45 | echo "$content" > task-output/${RELEASE_NOTES_FILE} 46 | 47 | echo "Release Notes:" 48 | echo "-------------" 49 | cat task-output/${RELEASE_NOTES_FILE} 50 | -------------------------------------------------------------------------------- /generate-manifest/task.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # All UPERCASE variables are provided externally from this yml 4 | 5 | set -eu 6 | set -o pipefail 7 | 8 | cd task-output 9 | 10 | # Build the yaml create script 11 | yml= 12 | [ "${MF_NAME:-}" ] && yml+="applications[0].name: $MF_NAME\n" 13 | [ "${MF_BUILDPACK:-}" ] && yml+="applications[0].buildpack: $MF_BUILDPACK\n" 14 | [ "${MF_COMMAND:-}" ] && yml+="applications[0].command: $MF_COMMAND\n" 15 | [ "${MF_DISK_QUOTA:-}" ] && yml+="applications[0].disk_quota: $MF_DISK_QUOTA\n" 16 | [ "${MF_DOMAIN:-}" ] && yml+="applications[0].domain: $MF_DOMAIN\n" 17 | [ "${MF_DOMAINS:-}" ] && yml+="applications[0].domains: $MF_DOMAINS\n" 18 | [ "${MF_HEALTH_CHECK_HTTP_ENDPOINT:-}" ] && yml+="applications[0].health-check-http-endpoint: $MF_HEALTH_CHECK_HTTP_ENDPOINT\n" 19 | [ "${MF_HEALTH_CHECK_TYPE:-}" ] && yml+="applications[0].health-check-type: $MF_HEALTH_CHECK_TYPE\n" 20 | [ "${MF_HOST:-}" ] && yml+="applications[0].host: $MF_HOST\n" 21 | [ "${MF_HOSTS:-}" ] && yml+="applications[0].hosts: $MF_HOSTS\n" 22 | [ "${MF_INSTANCES:-}" ] && yml+="applications[0].instances: $MF_INSTANCES\n" 23 | [ "${MF_MEMORY:-}" ] && yml+="applications[0].memory: $MF_MEMORY\n" 24 | [ "${MF_NO_HOSTNAME:-}" ] && yml+="applications[0].no-hostname: $MF_NO_HOSTNAME\n" 25 | [ "${MF_NO_ROUTE:-}" ] && yml+="applications[0].no-route: $MF_NO_ROUTE\n" 26 | [ "${MF_PATH:-}" ] && yml+="applications[0].path: $MF_PATH\n" 27 | [ "${MF_RANDOM_ROUTE:-}" ] && yml+="applications[0].random_route: $MF_RANDOM_ROUTE\n" 28 | [ "${MF_ROUTES:-}" ] && yml+="applications[0].routes: $MF_ROUTES\n" 29 | [ "${MF_STACK:-}" ] && yml+="applications[0].stack: $MF_STACK\n" 30 | [ "${MF_TIMEOUT:-}" ] && yml+="applications[0].timeout: $MF_TIMEOUT\n" 31 | [ "${MF_ENV:-}" ] && yml+="applications[0].env: $MF_ENV\n" 32 | [ "${MF_SERVICES:-}" ] && yml+="applications[0].services: $MF_SERVICES\n" 33 | 34 | if [ -n "$yml" ]; then 35 | echo -e "---\n$(echo -e $yml | yaml n -s -)" > manifest.yml 36 | echo 'Generated manifest:' 37 | cat manifest.yml 38 | else 39 | echo 'No manifest options specified: nothing to generate!' 40 | fi 41 | 42 | cd .. 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pipeline-tasks 2 | Common Concourse Pipeline Tasks 3 | 4 | ## Examples 5 | 6 | All examples use the following resources: 7 | 8 | ```yaml 9 | resource_types: 10 | - name: cf-cli-resource 11 | type: docker-image 12 | source: 13 | repository: pivotalpa/cf-cli-resource 14 | tag: latest 15 | 16 | resources: 17 | - name: pipeline-tasks 18 | type: git 19 | source: 20 | uri: https://github.com/Pivotal-Field-Engineering/pipeline-tasks.git 21 | branch: master 22 | 23 | - name: cf-test 24 | type: cf-cli-resource 25 | source: 26 | api: https://api.run.pivotal.io 27 | skip_cert_check: false 28 | username: user@example.com 29 | password: oh-so-secret 30 | org: user-org 31 | space: test-space 32 | ``` 33 | 34 | ## Generate a Cloud Foundry Manifest 35 | 36 | ```yaml 37 | - name: test 38 | plan: 39 | - aggregate: 40 | - get: pipeline-tasks 41 | - get: artifact 42 | - task: generate-manifest 43 | file: pipeline-tasks/generate-manifest/task.yml 44 | params: 45 | MF_NAME: myapp 46 | MF_HOST: myapp 47 | MF_SERVICES: [ myapp-db, myapp-mq ] 48 | MF_ENV: 49 | RAILS_ENV: production 50 | RACK_ENV: production 51 | JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: 1.8.0_+ }, memory_calculator: { stack_threads: 200 } }' 52 | - put: cf-push 53 | resource: cf-test 54 | params: 55 | command: zero-downtime-push 56 | manifest: task-output/manifest.yml 57 | path: artifact/myapp-*.jar 58 | current_app_name: ((cf-test-app-name)) 59 | ``` 60 | 61 | ## Generate release information 62 | 63 | This example showcases tasks commonly used with [github-release](https://github.com/concourse/github-release-resource): 64 | * `generate-github-release`: Generates a version string (ex: v1.0.0) for the `release-name` and `release-tag` files. 65 | * `generate-commitish`: Generates the [commitish](https://stackoverflow.com/questions/23303549/what-are-commit-ish-and-tree-ish-in-git) file. 66 | * `generate-release-notes`: Generates the release notes for a particular version by parsing a change log format based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 67 | 68 | ```yaml 69 | - name: shipit 70 | serial_groups: [version] 71 | plan: 72 | - aggregate: 73 | - get: pipeline-tasks 74 | - get: project 75 | passed: [build] 76 | - get: version 77 | passed: [build] 78 | params: {bump: final} 79 | - task: generate-github-release 80 | file: pipeline-tasks/generate-github-release/task.yml 81 | output_mapping: {task-output: generate-github-release-output} 82 | - task: generate-commitish 83 | file: pipeline-tasks/generate-commitish/task.yml 84 | output_mapping: {task-output: generate-commitish-output} 85 | - task: generate-release-notes 86 | file: pipeline-tasks/generate-release-notes-from-changelog/task.yml 87 | input_mapping: {task-input: project} 88 | output_mapping: {task-output: generate-release-notes-output} 89 | - put: github-release 90 | params: 91 | name: generate-github-release-output/release-name 92 | tag: generate-github-release-output/release-tag 93 | commitish: generate-commitish-output/commitish 94 | body: generate-release-notes-output/RELEASE_NOTES.md 95 | - put: version 96 | params: {file: version/version} 97 | 98 | ``` 99 | 100 | 101 | ## Overriding a task's VM 102 | 103 | Imagine you want to use a task, but you want to use a different VM. For example, consider a `task.yml` that has: 104 | ```yaml 105 | image_resource: 106 | type: docker-image 107 | source: 108 | repository: patrickcrocker/node 109 | tag: '1.0.0-rc.1' 110 | ``` 111 | 112 | If you need a VM with a different version of node, you can override the task's `image_resource`. In your pipeline, you'll need a `docker-image` resource pointing to the VM you'd like the task to use. Note: it's important that the VM you supply has the shell environment the task's `task.sh` uses. If the `task.sh` has an interrobang of `#!/bin/bash`, the VM you supply _must_ have `bash` available. 113 | 114 | To override the `image_resource`, supply the task with an `image: ` resource: 115 | 116 | ```yaml 117 | # VM we want the task to use 118 | resources: 119 | - name: vm-override 120 | type: docker-image 121 | source: 122 | repository: mhart/alpine-node 123 | tag: '8.9.1' 124 | 125 | ... 126 | 127 | jobs: 128 | - name: build 129 | plan: 130 | - aggregate: 131 | - get: vm-override # Make the VM available as a Job resource 132 | - get: pipeline-tasks 133 | - get: project 134 | resource: source-repo 135 | trigger: true 136 | - get: version 137 | params: {pre: rc} 138 | - task: build-node 139 | file: pipeline-tasks/build-node/task.yml 140 | image: vm-override # Override the task's `image_resource` with your VM 141 | ``` -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------