├── .final_builds ├── jobs │ └── grafana │ │ └── index.yml ├── license │ └── index.yml └── packages │ └── grafana │ └── index.yml ├── .gitignore ├── LICENSE ├── README.md ├── ci ├── pipeline.yml └── tasks │ ├── bump-blob │ ├── bump-blob.yml │ ├── create-final │ ├── create-final.yml │ ├── create-rc │ └── create-rc.yml ├── config ├── blobs.yml └── final.yml ├── jobs └── grafana │ ├── monit │ ├── spec │ └── templates │ ├── cacert.pem.erb │ ├── client.crt.erb │ ├── client.key.erb │ ├── config.ini.erb │ ├── create-update-dashboards.erb │ ├── credentials │ ├── dashboards.yml │ ├── datasources.yml.erb │ ├── grafana_ctl │ ├── post-start │ ├── ssl.crt.erb │ └── ssl.key.erb ├── packages └── grafana │ ├── packaging │ └── spec ├── releases └── grafana │ ├── grafana-1.yml │ ├── grafana-10.yml │ ├── grafana-11.yml │ ├── grafana-12.yml │ ├── grafana-13.1.0.yml │ ├── grafana-13.2.0.yml │ ├── grafana-13.2.1.yml │ ├── grafana-13.2.2.yml │ ├── grafana-13.3.0.yml │ ├── grafana-13.yml │ ├── grafana-2.yml │ ├── grafana-3.yml │ ├── grafana-4.yml │ ├── grafana-5.yml │ ├── grafana-6.yml │ ├── grafana-7.yml │ ├── grafana-8.yml │ ├── grafana-9.yml │ └── index.yml └── src └── pid_utils.sh /.final_builds/jobs/grafana/index.yml: -------------------------------------------------------------------------------- 1 | builds: 2 | 08ffd974e877cf8b245b0ecf6f3747c216d74751: 3 | version: 08ffd974e877cf8b245b0ecf6f3747c216d74751 4 | blobstore_id: eb5b205c-6a10-4795-bd5e-c5ff0dea7b81 5 | sha1: 4dcde4ef46c222869e11114490ae62ebfdcd324b 6 | 101ffa6ce9ad14b17fb028f46b6e30ef214e0ab0: 7 | version: 101ffa6ce9ad14b17fb028f46b6e30ef214e0ab0 8 | blobstore_id: 6159b608-6716-4c4a-bd4e-e6c5a3d9b1be 9 | sha1: bb99e7fa9c2dc3dc39371a28ea19f9ad9236a05a 10 | 21c4d0b768ade82258f60cc25a2f3291eaaecba7: 11 | version: 21c4d0b768ade82258f60cc25a2f3291eaaecba7 12 | blobstore_id: b03e6e2a-8cac-4303-4e6d-33670b445991 13 | sha1: dad32b88ea727567be53f1ca985616fe056a3d0a 14 | 2bdde92ed89675f57d50616afd9f28627f9aebda: 15 | version: 2bdde92ed89675f57d50616afd9f28627f9aebda 16 | blobstore_id: 2779f751-2423-49d2-6fa1-a857fe03b7b6 17 | sha1: 6c606beff1de8e1db79fa39745dae5f3381924be 18 | 4182fbd051793d48fd1b3a720a39489a4731b141: 19 | version: 4182fbd051793d48fd1b3a720a39489a4731b141 20 | blobstore_id: 8829c8ea-0486-40d5-667a-ad67f716b4eb 21 | sha1: 1afee63485d3401cac0beca107f014669903485f 22 | 5f33f435b5b4ae43018f1e45570df21a8f905e3c: 23 | version: 5f33f435b5b4ae43018f1e45570df21a8f905e3c 24 | blobstore_id: 2f511cdd-e02f-45e0-4a18-b70e68fea864 25 | sha1: 2ab433d9cc1a2fca8549865e2b99ea98bb419414 26 | 6e51cec5fbe53d9b1b97b475a87b32b99484aa55: 27 | version: 6e51cec5fbe53d9b1b97b475a87b32b99484aa55 28 | blobstore_id: 07562181-7311-44fd-bfa5-1a41965b1666 29 | sha1: d84f299a8eb64cf98c5d03c2f97b541b1a255791 30 | 7e65b1c9feb80bac6c633948ca6746847e274fb0: 31 | version: 7e65b1c9feb80bac6c633948ca6746847e274fb0 32 | blobstore_id: ff02e69c-563c-4a33-4b20-73156090606a 33 | sha1: 9ebe297e44c2a6758f817e26badacb6cb7cd178f 34 | 8aa7c95e29abda2255715b92e907901887dfd2c1: 35 | version: 8aa7c95e29abda2255715b92e907901887dfd2c1 36 | blobstore_id: 05521a46-f6a5-40fe-74ed-c155ed3e81ce 37 | sha1: b85a9fdcfb91d44a022a5539ca19ec8e66a4cff3 38 | caf43ba97c5e808e750a22cb360d9df013444285: 39 | version: caf43ba97c5e808e750a22cb360d9df013444285 40 | blobstore_id: da0963af-8fae-4379-6841-8f9b03f6df58 41 | sha1: f745fd9b85708ce53e18531b7beb50721864e41f 42 | fec27a1e38a44ee184a8492efe18c214642c31ac: 43 | version: fec27a1e38a44ee184a8492efe18c214642c31ac 44 | blobstore_id: 996e9f66-cd90-4214-5f4f-4662921a36ce 45 | sha1: 39aa3b0f0e003c02d8d7b1bcb88ac139f9ad3510 46 | format-version: "2" 47 | -------------------------------------------------------------------------------- /.final_builds/license/index.yml: -------------------------------------------------------------------------------- 1 | --- 2 | builds: 3 | a3e6d245553160dad1d273d363550134abc94578: 4 | version: a3e6d245553160dad1d273d363550134abc94578 5 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 6 | blobstore_id: 76f2d41f-b1a9-4999-9fb9-1d6f008bfde1 7 | format-version: '2' 8 | -------------------------------------------------------------------------------- /.final_builds/packages/grafana/index.yml: -------------------------------------------------------------------------------- 1 | builds: 2 | 010d9c4322464dae189c26da8d11cf4191c4b795: 3 | version: 010d9c4322464dae189c26da8d11cf4191c4b795 4 | blobstore_id: f9af4b1b-a8c7-47b6-4e52-9aaa3a32353d 5 | sha1: 3a2f9e6a9a5ef8fba0e3f248aa0e86215b492616 6 | 082e0ca02c500e99dffa6565150716399ac78ac1: 7 | version: 082e0ca02c500e99dffa6565150716399ac78ac1 8 | blobstore_id: f8968a17-394d-4847-7eff-382630fd15a0 9 | sha1: 09da35616c62b83ba720eaabf6360ff78502174c 10 | 144ba150784760cf47513e2df03b3ab63ec22906: 11 | version: 144ba150784760cf47513e2df03b3ab63ec22906 12 | blobstore_id: e2c17bda-8711-4e66-4031-75ba66ddbe15 13 | sha1: 57cd3b31019bff7c2bcd35c08872f634eb60d0d9 14 | 1d35b32ad99abf27758c3c69751588520ac985b3: 15 | version: 1d35b32ad99abf27758c3c69751588520ac985b3 16 | blobstore_id: 6a7d63cc-a564-4dab-6778-70979ca8e0d4 17 | sha1: a22cae9369fde7e6ff8aa352fe8f5552d55cea6f 18 | 22f8a519211998832ca906e3fb06749776f27d31: 19 | version: 22f8a519211998832ca906e3fb06749776f27d31 20 | blobstore_id: 58d8af8b-4e17-4d9a-6b12-5692558345d9 21 | sha1: 30bdd7b0f46be47d751b1e918f5f8c4e6f3049b4 22 | 3df830ffef8a2ed1c09fdcd72182addfcefec1f9: 23 | version: 3df830ffef8a2ed1c09fdcd72182addfcefec1f9 24 | blobstore_id: a7e898bd-da5f-4faf-740e-14b22328e513 25 | sha1: 0deb1bc169b0286059b2871e154c0e25f042f497 26 | 58ceabef9f1f019b5faff4321e1d032a67efa3c2: 27 | version: 58ceabef9f1f019b5faff4321e1d032a67efa3c2 28 | blobstore_id: f19323c3-60a2-4e7f-6af4-2fd0714e44cd 29 | sha1: ca7519c13d317278c5f9ec101a99c734633ca0b4 30 | 6d7699109a8a3fc78abd2710cbebf1557889823a: 31 | version: 6d7699109a8a3fc78abd2710cbebf1557889823a 32 | blobstore_id: b35a60b5-dde7-4669-73d5-b1ef2a8fff7c 33 | sha1: e29b75acb7faa18aa59eb26efbb532a5eaef2e3f 34 | adf9a3e1d017b2d267e796ce1a8df7a8218ad8d5: 35 | version: adf9a3e1d017b2d267e796ce1a8df7a8218ad8d5 36 | blobstore_id: 4cc6fa24-19cf-499e-6588-9b4096039375 37 | sha1: 3d9374efb65f9fe2234a90ef56b3ad27efbce611 38 | af22fba9e9edcaea272cb48f8d43633ca9de570b: 39 | version: af22fba9e9edcaea272cb48f8d43633ca9de570b 40 | blobstore_id: 931dccaa-36df-4266-9d75-98547d840f21 41 | sha1: 76120a089781317148bd7d318cad586cb8217bd7 42 | c85dd0f64705bce03d076ed0b8091fc99205517d: 43 | version: c85dd0f64705bce03d076ed0b8091fc99205517d 44 | blobstore_id: 8e9db42c-5fdf-4f5e-66b3-fd6b50efbaf3 45 | sha1: c5c12f5e8bb69af4efa9fce2670f4a21ef93fb62 46 | edabf0bd5a909fd446bb048e19a034660daaa231: 47 | version: edabf0bd5a909fd446bb048e19a034660daaa231 48 | blobstore_id: 2a11b6fa-47fa-4b62-8cad-d536624358f1 49 | sha1: 4df5cca000398c750e39967b86dcc50316b859e1 50 | faef249fb0ae5b69a00256da0d966a01a0d326f0: 51 | version: faef249fb0ae5b69a00256da0d966a01a0d326f0 52 | blobstore_id: a2d4209b-97a0-4b7e-464a-a17f18ac939a 53 | sha1: a9bb1acae31b46cfeb6f24259998919855ac2725 54 | format-version: "2" 55 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | creds.yml 2 | config/dev.yml 3 | config/private.yml 4 | releases/*.tgz 5 | releases/**/*.tgz 6 | dev_releases 7 | .blobs 8 | blobs 9 | .dev_builds 10 | .idea 11 | .DS_Store 12 | .final_builds/jobs/**/*.tgz 13 | .final_builds/packages/**/*.tgz 14 | *.swp 15 | *~ 16 | *# 17 | #* 18 | 19 | # workaround for HOME=$PWD hack for bosh CLI 20 | .gitconfig 21 | 22 | /*deployment.yml 23 | /src_alt 24 | 25 | .vagrant/ 26 | docs/concourse/ 27 | 28 | /bin 29 | /pkg 30 | 31 | .hg 32 | .bzr 33 | 34 | # development dependencies 35 | src/github.com/nsf/gocode/ 36 | src/code.google.com/p/go.tools/ 37 | src/code.google.com/p/goplan9/ 38 | src/code.google.com/p/rog-go/ 39 | src/sourcegraph.com/sqs/goreturns/ 40 | src/golang.org/x/tools/ 41 | src/github.com/golang/lint/ 42 | src/github.com/jstemmer/gotags/ 43 | src/github.com/maxbrunsfeld/counterfeiter/ 44 | 45 | # ctags 46 | tags 47 | -------------------------------------------------------------------------------- /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 [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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Grafana BOSH Release 2 | 3 | A [BOSH](https://bosh.io) release for deploying [Grafana](http://grafana.org/). 4 | 5 | * Pipeline: https://wings.concourse.ci/teams/vito/pipelines/grafana-boshrelease 6 | 7 | ## Usage 8 | 9 | See [the `grafana` job spec](jobs/grafana/spec). 10 | -------------------------------------------------------------------------------- /ci/pipeline.yml: -------------------------------------------------------------------------------- 1 | --- 2 | groups: 3 | - name: dev 4 | jobs: [bump-grafana, rc, build-rc, ship] 5 | 6 | - name: semver 7 | jobs: [major, minor, patch] 8 | 9 | resource_types: 10 | - name: bintray 11 | type: registry-image 12 | source: {repository: camelpunch/bintray-resource} 13 | 14 | resources: 15 | - name: grafana-release 16 | type: git 17 | source: 18 | uri: git@github.com:vito/grafana-boshrelease.git 19 | branch: master 20 | private_key: ((github_deploy_key)) 21 | 22 | - name: version 23 | type: semver 24 | source: 25 | driver: git 26 | initial_version: 13.0.0 27 | uri: git@github.com:vito/grafana-boshrelease 28 | branch: version 29 | file: version 30 | private_key: ((github_deploy_key)) 31 | 32 | - name: grafana 33 | type: s3 34 | source: 35 | bucket: grafana-releases 36 | regexp: release/grafana-([\d\.]+).linux-amd64.tar.gz 37 | region_name: us-west-2 38 | 39 | - name: grafana-release-rc 40 | type: bintray 41 | source: 42 | username: vito 43 | api_key: ((bintray_api_key)) 44 | subject: vito 45 | repo: grafana-boshrelease-rcs 46 | package: grafana-boshrelease-rc 47 | 48 | jobs: 49 | - name: bump-grafana 50 | public: true 51 | plan: 52 | - get: grafana 53 | - get: grafana-release 54 | - task: bump-blob 55 | file: grafana-release/ci/tasks/bump-blob.yml 56 | input_mapping: 57 | blob-dir: grafana 58 | release: grafana-release 59 | params: 60 | BOSH_PRIVATE_CONFIG: ((bosh_private_config)) 61 | BLOB_NAME: grafana 62 | BLOB_DESTINATION: grafana 63 | - put: grafana-release 64 | params: 65 | repository: bumped-release 66 | rebase: true 67 | 68 | - name: rc 69 | public: true 70 | serial_groups: [version] 71 | plan: 72 | - get: grafana-release 73 | trigger: true 74 | - get: version 75 | params: {pre: rc} 76 | - put: version 77 | params: {file: version/version} 78 | 79 | - name: build-rc 80 | public: true 81 | plan: 82 | - get: grafana-release 83 | trigger: true 84 | passed: [rc] 85 | passed: [rc] 86 | - get: version 87 | params: {pre: rc} 88 | passed: [rc] 89 | - task: create-rc 90 | file: grafana-release/ci/tasks/create-rc.yml 91 | - put: grafana-release-rc 92 | params: 93 | file: rc/*.tgz 94 | version_regexp: rc/grafana-(.*).tgz 95 | vcs_url: https://github.com/vito/grafana-boshrelease 96 | licenses: ["Apache-2.0"] 97 | publish: true 98 | list_in_downloads: true 99 | 100 | - name: ship 101 | public: true 102 | serial_groups: [version] 103 | plan: 104 | - get: grafana-release 105 | passed: [build-rc] 106 | - get: final-version 107 | resource: version 108 | passed: [build-rc] 109 | params: {bump: final} 110 | - task: create-final 111 | file: grafana-release/ci/tasks/create-final.yml 112 | params: {BOSH_PRIVATE_CONFIG: ((bosh_private_config))} 113 | input_mapping: {version: final-version} 114 | - put: version 115 | params: {file: final-version/version} 116 | - put: grafana-release 117 | params: {repository: finalized-repo, merge: true} 118 | 119 | - name: major 120 | public: true 121 | serial_groups: [version] 122 | plan: 123 | - get: version 124 | params: {bump: major, pre: rc} 125 | - put: version 126 | params: {file: version/version} 127 | 128 | - name: minor 129 | public: true 130 | serial_groups: [version] 131 | plan: 132 | - get: version 133 | params: {bump: minor, pre: rc} 134 | - put: version 135 | params: {file: version/version} 136 | 137 | - name: patch 138 | public: true 139 | serial_groups: [version] 140 | plan: 141 | - get: version 142 | passed: [ship] 143 | params: {bump: patch, pre: rc} 144 | trigger: true 145 | - put: version 146 | params: {file: version/version} 147 | -------------------------------------------------------------------------------- /ci/tasks/bump-blob: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # vim: set ft=sh 3 | 4 | set -e -x 5 | 6 | if [ -z "$BLOB_NAME" ]; then 7 | echo "must specify \$BLOB_NAME" >&2 8 | exit 1 9 | fi 10 | 11 | if [ -z "$BLOB_DESTINATION" ]; then 12 | echo "must specify \$BLOB_DESTINATION" >&2 13 | exit 1 14 | fi 15 | 16 | blob_dir=$PWD/blob-dir 17 | blob_version=`cat $blob_dir/version` 18 | 19 | git clone release bumped-release 20 | 21 | set +x 22 | echo "$BOSH_PRIVATE_CONFIG" > bumped-release/config/private.yml 23 | set -x 24 | 25 | cd bumped-release/ 26 | 27 | # work-around Go BOSH CLI trying to rename blobs downloaded into ~/.root/tmp 28 | # into release dir, which is invalid cross-device link 29 | export HOME=$PWD 30 | 31 | git config --global user.email "ci@localhost" 32 | git config --global user.name "CI Bot" 33 | 34 | bosh blobs --column="path" | grep ${BLOB_DESTINATION}/${BLOB_NAME} | xargs bosh remove-blob 35 | 36 | bosh -n add-blob $blob_dir/*.tar.gz ${BLOB_DESTINATION}/${BLOB_NAME}-${blob_version}.tar.gz 37 | bosh -n upload-blobs 38 | 39 | git add -A 40 | git commit -m "update ${BLOB_NAME} blob to ${blob_version}" 41 | -------------------------------------------------------------------------------- /ci/tasks/bump-blob.yml: -------------------------------------------------------------------------------- 1 | --- 2 | platform: linux 3 | 4 | image_resource: 5 | type: registry-image 6 | source: 7 | repository: concourse/bosh-cli 8 | 9 | inputs: 10 | - name: release 11 | - name: blob-dir 12 | 13 | outputs: 14 | - name: bumped-release 15 | 16 | params: 17 | BOSH_PRIVATE_CONFIG: 18 | BLOB_NAME: 19 | BLOB_VERSION: 20 | BLOB_VERSION_FILE: 21 | BLOB_DESTINATION: 22 | 23 | run: 24 | path: release/ci/tasks/bump-blob 25 | -------------------------------------------------------------------------------- /ci/tasks/create-final: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e -u -x 4 | 5 | version="$(cat version/version)" 6 | 7 | git config --global user.email "ci@localhost" 8 | git config --global user.name "CI Bot" 9 | 10 | git clone ./grafana-release ./finalized-repo 11 | 12 | pushd finalized-repo 13 | set +x 14 | echo "$BOSH_PRIVATE_CONFIG" > config/private.yml 15 | set -x 16 | 17 | bosh create-release --final --name grafana --version "$version" 18 | git add -A 19 | git commit -m "release v${version}" 20 | git tag -f "v${version}" 21 | popd -------------------------------------------------------------------------------- /ci/tasks/create-final.yml: -------------------------------------------------------------------------------- 1 | --- 2 | platform: linux 3 | 4 | image_resource: 5 | type: registry-image 6 | source: 7 | repository: concourse/bosh-cli 8 | 9 | inputs: 10 | - name: grafana-release 11 | - name: version 12 | 13 | outputs: 14 | - name: finalized-repo 15 | 16 | run: {path: grafana-release/ci/tasks/create-final} 17 | -------------------------------------------------------------------------------- /ci/tasks/create-rc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e -u -x 4 | 5 | version="$(cat version/version)" 6 | tarball="$PWD/rc/grafana-${version}.tgz" 7 | 8 | # work-around Go BOSH CLI trying to rename blobs downloaded into ~/.root/tmp 9 | # into release dir, which is invalid cross-device link 10 | export HOME=$PWD 11 | 12 | pushd grafana-release 13 | bosh create-release --name grafana --version "$version" --tarball "$tarball" 14 | popd 15 | -------------------------------------------------------------------------------- /ci/tasks/create-rc.yml: -------------------------------------------------------------------------------- 1 | --- 2 | platform: linux 3 | 4 | image_resource: 5 | type: registry-image 6 | source: 7 | repository: concourse/bosh-cli 8 | 9 | inputs: 10 | - name: grafana-release 11 | - name: version 12 | 13 | outputs: 14 | - name: rc 15 | 16 | run: {path: grafana-release/ci/tasks/create-rc} 17 | -------------------------------------------------------------------------------- /config/blobs.yml: -------------------------------------------------------------------------------- 1 | grafana/grafana-6.1.1.tar.gz: 2 | size: 56562242 3 | object_id: b76a5e3d-2f38-4f22-5156-7217eec86b80 4 | sha: 25285602a9739a523f99146c9f5bbaa7a4987c6a 5 | -------------------------------------------------------------------------------- /config/final.yml: -------------------------------------------------------------------------------- 1 | --- 2 | final_name: grafana 3 | blobstore: 4 | provider: s3 5 | options: 6 | bucket_name: grafana-release-blobs 7 | -------------------------------------------------------------------------------- /jobs/grafana/monit: -------------------------------------------------------------------------------- 1 | check process grafana 2 | with pidfile /var/vcap/sys/run/grafana/pid 3 | start program "/var/vcap/jobs/grafana/bin/grafana_ctl start" 4 | stop program "/var/vcap/jobs/grafana/bin/grafana_ctl stop" 5 | group vcap 6 | -------------------------------------------------------------------------------- /jobs/grafana/spec: -------------------------------------------------------------------------------- 1 | --- 2 | name: grafana 3 | 4 | templates: 5 | grafana_ctl: bin/grafana_ctl 6 | post-start: bin/post-start 7 | create-update-dashboards.erb: bin/create-update-dashboards 8 | config.ini.erb: config/config.ini 9 | ssl.key.erb: config/ssl.key 10 | ssl.crt.erb: config/ssl.crt 11 | credentials: home/.aws/credentials 12 | client.key.erb: config/client.key 13 | client.crt.erb: config/client.crt 14 | cacert.pem.erb: config/cacert.pem 15 | dashboards.yml: config/provisioning/dashboards/dashboards.yml 16 | datasources.yml.erb: config/provisioning/datasources/datasources.yml 17 | 18 | packages: 19 | - grafana 20 | 21 | properties: 22 | grafana.listen_port: 23 | description: "TCP port on which the Grafana server should listen." 24 | default: 3000 25 | 26 | grafana.root_url: 27 | description: "The full root URL for the instance. Used for OAuth callbacks." 28 | 29 | grafana.ssl.cert: 30 | description: "SSL cert to use for HTTPS. If not specified, the server will listen in plaintext." 31 | 32 | grafana.ssl.key: 33 | description: "SSL private key to use for HTTPS. If not specified, the server will listen in plaintext." 34 | 35 | grafana.admin_username: 36 | description: "Username for the initial admin user." 37 | 38 | grafana.admin_password: 39 | description: "Password for the initial admin user." 40 | 41 | grafana.session.cookie_name: 42 | description: "Session cookie name" 43 | 44 | grafana.session.cookie_secure: 45 | description: "Use session in https only" 46 | 47 | grafana.session.session_life_time: 48 | description: "Session lifetime in seconds" 49 | 50 | grafana.users.allow_sign_up: 51 | description: "If enabled, users can create their own accounts." 52 | default: false 53 | 54 | grafana.users.allow_organization_creation: 55 | description: "If enabled, non-admin users can create organizations." 56 | default: false 57 | 58 | grafana.users.auto_assign_organization: 59 | description: "If enabled, new users will be automatically added to the default organization (id 1)." 60 | default: true 61 | 62 | grafana.users.auto_assign_organization_role: 63 | description: "The role for new users when automatically added to the default organization." 64 | default: Viewer 65 | 66 | grafana.auth.anonymous.enabled: 67 | description: "If enabled, users do not have to log in." 68 | default: false 69 | 70 | grafana.auth.anonymous.organization: 71 | description: "The organization that should be used for unauthenticated users." 72 | default: Main Org. 73 | 74 | grafana.auth.anonymous.organization_role: 75 | description: "The role to assume for anonymous users." 76 | default: Viewer 77 | 78 | grafana.auth.github.enabled: 79 | description: "Permit users to authenticate via GitHub OAuth." 80 | default: false 81 | 82 | grafana.auth.github.allow_sign_up: 83 | description: "Permit users to register via GitHub OAuth." 84 | default: true 85 | 86 | grafana.auth.github.client_id: 87 | description: "GitHub OAuth client ID." 88 | 89 | grafana.auth.github.client_secret: 90 | description: "GitHub OAuth client secret." 91 | 92 | grafana.auth.github.auth_url: 93 | description: "GitHub OAuth authorization endpoint." 94 | default: https://github.com/login/oauth/authorize 95 | 96 | grafana.auth.github.token_url: 97 | description: "GitHub OAuth access token endpoint." 98 | default: https://github.com/login/oauth/access_token 99 | 100 | grafana.auth.github.api_url: 101 | description: "GitHub users API endpoint." 102 | default: https://api.github.com/user 103 | 104 | grafana.auth.github.allowed_email_domains: 105 | description: "E-mail address domains to allow. If empty, all are allowed." 106 | default: [] 107 | 108 | grafana.auth.github.allowed_organizations: 109 | description: "GitHub organizations to allow. If empty, all are allowed." 110 | default: [] 111 | 112 | grafana.auth.github.team_ids: 113 | description: "GitHub team IDs to allow. If empty, all are allowed." 114 | default: [] 115 | 116 | grafana.auth.google.enabled: 117 | description: "Permit users to authenticate via Google OAuth." 118 | default: false 119 | 120 | grafana.auth.google.allow_sign_up: 121 | description: "Permit users to register via Google OAuth." 122 | default: true 123 | 124 | grafana.auth.google.client_id: 125 | description: "Google OAuth client ID." 126 | 127 | grafana.auth.google.client_secret: 128 | description: "Google OAuth client secret." 129 | 130 | grafana.auth.google.auth_url: 131 | description: "Google OAuth authorization endpoint." 132 | default: https://accounts.google.com/o/oauth2/auth 133 | 134 | grafana.auth.google.token_url: 135 | description: "Google OAuth access token endpoint." 136 | default: https://accounts.google.com/o/oauth2/token 137 | 138 | grafana.auth.google.api_url: 139 | description: "Google users API endpoint." 140 | default: https://www.googleapis.com/oauth2/v1/userinfo 141 | 142 | grafana.auth.google.allowed_email_domains: 143 | description: "E-mail address domains to allow. If empty, all are allowed." 144 | default: [] 145 | 146 | grafana.auth.generic_oauth.enabled: 147 | description: "Permit users to authenticate via Generic OAuth." 148 | default: false 149 | 150 | grafana.auth.generic_oauth.name: 151 | description: "Generic OAuth login link display name." 152 | default: "OAuth" 153 | 154 | grafana.auth.generic_oauth.client_id: 155 | description: "Generic OAuth client ID." 156 | 157 | grafana.auth.generic_oauth.client_secret: 158 | description: "Generic OAuth client secret." 159 | 160 | grafana.auth.generic_oauth.scopes: 161 | description: "Generic OAuth scopes." 162 | 163 | grafana.auth.generic_oauth.auth_url: 164 | description: "Generic OAuth authorization endpoint." 165 | 166 | grafana.auth.generic_oauth.token_url: 167 | description: "Generic OAuth access token endpoint." 168 | 169 | grafana.auth.generic_oauth.api_url: 170 | description: "Generic OAuth OpenID UserInfo API endpoint." 171 | 172 | grafana.auth.generic_oauth.allowed_domains: 173 | description: "E-mail address domains to allow. If empty, all are allowed." 174 | default: [] 175 | 176 | grafana.auth.generic_oauth.allow_sign_up: 177 | description: "Permit users to register via Generic OAuth." 178 | default: true 179 | 180 | grafana.auth.generic_oauth.tls_client_cert: 181 | description: "PEM encoded certificate for TLS client authentication via Generic OAuth." 182 | 183 | grafana.auth.generic_oauth.tls_client_key: 184 | description: "PEM encoded private key for TLS client authentication via Generic OAuth." 185 | 186 | grafana.auth.generic_oauth.tls_client_ca: 187 | description: "PEM encoded CA certificate for TLS client authentication via Generic OAuth." 188 | 189 | grafana.datasource: 190 | description: "Grafana datasource; see http://docs.grafana.org/http_api/data_source/ for details" 191 | 192 | grafana.datasources: 193 | description: | 194 | * If you want to configure multiple datasources, you can define an array of hashes here. Each hash must have 'name', 'url', 'type', 'user', 'password' and 'database' defined. 195 | * These datasources will be created in addition to the datasource defined in 'grafana.datasource'. The latter property is for backwards compatibility. 196 | * See http://docs.grafana.org/http_api/data_source/ for details 197 | example: | 198 | - name: influxdb 199 | url: http://1.2.3.4:8086 200 | type: influxdb 201 | user: admin 202 | password: admin123 203 | database: metrics 204 | default: [] 205 | 206 | grafana.dashboards: 207 | description: | 208 | List of grafana dasboards, converted to YAML 209 | example: | 210 | - name: frontend (without extension) 211 | content: 212 | default: [] 213 | 214 | grafana.auth.proxy.enabled: 215 | description: "Handle authentication in a http reverse proxy" 216 | 217 | grafana.auth.proxy.header_name: 218 | description: "The name of the http header used to forward authenticated user" 219 | 220 | grafana.auth.proxy.header_property: 221 | description: "Whether the header contains a user name or an email address (allowed values are 'username' or 'email')." 222 | 223 | grafana.auth.proxy.auto_sign_up: 224 | description: "Enable sign up of users who do not exist in Grafana DB" 225 | 226 | grafana.aws.aws_access_key_id: 227 | description: "access key for AWS cloudwatch data source" 228 | default: "" 229 | 230 | grafana.aws.aws_secret_access_key: 231 | description: "secret access key for AWS cloudwatch data source" 232 | default: "" 233 | 234 | grafana.aws.region: 235 | description: "region for AWS cloudwatch data source" 236 | default: "" 237 | 238 | grafana.snapshots.external_enabled: 239 | description: "Enable external snapshots sharing (to snapshot.raintank.io)" 240 | default: true 241 | 242 | grafana.external_image_storage.s3.bucket: 243 | description: "S3 Bucket to which images can be uploaded for public visibility (i.e. alerting)." 244 | 245 | grafana.external_image_storage.s3.region: 246 | description: "S3 Bucket region." 247 | 248 | grafana.external_image_storage.s3.path: 249 | description: "S3 Bucket path." 250 | 251 | grafana.external_image_storage.s3.access_key: 252 | description: "Access key to use when uploading to the bucket." 253 | 254 | grafana.external_image_storage.s3.secret_key: 255 | description: "Secret key to use when uploading to the bucket." 256 | 257 | grafana.external_image_storage.webdav.url: 258 | description: "WebDAV URL to which images can be uploaded for public visibility (i.e. alerting)." 259 | 260 | grafana.external_image_storage.webdav.username: 261 | description: "WebDAV user name." 262 | 263 | grafana.external_image_storage.webdav.password: 264 | description: "WebDAV password." 265 | -------------------------------------------------------------------------------- /jobs/grafana/templates/cacert.pem.erb: -------------------------------------------------------------------------------- 1 | <%= p("grafana.auth.generic_oauth.tls_client_ca", "") %> 2 | -------------------------------------------------------------------------------- /jobs/grafana/templates/client.crt.erb: -------------------------------------------------------------------------------- 1 | <%= p("grafana.auth.generic_oauth.tls_client_cert", "") %> 2 | -------------------------------------------------------------------------------- /jobs/grafana/templates/client.key.erb: -------------------------------------------------------------------------------- 1 | <%= p("grafana.auth.generic_oauth.tls_client_key", "") %> 2 | -------------------------------------------------------------------------------- /jobs/grafana/templates/config.ini.erb: -------------------------------------------------------------------------------- 1 | ##################### Grafana Configuration Example ##################### 2 | # 3 | # Everything has defaults so you only need to uncomment things you want to 4 | # change 5 | 6 | # possible values : production, development 7 | ; app_mode = production 8 | 9 | # instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty 10 | ; instance_name = ${HOSTNAME} 11 | 12 | #################################### Paths #################################### 13 | [paths] 14 | # Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used) 15 | # 16 | data = /var/vcap/store/grafana 17 | 18 | # 19 | # Directory where grafana can store logs 20 | # 21 | logs = /var/vcap/sys/log/grafana 22 | 23 | # 24 | # Directory where grafana will automatically scan and look for plugins 25 | # 26 | plugins = /var/vcap/store/grafana/plugins 27 | 28 | # 29 | # Directory containing provisioning config files that grafana will apply on startup 30 | # 31 | provisioning = /var/vcap/jobs/grafana/config/provisioning 32 | 33 | # 34 | #################################### Server #################################### 35 | [server] 36 | # Protocol (http, https, socket) 37 | protocol = <%= p("grafana.ssl.cert", nil) ? "https" : "http" %> 38 | 39 | # The ip address to bind to, empty will bind to all interfaces 40 | ;http_addr = 41 | 42 | # The http port to use 43 | http_port = <%= p("grafana.listen_port") %> 44 | 45 | # The public facing domain name used to access grafana from a browser 46 | ;domain = localhost 47 | 48 | # Redirect to correct domain if host header does not match domain 49 | # Prevents DNS rebinding attacks 50 | ;enforce_domain = false 51 | 52 | <% if_p("grafana.root_url") do |root_url| %> 53 | # The full public facing url you use in browser, used for redirects and emails 54 | # If you use reverse proxy and sub path specify full url (with sub path) 55 | root_url = <%= root_url %> 56 | <% end %> 57 | 58 | # Log web requests 59 | ;router_logging = false 60 | 61 | # the path relative working path 62 | ;static_root_path = public 63 | 64 | # enable gzip 65 | ;enable_gzip = false 66 | 67 | # https certs & key file 68 | <% if_p("grafana.ssl.cert") do %> 69 | cert_file = /var/vcap/jobs/grafana/config/ssl.crt 70 | cert_key = /var/vcap/jobs/grafana/config/ssl.key 71 | <% end %> 72 | 73 | # Unix socket path 74 | ;socket = 75 | 76 | #################################### Database #################################### 77 | [database] 78 | # You can configure the database connection by specifying type, host, name, user and password 79 | # as seperate properties or as on string using the url propertie. 80 | 81 | # Either "mysql", "postgres" or "sqlite3", it's your choice 82 | type = sqlite3 83 | ;host = 127.0.0.1:3306 84 | ;name = grafana 85 | ;user = root 86 | # If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;""" 87 | ;password = 88 | 89 | # Use either URL or the previous fields to configure the database 90 | # Example: mysql://user:secret@host:port/database 91 | ;url = 92 | 93 | # For "postgres" only, either "disable", "require" or "verify-full" 94 | ;ssl_mode = disable 95 | 96 | # For "sqlite3" only, path relative to data_path setting 97 | path = grafana.db 98 | 99 | # Max idle conn setting default is 2 100 | ;max_idle_conn = 2 101 | 102 | # Max conn setting default is 0 (mean not set) 103 | ;max_open_conn = 104 | 105 | 106 | #################################### Session #################################### 107 | [session] 108 | # Either "memory", "file", "redis", "mysql", "postgres", default is "file" 109 | ;provider = file 110 | 111 | # Provider config options 112 | # memory: not have any config yet 113 | # file: session dir path, is relative to grafana data_path 114 | # redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=grafana` 115 | # mysql: go-sql-driver/mysql dsn config string, e.g. `user:password@tcp(127.0.0.1:3306)/database_name` 116 | # postgres: user=a password=b host=localhost port=5432 dbname=c sslmode=disable 117 | ;provider_config = sessions 118 | 119 | # Session cookie name 120 | <% if_p("grafana.session.cookie_name") do |name| %>cookie_name = <%= name %><% end %> 121 | 122 | # If you use session in https only, default is false 123 | <% if_p("grafana.session.cookie_secure") do |secure| %>cookie_secure = <%= secure %><% end %> 124 | 125 | # Session life time, default is 86400 126 | <% if_p("grafana.session.session_life_time") do |lifetime| %>session_life_time = <%= lifetime %><% end %> 127 | 128 | #################################### Data proxy ########################### 129 | [dataproxy] 130 | 131 | # This enables data proxy logging, default is false 132 | ;logging = false 133 | 134 | 135 | #################################### Analytics #################################### 136 | [analytics] 137 | # Server reporting, sends usage counters to stats.grafana.org every 24 hours. 138 | # No ip addresses are being tracked, only simple counters to track 139 | # running instances, dashboard and error counts. It is very helpful to us. 140 | # Change this option to false to disable reporting. 141 | reporting_enabled = false 142 | 143 | # Set to false to disable all checks to https://grafana.net 144 | # for new vesions (grafana itself and plugins), check is used 145 | # in some UI views to notify that grafana or plugin update exists 146 | # This option does not cause any auto updates, nor send any information 147 | # only a GET request to http://grafana.com to get latest versions 148 | check_for_updates = false 149 | 150 | # Google Analytics universal tracking code, only enabled if you specify an id here 151 | ;google_analytics_ua_id = 152 | 153 | #################################### Security #################################### 154 | [security] 155 | # default admin user, created on startup 156 | admin_user = <%= p("grafana.admin_username") %> 157 | 158 | # default admin password, can be changed before first start of grafana, or in profile settings 159 | admin_password = <%= p("grafana.admin_password") %> 160 | 161 | # used for signing 162 | ;secret_key = SW2YcwTIb9zpOOhoPsMm 163 | 164 | # Auto-login remember days 165 | ;login_remember_days = 7 166 | ;cookie_username = grafana_user 167 | ;cookie_remember_name = grafana_remember 168 | 169 | # disable gravatar profile images 170 | ;disable_gravatar = false 171 | 172 | # data source proxy whitelist (ip_or_domain:port separated by spaces) 173 | ;data_source_proxy_whitelist = 174 | 175 | [snapshots] 176 | # snapshot sharing options 177 | external_enabled = <%= p("grafana.snapshots.external_enabled") %> 178 | ;external_snapshot_url = https://snapshots-origin.raintank.io 179 | ;external_snapshot_name = Publish to snapshot.raintank.io 180 | 181 | # remove expired snapshot 182 | ;snapshot_remove_expired = true 183 | 184 | # remove snapshots after 90 days 185 | ;snapshot_TTL_days = 90 186 | 187 | #################################### Users #################################### 188 | [users] 189 | # disable user signup / registration 190 | allow_sign_up = <%= p("grafana.users.allow_sign_up") %> 191 | 192 | # Allow non admin users to create organizations 193 | allow_org_create = <%= p("grafana.users.allow_organization_creation") %> 194 | 195 | # Set to true to automatically assign new users to the default organization (id 1) 196 | auto_assign_org = <%= p("grafana.users.auto_assign_organization") %> 197 | 198 | # Default role new users will be automatically assigned (if disabled above is set to true) 199 | auto_assign_org_role = <%= p("grafana.users.auto_assign_organization_role") %> 200 | 201 | # Background text for the user field on the login page 202 | ;login_hint = email or username 203 | 204 | # Default UI theme ("dark" or "light") 205 | ;default_theme = dark 206 | 207 | # External user management, these options affect the organization users view 208 | ;external_manage_link_url = 209 | ;external_manage_link_name = 210 | ;external_manage_info = 211 | 212 | [auth] 213 | # Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false 214 | ;disable_login_form = false 215 | 216 | # Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false 217 | <% if_p("grafana.auth.proxy.enabled") do %> 218 | disable_signout_menu = true 219 | <% end %> 220 | 221 | #################################### Anonymous Auth ########################## 222 | [auth.anonymous] 223 | # enable anonymous access 224 | enabled = <%= p("grafana.auth.anonymous.enabled") %> 225 | 226 | # specify organization name that should be used for unauthenticated users 227 | org_name = <%= p("grafana.auth.anonymous.organization") %> 228 | 229 | # specify role for unauthenticated users 230 | org_role = <%= p("grafana.auth.anonymous.organization_role") %> 231 | 232 | <% if_p("grafana.auth.github.enabled", "grafana.auth.github.client_id", "grafana.auth.github.client_secret") do %> 233 | #################################### Github Auth ########################## 234 | [auth.github] 235 | enabled = true 236 | allow_sign_up = <%= p("grafana.auth.github.allow_sign_up") %> 237 | client_id = <%= p("grafana.auth.github.client_id") %> 238 | client_secret = <%= p("grafana.auth.github.client_secret") %> 239 | scopes = user:email,read:org 240 | auth_url = <%= p("grafana.auth.github.auth_url") %> 241 | token_url = <%= p("grafana.auth.github.token_url") %> 242 | api_url = <%= p("grafana.auth.github.api_url") %> 243 | team_ids = <%= p("grafana.auth.github.team_ids").join(",") %> 244 | allowed_domains = <%= p("grafana.auth.github.allowed_email_domains").join(" ") %> 245 | allowed_organizations = <%= p("grafana.auth.github.allowed_organizations").join(" ") %> 246 | <% end %> 247 | 248 | <% if_p("grafana.auth.google.enabled", "grafana.auth.google.client_id", "grafana.auth.google.client_secret") do %> 249 | #################################### Google Auth ########################## 250 | [auth.google] 251 | enabled = true 252 | allow_sign_up = <%= p("grafana.auth.google.allow_sign_up") %> 253 | client_id = <%= p("grafana.auth.google.client_id") %> 254 | client_secret = <%= p("grafana.auth.google.client_secret") %> 255 | scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email 256 | auth_url = <%= p("grafana.auth.google.auth_url") %> 257 | token_url = <%= p("grafana.auth.google.token_url") %> 258 | api_url = <%= p("grafana.auth.google.api_url") %> 259 | allowed_domains = <%= p("grafana.auth.google.allowed_email_domains").join(" ") %> 260 | <% end %> 261 | 262 | <% if_p("grafana.auth.generic_oauth.enabled", "grafana.auth.generic_oauth.client_id", "grafana.auth.generic_oauth.client_secret", "grafana.auth.generic_oauth.auth_url", "grafana.auth.generic_oauth.token_url", "grafana.auth.generic_oauth.api_url") do %> 263 | #################################### Generic OAuth ########################## 264 | [auth.generic_oauth] 265 | enabled = true 266 | name = <%= p("grafana.auth.generic_oauth.name") %> 267 | allow_sign_up = <%= p("grafana.auth.generic_oauth.allow_sign_up") %> 268 | client_id = <%= p("grafana.auth.generic_oauth.client_id") %> 269 | client_secret = <%= p("grafana.auth.generic_oauth.client_secret") %> 270 | scopes = <%= p("grafana.auth.generic_oauth.scopes").join(" ") %> 271 | auth_url = <%= p("grafana.auth.generic_oauth.auth_url") %> 272 | token_url = <%= p("grafana.auth.generic_oauth.token_url") %> 273 | api_url = <%= p("grafana.auth.generic_oauth.api_url") %> 274 | allowed_domains = <%= p("grafana.auth.generic_oauth.allowed_domains").join(" ") %> 275 | <% if_p("grafana.auth.generic_oauth.tls_client_cert", "grafana.auth.generic_oauth.tls_client_key", "grafana.auth.generic_oauth.tls_client_ca") do %> 276 | tls_client_cert = /var/vcap/jobs/grafana/config/client.crt 277 | tls_client_key = /var/vcap/jobs/grafana/config/client.key 278 | tls_client_ca = /var/vcap/jobs/grafana/config/cacert.pem 279 | <% end %> 280 | <% end %> 281 | 282 | #################################### Grafana.com Auth #################### 283 | [auth.grafana_com] 284 | ;enabled = false 285 | ;allow_sign_up = true 286 | ;client_id = some_id 287 | ;client_secret = some_secret 288 | ;scopes = user:email 289 | ;allowed_organizations = 290 | 291 | <% if_p("grafana.auth.proxy.enabled") do %> 292 | #################################### Auth Proxy ########################## 293 | [auth.proxy] 294 | enabled = true 295 | header_name = <%= p("grafana.auth.proxy.header_name") %> 296 | header_property = <%= p("grafana.auth.proxy.header_property") %> 297 | auto_sign_up = <%= p("grafana.auth.proxy.auto_sign_up") %> 298 | <% end %> 299 | 300 | #################################### Basic Auth ########################## 301 | [auth.basic] 302 | ;enabled = true 303 | 304 | #################################### Auth LDAP ########################## 305 | [auth.ldap] 306 | ;enabled = false 307 | ;config_file = /etc/grafana/ldap.toml 308 | ;allow_sign_up = true 309 | 310 | #################################### SMTP / Emailing ########################## 311 | [smtp] 312 | ;enabled = false 313 | ;host = localhost:25 314 | ;user = 315 | # If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;""" 316 | ;password = 317 | ;cert_file = 318 | ;key_file = 319 | ;skip_verify = false 320 | ;from_address = admin@grafana.localhost 321 | ;from_name = Grafana 322 | # EHLO identity in SMTP dialog (defaults to instance_name) 323 | ;ehlo_identity = dashboard.example.com 324 | 325 | [emails] 326 | ;welcome_email_on_sign_up = false 327 | 328 | #################################### Logging ########################## 329 | [log] 330 | # Either "console", "file", "syslog". Default is console and file 331 | # Use space to separate multiple modes, e.g. "console file" 332 | ;mode = console file 333 | 334 | # Either "debug", "info", "warn", "error", "critical", default is "info" 335 | ;level = info 336 | 337 | # optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug 338 | ;filters = 339 | 340 | 341 | # For "console" mode only 342 | [log.console] 343 | ;level = 344 | 345 | # log line format, valid options are text, console and json 346 | ;format = console 347 | 348 | # For "file" mode only 349 | [log.file] 350 | ;level = 351 | 352 | # log line format, valid options are text, console and json 353 | ;format = text 354 | 355 | # This enables automated log rotate(switch of following options), default is true 356 | ;log_rotate = true 357 | 358 | # Max line number of single file, default is 1000000 359 | ;max_lines = 1000000 360 | 361 | # Max size shift of single file, default is 28 means 1 << 28, 256MB 362 | ;max_size_shift = 28 363 | 364 | # Segment log daily, default is true 365 | ;daily_rotate = true 366 | 367 | # Expired days of log file(delete after max days), default is 7 368 | ;max_days = 7 369 | 370 | [log.syslog] 371 | ;level = 372 | 373 | # log line format, valid options are text, console and json 374 | ;format = text 375 | 376 | # Syslog network type and address. This can be udp, tcp, or unix. If left blank, the default unix endpoints will be used. 377 | ;network = 378 | ;address = 379 | 380 | # Syslog facility. user, daemon and local0 through local7 are valid. 381 | ;facility = 382 | 383 | # Syslog tag. By default, the process' argv[0] is used. 384 | ;tag = 385 | 386 | 387 | #################################### AMQP Event Publisher ########################## 388 | [event_publisher] 389 | ;enabled = false 390 | ;rabbitmq_url = amqp://localhost/ 391 | ;exchange = grafana_events 392 | 393 | #################################### Alerting ############################ 394 | [alerting] 395 | # Disable alerting engine & UI features 396 | ;enabled = true 397 | # Makes it possible to turn off alert rule execution but alerting UI is visible 398 | ;execute_alerts = true 399 | 400 | #################################### Internal Grafana Metrics ########################## 401 | # Metrics available at HTTP API Url /api/metrics 402 | [metrics] 403 | # Disable / Enable internal metrics 404 | ;enabled = true 405 | 406 | # Publish interval 407 | ;interval_seconds = 10 408 | 409 | # Send internal metrics to Graphite 410 | [metrics.graphite] 411 | # Enable by setting the address setting (ex localhost:2003) 412 | ;address = 413 | ;prefix = prod.grafana.%(instance_name)s. 414 | 415 | #################################### Distributed tracing ############ 416 | [tracing.jaeger] 417 | # Enable by setting the address sending traces to jaeger (ex localhost:6831) 418 | ;address = localhost:6831 419 | # Tag that will always be included in when creating new spans. ex (tag1:value1,tag2:value2) 420 | ;always_included_tag = tag1:value1 421 | # Type specifies the type of the sampler: const, probabilistic, rateLimiting, or remote 422 | ;sampler_type = const 423 | # jaeger samplerconfig param 424 | # for "const" sampler, 0 or 1 for always false/true respectively 425 | # for "probabilistic" sampler, a probability between 0 and 1 426 | # for "rateLimiting" sampler, the number of spans per second 427 | # for "remote" sampler, param is the same as for "probabilistic" 428 | # and indicates the initial sampling rate before the actual one 429 | # is received from the mothership 430 | ;sampler_param = 1 431 | 432 | #################################### Grafana.com integration ########################## 433 | # Url used to to import dashboards directly from Grafana.com 434 | [grafana_com] 435 | ;url = https://grafana.com 436 | 437 | #################################### External image storage ########################## 438 | [external_image_storage] 439 | # Used for uploading images to public servers so they can be included in slack/email messages. 440 | # you can choose between (s3, webdav, gcs) 441 | <% if_p("grafana.external_image_storage.s3.bucket") do %> 442 | provider = s3 443 | <% end %> 444 | <% if_p("grafana.external_image_storage.webdav.url") do %> 445 | provider = webdav 446 | <% end %> 447 | 448 | [external_image_storage.s3] 449 | <% if_p("grafana.external_image_storage.s3.bucket", "grafana.external_image_storage.s3.region", "grafana.external_image_storage.s3.path", 450 | "grafana.external_image_storage.s3.access_key", "grafana.external_image_storage.s3.secret_key") do |bucket, region, path, key, secret| %> 451 | bucket = <%= bucket %> 452 | region = <%= region %> 453 | path = <%= path %> 454 | access_key = <%= key %> 455 | secret_key = <%= secret %> 456 | <% end %> 457 | 458 | [external_image_storage.webdav] 459 | <% if_p("grafana.external_image_storage.webdav.url", "grafana.external_image_storage.webdav.username", "grafana.external_image_storage.webdav.password") do |url, user, pass| %> 460 | url = <%= url %> 461 | username = <%= user %> 462 | password = <%= pass %> 463 | <% end %> 464 | 465 | [external_image_storage.gcs] 466 | ;key_file = 467 | ;bucket = 468 | 469 | -------------------------------------------------------------------------------- /jobs/grafana/templates/create-update-dashboards.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DASHBOARDS_DIR="/var/vcap/store/grafana/dashboards" 4 | LOG_DIR=/var/vcap/sys/log/grafana 5 | 6 | exec &>> ${LOG_DIR}/create-update-dashboards.log 7 | 8 | echo Create ${DASHBOARDS_DIR} directory 9 | mkdir -p ${DASHBOARDS_DIR} 10 | 11 | echo Delete old dashboards from ${DASHBOARDS_DIR} 12 | rm -f ${DASHBOARDS_DIR}/* 13 | 14 | <% 15 | dashboards = p("grafana.dashboards") 16 | %> 17 | 18 | <% dashboards.each do |dashboard| %> 19 | dashboard_file="${DASHBOARDS_DIR}/<%= dashboard['name'] %>.json" 20 | 21 | echo Create ${dashboard_file} 22 | 23 | cat > "${dashboard_file}" <<'EOF' 24 | <%= dashboard['content'] %> 25 | EOF 26 | <% end %> 27 | 28 | <% if dashboards.empty? then %> 29 | echo "No automatic dashboard creation requested" 30 | <% end %> 31 | -------------------------------------------------------------------------------- /jobs/grafana/templates/credentials: -------------------------------------------------------------------------------- 1 | [default] 2 | aws_access_key_id = <%= p("grafana.aws.aws_access_key_id") %> 3 | aws_secret_access_key = <%= p("grafana.aws.aws_secret_access_key") %> 4 | region = <%= p("grafana.aws.region") %> 5 | -------------------------------------------------------------------------------- /jobs/grafana/templates/dashboards.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | providers: 4 | # provider name 5 | - name: 'default' 6 | # org id. will default to orgId 1 if not specified 7 | orgId: 1 8 | # name of the dashboard folder. Required 9 | folder: '' 10 | # folder UID. will be automatically generated if not specified 11 | folderUid: '' 12 | # provider type. Required 13 | type: file 14 | # disable dashboard deletion 15 | disableDeletion: false 16 | # enable dashboard editing 17 | editable: true 18 | # how often Grafana will scan for changed dashboards 19 | updateIntervalSeconds: 10 20 | options: 21 | # path to dashboard files on disk. Required 22 | path: /var/vcap/store/grafana/dashboards 23 | -------------------------------------------------------------------------------- /jobs/grafana/templates/datasources.yml.erb: -------------------------------------------------------------------------------- 1 | <% 2 | require 'yaml' 3 | datasources = p('grafana.datasources') 4 | if_p('grafana.datasource') do |datasource| 5 | datasources << p('grafana.datasource') 6 | end 7 | datasources = datasources.map do |datasource| 8 | { 9 | 'access' => 'proxy', 10 | 'basicAuth' => false, 11 | 'database' => datasource.delete('database_name'), 12 | 'type' => datasource.delete('database_type'), 13 | }.merge(datasource) 14 | end 15 | datasources = {"apiVersion" => 1, "datasources" => datasources} 16 | %> 17 | 18 | <%= YAML.dump(datasources) %> 19 | -------------------------------------------------------------------------------- /jobs/grafana/templates/grafana_ctl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e -u -x 4 | 5 | RUN_DIR=/var/vcap/sys/run/grafana 6 | LOG_DIR=/var/vcap/sys/log/grafana 7 | STORE_DIR=/var/vcap/store/grafana 8 | PACKAGE_DIR=/var/vcap/packages/grafana 9 | PIDFILE=$RUN_DIR/pid 10 | HOME_DIR=/var/vcap/jobs/grafana/home 11 | 12 | source $PACKAGE_DIR/pid_utils.sh 13 | 14 | case $1 in 15 | 16 | start) 17 | pid_guard $PIDFILE "grafana" 18 | 19 | mkdir -p $RUN_DIR $LOG_DIR $STORE_DIR 20 | chown -R vcap:vcap $RUN_DIR $LOG_DIR $STORE_DIR 21 | 22 | # grafana initializes logging before loading out config, using its default 23 | # config, which logs under $HOME_PATH/data/log, and blows up if the 24 | # directory doesn't exist :( 25 | mkdir -p $PACKAGE_DIR/data/log 26 | chown vcap:vcap $PACKAGE_DIR/data/log 27 | 28 | setcap cap_net_bind_service=+ep $PACKAGE_DIR/bin/grafana-server 29 | 30 | exec chpst -u vcap:vcap env HOME=$HOME_DIR $PACKAGE_DIR/bin/grafana-server \ 31 | -config=/var/vcap/jobs/grafana/config/config.ini \ 32 | -homepath=$PACKAGE_DIR \ 33 | -pidfile=$PIDFILE \ 34 | 1>>$LOG_DIR/stdout.log \ 35 | 2>>$LOG_DIR/stderr.log 36 | 37 | ;; 38 | 39 | stop) 40 | kill_and_wait $PIDFILE 41 | 42 | ;; 43 | 44 | *) 45 | echo "Usage: $0 {start|stop}" 46 | 47 | ;; 48 | 49 | esac 50 | -------------------------------------------------------------------------------- /jobs/grafana/templates/post-start: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "[$(date)] Calling 'create-update-dashboards' ..." 4 | $(dirname $0)/create-update-dashboards 5 | -------------------------------------------------------------------------------- /jobs/grafana/templates/ssl.crt.erb: -------------------------------------------------------------------------------- 1 | <%= p("grafana.ssl.cert", "") %> 2 | -------------------------------------------------------------------------------- /jobs/grafana/templates/ssl.key.erb: -------------------------------------------------------------------------------- 1 | <%= p("grafana.ssl.key", "") %> 2 | -------------------------------------------------------------------------------- /packages/grafana/packaging: -------------------------------------------------------------------------------- 1 | set -e -u -x 2 | 3 | tar --strip-components=1 -zxf grafana/grafana*.tar.gz -C ${BOSH_INSTALL_TARGET} 4 | 5 | cp pid_utils.sh ${BOSH_INSTALL_TARGET} 6 | -------------------------------------------------------------------------------- /packages/grafana/spec: -------------------------------------------------------------------------------- 1 | --- 2 | name: grafana 3 | 4 | dependencies: [] 5 | 6 | files: 7 | - grafana/*.tar.gz # From https://s3-us-west-2.amazonaws.com/grafana-releases/release/... 8 | - pid_utils.sh 9 | -------------------------------------------------------------------------------- /releases/grafana/grafana-1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | packages: 3 | - name: grafana 4 | version: edabf0bd5a909fd446bb048e19a034660daaa231 5 | fingerprint: edabf0bd5a909fd446bb048e19a034660daaa231 6 | sha1: 4df5cca000398c750e39967b86dcc50316b859e1 7 | dependencies: [] 8 | jobs: 9 | - name: grafana 10 | version: 101ffa6ce9ad14b17fb028f46b6e30ef214e0ab0 11 | fingerprint: 101ffa6ce9ad14b17fb028f46b6e30ef214e0ab0 12 | sha1: bb99e7fa9c2dc3dc39371a28ea19f9ad9236a05a 13 | license: 14 | version: a3e6d245553160dad1d273d363550134abc94578 15 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 16 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 17 | commit_hash: 02f120d1 18 | uncommitted_changes: true 19 | name: grafana 20 | version: '1' 21 | -------------------------------------------------------------------------------- /releases/grafana/grafana-10.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: "10" 3 | commit_hash: c17a1e6 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: 5f33f435b5b4ae43018f1e45570df21a8f905e3c 8 | fingerprint: 5f33f435b5b4ae43018f1e45570df21a8f905e3c 9 | sha1: 2ab433d9cc1a2fca8549865e2b99ea98bb419414 10 | packages: 11 | - name: grafana 12 | version: 082e0ca02c500e99dffa6565150716399ac78ac1 13 | fingerprint: 082e0ca02c500e99dffa6565150716399ac78ac1 14 | sha1: 09da35616c62b83ba720eaabf6360ff78502174c 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-11.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: "11" 3 | commit_hash: 3d6e3e3 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: 5f33f435b5b4ae43018f1e45570df21a8f905e3c 8 | fingerprint: 5f33f435b5b4ae43018f1e45570df21a8f905e3c 9 | sha1: 2ab433d9cc1a2fca8549865e2b99ea98bb419414 10 | packages: 11 | - name: grafana 12 | version: 58ceabef9f1f019b5faff4321e1d032a67efa3c2 13 | fingerprint: 58ceabef9f1f019b5faff4321e1d032a67efa3c2 14 | sha1: ca7519c13d317278c5f9ec101a99c734633ca0b4 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-12.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: "12" 3 | commit_hash: 980bf91 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: 4182fbd051793d48fd1b3a720a39489a4731b141 8 | fingerprint: 4182fbd051793d48fd1b3a720a39489a4731b141 9 | sha1: 1afee63485d3401cac0beca107f014669903485f 10 | packages: 11 | - name: grafana 12 | version: 58ceabef9f1f019b5faff4321e1d032a67efa3c2 13 | fingerprint: 58ceabef9f1f019b5faff4321e1d032a67efa3c2 14 | sha1: ca7519c13d317278c5f9ec101a99c734633ca0b4 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-13.1.0.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: 13.1.0 3 | commit_hash: 2c759da 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: 4182fbd051793d48fd1b3a720a39489a4731b141 8 | fingerprint: 4182fbd051793d48fd1b3a720a39489a4731b141 9 | sha1: 1afee63485d3401cac0beca107f014669903485f 10 | packages: 11 | - name: grafana 12 | version: faef249fb0ae5b69a00256da0d966a01a0d326f0 13 | fingerprint: faef249fb0ae5b69a00256da0d966a01a0d326f0 14 | sha1: a9bb1acae31b46cfeb6f24259998919855ac2725 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-13.2.0.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: 13.2.0 3 | commit_hash: f21d98e 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: caf43ba97c5e808e750a22cb360d9df013444285 8 | fingerprint: caf43ba97c5e808e750a22cb360d9df013444285 9 | sha1: f745fd9b85708ce53e18531b7beb50721864e41f 10 | packages: 11 | - name: grafana 12 | version: adf9a3e1d017b2d267e796ce1a8df7a8218ad8d5 13 | fingerprint: adf9a3e1d017b2d267e796ce1a8df7a8218ad8d5 14 | sha1: 3d9374efb65f9fe2234a90ef56b3ad27efbce611 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-13.2.1.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: 13.2.1 3 | commit_hash: 0c7216b 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: caf43ba97c5e808e750a22cb360d9df013444285 8 | fingerprint: caf43ba97c5e808e750a22cb360d9df013444285 9 | sha1: f745fd9b85708ce53e18531b7beb50721864e41f 10 | packages: 11 | - name: grafana 12 | version: 1d35b32ad99abf27758c3c69751588520ac985b3 13 | fingerprint: 1d35b32ad99abf27758c3c69751588520ac985b3 14 | sha1: a22cae9369fde7e6ff8aa352fe8f5552d55cea6f 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-13.2.2.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: 13.2.2 3 | commit_hash: b99d670 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: caf43ba97c5e808e750a22cb360d9df013444285 8 | fingerprint: caf43ba97c5e808e750a22cb360d9df013444285 9 | sha1: f745fd9b85708ce53e18531b7beb50721864e41f 10 | packages: 11 | - name: grafana 12 | version: 22f8a519211998832ca906e3fb06749776f27d31 13 | fingerprint: 22f8a519211998832ca906e3fb06749776f27d31 14 | sha1: 30bdd7b0f46be47d751b1e918f5f8c4e6f3049b4 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-13.3.0.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: 13.3.0 3 | commit_hash: 85d6038 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: 21c4d0b768ade82258f60cc25a2f3291eaaecba7 8 | fingerprint: 21c4d0b768ade82258f60cc25a2f3291eaaecba7 9 | sha1: dad32b88ea727567be53f1ca985616fe056a3d0a 10 | packages: 11 | - name: grafana 12 | version: 22f8a519211998832ca906e3fb06749776f27d31 13 | fingerprint: 22f8a519211998832ca906e3fb06749776f27d31 14 | sha1: 30bdd7b0f46be47d751b1e918f5f8c4e6f3049b4 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-13.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: "13" 3 | commit_hash: 70c47de 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: 4182fbd051793d48fd1b3a720a39489a4731b141 8 | fingerprint: 4182fbd051793d48fd1b3a720a39489a4731b141 9 | sha1: 1afee63485d3401cac0beca107f014669903485f 10 | packages: 11 | - name: grafana 12 | version: 144ba150784760cf47513e2df03b3ab63ec22906 13 | fingerprint: 144ba150784760cf47513e2df03b3ab63ec22906 14 | sha1: 57cd3b31019bff7c2bcd35c08872f634eb60d0d9 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | packages: 3 | - name: grafana 4 | version: edabf0bd5a909fd446bb048e19a034660daaa231 5 | fingerprint: edabf0bd5a909fd446bb048e19a034660daaa231 6 | sha1: 4df5cca000398c750e39967b86dcc50316b859e1 7 | dependencies: [] 8 | jobs: 9 | - name: grafana 10 | version: 08ffd974e877cf8b245b0ecf6f3747c216d74751 11 | fingerprint: 08ffd974e877cf8b245b0ecf6f3747c216d74751 12 | sha1: 4dcde4ef46c222869e11114490ae62ebfdcd324b 13 | license: 14 | version: a3e6d245553160dad1d273d363550134abc94578 15 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 16 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 17 | commit_hash: 19b07cb4 18 | uncommitted_changes: true 19 | name: grafana 20 | version: '2' 21 | -------------------------------------------------------------------------------- /releases/grafana/grafana-3.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: "3" 3 | commit_hash: 238c3e8 4 | uncommitted_changes: true 5 | jobs: 6 | - name: grafana 7 | version: 2bdde92ed89675f57d50616afd9f28627f9aebda 8 | fingerprint: 2bdde92ed89675f57d50616afd9f28627f9aebda 9 | sha1: 6c606beff1de8e1db79fa39745dae5f3381924be 10 | packages: 11 | - name: grafana 12 | version: 3df830ffef8a2ed1c09fdcd72182addfcefec1f9 13 | fingerprint: 3df830ffef8a2ed1c09fdcd72182addfcefec1f9 14 | sha1: 0deb1bc169b0286059b2871e154c0e25f042f497 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-4.yml: -------------------------------------------------------------------------------- 1 | --- 2 | packages: 3 | - name: grafana 4 | version: af22fba9e9edcaea272cb48f8d43633ca9de570b 5 | fingerprint: af22fba9e9edcaea272cb48f8d43633ca9de570b 6 | sha1: 76120a089781317148bd7d318cad586cb8217bd7 7 | dependencies: [] 8 | jobs: 9 | - name: grafana 10 | version: 6e51cec5fbe53d9b1b97b475a87b32b99484aa55 11 | fingerprint: 6e51cec5fbe53d9b1b97b475a87b32b99484aa55 12 | sha1: d84f299a8eb64cf98c5d03c2f97b541b1a255791 13 | license: 14 | version: a3e6d245553160dad1d273d363550134abc94578 15 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 16 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 17 | commit_hash: f7c9e3ac 18 | uncommitted_changes: true 19 | name: grafana 20 | version: '4' 21 | -------------------------------------------------------------------------------- /releases/grafana/grafana-5.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: "5" 3 | commit_hash: 46d05f0 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: 7e65b1c9feb80bac6c633948ca6746847e274fb0 8 | fingerprint: 7e65b1c9feb80bac6c633948ca6746847e274fb0 9 | sha1: 9ebe297e44c2a6758f817e26badacb6cb7cd178f 10 | packages: 11 | - name: grafana 12 | version: 010d9c4322464dae189c26da8d11cf4191c4b795 13 | fingerprint: 010d9c4322464dae189c26da8d11cf4191c4b795 14 | sha1: 3a2f9e6a9a5ef8fba0e3f248aa0e86215b492616 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-6.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: "6" 3 | commit_hash: edac5f3 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: fec27a1e38a44ee184a8492efe18c214642c31ac 8 | fingerprint: fec27a1e38a44ee184a8492efe18c214642c31ac 9 | sha1: 39aa3b0f0e003c02d8d7b1bcb88ac139f9ad3510 10 | packages: 11 | - name: grafana 12 | version: 010d9c4322464dae189c26da8d11cf4191c4b795 13 | fingerprint: 010d9c4322464dae189c26da8d11cf4191c4b795 14 | sha1: 3a2f9e6a9a5ef8fba0e3f248aa0e86215b492616 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-7.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: "7" 3 | commit_hash: 5134a34 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: fec27a1e38a44ee184a8492efe18c214642c31ac 8 | fingerprint: fec27a1e38a44ee184a8492efe18c214642c31ac 9 | sha1: 39aa3b0f0e003c02d8d7b1bcb88ac139f9ad3510 10 | packages: 11 | - name: grafana 12 | version: 6d7699109a8a3fc78abd2710cbebf1557889823a 13 | fingerprint: 6d7699109a8a3fc78abd2710cbebf1557889823a 14 | sha1: e29b75acb7faa18aa59eb26efbb532a5eaef2e3f 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-8.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: "8" 3 | commit_hash: cc1fe7d 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: 8aa7c95e29abda2255715b92e907901887dfd2c1 8 | fingerprint: 8aa7c95e29abda2255715b92e907901887dfd2c1 9 | sha1: b85a9fdcfb91d44a022a5539ca19ec8e66a4cff3 10 | packages: 11 | - name: grafana 12 | version: 6d7699109a8a3fc78abd2710cbebf1557889823a 13 | fingerprint: 6d7699109a8a3fc78abd2710cbebf1557889823a 14 | sha1: e29b75acb7faa18aa59eb26efbb532a5eaef2e3f 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/grafana-9.yml: -------------------------------------------------------------------------------- 1 | name: grafana 2 | version: "9" 3 | commit_hash: "9132440" 4 | uncommitted_changes: false 5 | jobs: 6 | - name: grafana 7 | version: 8aa7c95e29abda2255715b92e907901887dfd2c1 8 | fingerprint: 8aa7c95e29abda2255715b92e907901887dfd2c1 9 | sha1: b85a9fdcfb91d44a022a5539ca19ec8e66a4cff3 10 | packages: 11 | - name: grafana 12 | version: c85dd0f64705bce03d076ed0b8091fc99205517d 13 | fingerprint: c85dd0f64705bce03d076ed0b8091fc99205517d 14 | sha1: c5c12f5e8bb69af4efa9fce2670f4a21ef93fb62 15 | dependencies: [] 16 | license: 17 | version: a3e6d245553160dad1d273d363550134abc94578 18 | fingerprint: a3e6d245553160dad1d273d363550134abc94578 19 | sha1: c93340aad17fda7ff16d9b0e3c413a858a27727a 20 | -------------------------------------------------------------------------------- /releases/grafana/index.yml: -------------------------------------------------------------------------------- 1 | builds: 2 | 004e4254-2dc5-46e2-6491-eb8a51c86da7: 3 | version: "7" 4 | 0e1cfa4e-c6f7-4909-530c-e4cb6e573258: 5 | version: "11" 6 | 230a3c86-5f80-4c5b-5dfd-8cff1300c273: 7 | version: 13.3.0 8 | 2c179648-5648-49f0-5deb-5a7986d0dd0b: 9 | version: 13.2.0 10 | 87b9bd24-569b-4110-6577-59b0b2955099: 11 | version: "12" 12 | 9f062546-2388-4cb8-7dd8-270a902a0899: 13 | version: "10" 14 | a24cec91-a524-490b-4d79-51215c894dc3: 15 | version: 13.2.2 16 | a66b9999-1cdc-4de6-7886-dc5901014bf5: 17 | version: "5" 18 | b61ddd2b-2ffa-4101-6d47-888eeeb13c2f: 19 | version: "9" 20 | ba0ffbb4-bf70-4a3b-7e2f-e696b26b4603: 21 | version: "3" 22 | bae9ad89-03d5-462b-a477-8101dce71e7b: 23 | version: "4" 24 | c4b049af-fc65-4dff-b197-78f113103bd1: 25 | version: "2" 26 | c75bf223-9829-4448-650f-7e84bdf9ffd7: 27 | version: "6" 28 | ce391a73-6159-468e-78ed-2eb36d00e932: 29 | version: 13.1.0 30 | ce442084-546c-4374-55bd-4ecf268e2f4a: 31 | version: "8" 32 | d0d00c5d-5ff3-430a-7b13-72325f82bb45: 33 | version: "13" 34 | db0fa1f9-0638-4481-81f1-bcb5530d7749: 35 | version: "1" 36 | e2d6cb82-7021-42f5-51ae-271d88bf4279: 37 | version: 13.2.1 38 | format-version: "2" 39 | -------------------------------------------------------------------------------- /src/pid_utils.sh: -------------------------------------------------------------------------------- 1 | SCRIPT=$(basename $0) 2 | mkdir -p /var/vcap/sys/log/monit 3 | 4 | exec 1>> /var/vcap/sys/log/monit/$SCRIPT.out.log 5 | exec 2>> /var/vcap/sys/log/monit/$SCRIPT.err.log 6 | 7 | pid_guard() { 8 | pidfile=$1 9 | name=$2 10 | 11 | if [ -f "$pidfile" ]; then 12 | pid=$(head -1 "$pidfile") 13 | 14 | if [ -n "$pid" ] && [ -e /proc/$pid ]; then 15 | echo "$name is already running, please stop it first" 16 | exit 1 17 | fi 18 | 19 | echo "Removing stale pidfile..." 20 | rm $pidfile 21 | fi 22 | } 23 | 24 | wait_pidfile() { 25 | pidfile=$1 26 | try_kill=$2 27 | timeout=${3:-0} 28 | force=${4:-0} 29 | countdown=$(( $timeout * 10 )) 30 | 31 | if [ -f "$pidfile" ]; then 32 | pid=$(head -1 "$pidfile") 33 | 34 | if [ -z "$pid" ]; then 35 | echo "Unable to get pid from $pidfile" 36 | exit 1 37 | fi 38 | 39 | if [ -e /proc/$pid ]; then 40 | if [ "$try_kill" = "1" ]; then 41 | echo "Killing $pidfile: $pid " 42 | kill $pid 43 | fi 44 | while [ -e /proc/$pid ]; do 45 | sleep 0.1 46 | [ "$countdown" != '0' -a $(( $countdown % 10 )) = '0' ] && echo -n . 47 | if [ $timeout -gt 0 ]; then 48 | if [ $countdown -eq 0 ]; then 49 | if [ "$force" = "1" ]; then 50 | echo -ne "\nKill timed out, using kill -QUIT on $pid... " 51 | kill -QUIT $pid 52 | sleep 0.5 53 | fi 54 | break 55 | else 56 | countdown=$(( $countdown - 1 )) 57 | fi 58 | fi 59 | done 60 | if [ -e /proc/$pid ]; then 61 | echo "Timed Out" 62 | else 63 | echo "Stopped" 64 | fi 65 | else 66 | echo "Process $pid is not running" 67 | fi 68 | 69 | rm -f $pidfile 70 | else 71 | echo "Pidfile $pidfile doesn't exist" 72 | fi 73 | } 74 | 75 | kill_and_wait() { 76 | pidfile=$1 77 | # Monit default timeout for start/stop is 30s 78 | # Append 'with timeout {n} seconds' to monit start/stop program configs 79 | timeout=${2:-25} 80 | force=${3:-1} 81 | 82 | wait_pidfile $pidfile 1 $timeout $force 83 | } 84 | --------------------------------------------------------------------------------