├── .github ├── stale.yml └── workflows │ ├── master-build.yml │ └── pull-request.yml ├── .gitignore ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── Dockerfile ├── LICENSE ├── README.md ├── _config.yml ├── mvnw ├── mvnw.cmd ├── pom.xml ├── scripts └── cleanup-branches.sh ├── src ├── main │ ├── java │ │ └── com │ │ │ └── aakkus │ │ │ └── dockercomposeinitializr │ │ │ ├── DockerComposeInitializrApplication.java │ │ │ ├── domain │ │ │ ├── DockerComposeFileFacade.java │ │ │ ├── DockerComposeFilePort.java │ │ │ ├── FeedbackFacade.java │ │ │ ├── FeedbackPort.java │ │ │ └── model │ │ │ │ ├── CreateDockerComposeFileCommand.java │ │ │ │ ├── DockerComposeFile.java │ │ │ │ ├── DockerComposeServiceDefinition.java │ │ │ │ └── DockerComposeVersionDefinition.java │ │ │ └── infra │ │ │ ├── adapter │ │ │ ├── DockerComposeFileAdapter.java │ │ │ ├── FeedbackAdapter.java │ │ │ └── model │ │ │ │ └── DockerComposeService.java │ │ │ ├── config │ │ │ └── DockerComposeConfiguration.java │ │ │ └── rest │ │ │ ├── DockerComposeRestController.java │ │ │ ├── FeedbackController.java │ │ │ ├── model │ │ │ ├── DockerComposeServiceDefinitionModel.java │ │ │ └── DockerComposeVersionDefinitionModel.java │ │ │ ├── request │ │ │ └── CreateDockerComposeFileRequest.java │ │ │ └── response │ │ │ └── DockerComposeResponse.java │ └── resources │ │ ├── application.yml │ │ └── static │ │ ├── css │ │ ├── app.css │ │ ├── bootstrap.min.css │ │ ├── fonts │ │ │ ├── element-icons.ttf │ │ │ └── element-icons.woff │ │ └── vuetify.css │ │ ├── images │ │ └── docker.png │ │ ├── index.html │ │ └── js │ │ ├── app.js │ │ ├── bootstrap-vue.min.js │ │ ├── bootstrap.min.js │ │ ├── jquery.min.js │ │ ├── popper.min.js │ │ ├── vue-resource.js │ │ ├── vue.js │ │ └── vuetify.js └── test │ └── java │ └── com │ └── aakkus │ └── dockercomposeinitializr │ ├── IT.java │ └── infra │ ├── adapter │ └── DockerComposeFileCreateAdapterTest.java │ └── rest │ └── DockerComposeRestControllerTest.java └── system.properties /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 60 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - security 9 | # Label to use when marking an issue as stale 10 | staleLabel: wontfix 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false 18 | -------------------------------------------------------------------------------- /.github/workflows/master-build.yml: -------------------------------------------------------------------------------- 1 | name: Java CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v1 13 | - name: Set up JDK 1.11 14 | uses: actions/setup-java@v1 15 | with: 16 | java-version: 1.11 17 | - name: Cache maven dependencies 18 | uses: actions/cache@v1 19 | with: 20 | path: ~/.m2 # maven cache files are stored in `~/.m2` on Linux/macOS 21 | key: ${{ runner.os }}-mvn-${{ hashFiles('**/pom.xml') }} 22 | restore-keys: | 23 | ${{ runner.os }}-build-${{ env.cache-name }}- 24 | ${{ runner.os }}-build- 25 | ${{ runner.os }}- 26 | - name: Build with Maven 27 | run: mvn -B package --file pom.xml 28 | - name: Build Docker Image 29 | if: success() 30 | run: | 31 | docker login docker.pkg.github.com -u alicanakkus -p ${{ secrets.TOKEN }} 32 | docker build -t docker.pkg.github.com/alicanakkus/docker-compose-initializr/dcomposerio:${GITHUB_SHA} . 33 | docker push docker.pkg.github.com/alicanakkus/docker-compose-initializr/dcomposerio:${GITHUB_SHA} -------------------------------------------------------------------------------- /.github/workflows/pull-request.yml: -------------------------------------------------------------------------------- 1 | name: Java CI 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v1 10 | - name: Set up JDK 1.11 11 | uses: actions/setup-java@v1 12 | with: 13 | java-version: 1.11 14 | - name: Cache maven dependencies 15 | uses: actions/cache@v1 16 | with: 17 | path: ~/.m2 # maven cache files are stored in `~/.m2` on Linux/macOS 18 | key: ${{ runner.os }}-mvn-${{ hashFiles('**/pom.xml') }} 19 | restore-keys: | 20 | ${{ runner.os }}-build-${{ env.cache-name }}- 21 | ${{ runner.os }}-build- 22 | ${{ runner.os }}- 23 | - name: Build with Maven 24 | run: mvn clean test install 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlicanAkkus/docker-compose-initializr/7455a4996fd07b697debd8d38b11d8b59277f078/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:11-jre-slim-sid 2 | LABEL maintainer=aakkus 3 | 4 | COPY target/docker-compose-initializr-0.0.1-SNAPSHOT.jar lib/docker-compose-initializr.jar 5 | 6 | ENTRYPOINT exec java -Djava.security.egd=file:/dev/./urandom $JAVA_OPTS -jar lib/docker-compose-initializr.jar -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year containerName of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker Compose Initializr ![](https://github.com/alicanakkus/docker-compose-initializr/workflows/Java%20CI/badge.svg) 2 | 3 | You can create your own docker compose. You can select a few official images or typing self-image for creating the **docker-compose.yml** file. After file created you can download and run it! It's just that. 4 | 5 | 6 | ## License 7 | Docker Compose Initializr is Open Source software released under the 8 | [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html) 9 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven2 Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | # TODO classpath? 118 | fi 119 | 120 | if [ -z "$JAVA_HOME" ]; then 121 | javaExecutable="`which javac`" 122 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 123 | # readlink(1) is not available as standard on Solaris 10. 124 | readLink=`which readlink` 125 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 126 | if $darwin ; then 127 | javaHome="`dirname \"$javaExecutable\"`" 128 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 129 | else 130 | javaExecutable="`readlink -f \"$javaExecutable\"`" 131 | fi 132 | javaHome="`dirname \"$javaExecutable\"`" 133 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 134 | JAVA_HOME="$javaHome" 135 | export JAVA_HOME 136 | fi 137 | fi 138 | fi 139 | 140 | if [ -z "$JAVACMD" ] ; then 141 | if [ -n "$JAVA_HOME" ] ; then 142 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 143 | # IBM's JDK on AIX uses strange locations for the executables 144 | JAVACMD="$JAVA_HOME/jre/sh/java" 145 | else 146 | JAVACMD="$JAVA_HOME/bin/java" 147 | fi 148 | else 149 | JAVACMD="`which java`" 150 | fi 151 | fi 152 | 153 | if [ ! -x "$JAVACMD" ] ; then 154 | echo "Error: JAVA_HOME is not defined correctly." >&2 155 | echo " We cannot execute $JAVACMD" >&2 156 | exit 1 157 | fi 158 | 159 | if [ -z "$JAVA_HOME" ] ; then 160 | echo "Warning: JAVA_HOME environment variable is not set." 161 | fi 162 | 163 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 164 | 165 | # traverses directory structure from process work directory to filesystem root 166 | # first directory with .mvn subdirectory is considered project base directory 167 | find_maven_basedir() { 168 | 169 | if [ -z "$1" ] 170 | then 171 | echo "Path not specified to find_maven_basedir" 172 | return 1 173 | fi 174 | 175 | basedir="$1" 176 | wdir="$1" 177 | while [ "$wdir" != '/' ] ; do 178 | if [ -d "$wdir"/.mvn ] ; then 179 | basedir=$wdir 180 | break 181 | fi 182 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 183 | if [ -d "${wdir}" ]; then 184 | wdir=`cd "$wdir/.."; pwd` 185 | fi 186 | # end of workaround 187 | done 188 | echo "${basedir}" 189 | } 190 | 191 | # concatenates all lines of a file 192 | concat_lines() { 193 | if [ -f "$1" ]; then 194 | echo "$(tr -s '\n' ' ' < "$1")" 195 | fi 196 | } 197 | 198 | BASE_DIR=`find_maven_basedir "$(pwd)"` 199 | if [ -z "$BASE_DIR" ]; then 200 | exit 1; 201 | fi 202 | 203 | ########################################################################################## 204 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 205 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 206 | ########################################################################################## 207 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 208 | if [ "$MVNW_VERBOSE" = true ]; then 209 | echo "Found .mvn/wrapper/maven-wrapper.jar" 210 | fi 211 | else 212 | if [ "$MVNW_VERBOSE" = true ]; then 213 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 214 | fi 215 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" 216 | while IFS="=" read key value; do 217 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 218 | esac 219 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 220 | if [ "$MVNW_VERBOSE" = true ]; then 221 | echo "Downloading from: $jarUrl" 222 | fi 223 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 224 | 225 | if command -v wget > /dev/null; then 226 | if [ "$MVNW_VERBOSE" = true ]; then 227 | echo "Found wget ... using wget" 228 | fi 229 | wget "$jarUrl" -O "$wrapperJarPath" 230 | elif command -v curl > /dev/null; then 231 | if [ "$MVNW_VERBOSE" = true ]; then 232 | echo "Found curl ... using curl" 233 | fi 234 | curl -o "$wrapperJarPath" "$jarUrl" 235 | else 236 | if [ "$MVNW_VERBOSE" = true ]; then 237 | echo "Falling back to using Java to download" 238 | fi 239 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 240 | if [ -e "$javaClass" ]; then 241 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 242 | if [ "$MVNW_VERBOSE" = true ]; then 243 | echo " - Compiling MavenWrapperDownloader.java ..." 244 | fi 245 | # Compiling the Java class 246 | ("$JAVA_HOME/bin/javac" "$javaClass") 247 | fi 248 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 249 | # Running the downloader 250 | if [ "$MVNW_VERBOSE" = true ]; then 251 | echo " - Running MavenWrapperDownloader.java ..." 252 | fi 253 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 254 | fi 255 | fi 256 | fi 257 | fi 258 | ########################################################################################## 259 | # End of extension 260 | ########################################################################################## 261 | 262 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 263 | if [ "$MVNW_VERBOSE" = true ]; then 264 | echo $MAVEN_PROJECTBASEDIR 265 | fi 266 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 267 | 268 | # For Cygwin, switch paths to Windows format before running java 269 | if $cygwin; then 270 | [ -n "$M2_HOME" ] && 271 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 272 | [ -n "$JAVA_HOME" ] && 273 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 274 | [ -n "$CLASSPATH" ] && 275 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 276 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 277 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 278 | fi 279 | 280 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 281 | 282 | exec "$JAVACMD" \ 283 | $MAVEN_OPTS \ 284 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 285 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 286 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 287 | -------------------------------------------------------------------------------- /mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" 124 | FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( 125 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 126 | ) 127 | 128 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 129 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 130 | if exist %WRAPPER_JAR% ( 131 | echo Found %WRAPPER_JAR% 132 | ) else ( 133 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 134 | echo Downloading from: %DOWNLOAD_URL% 135 | powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" 136 | echo Finished downloading %WRAPPER_JAR% 137 | ) 138 | @REM End of extension 139 | 140 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 141 | if ERRORLEVEL 1 goto error 142 | goto end 143 | 144 | :error 145 | set ERROR_CODE=1 146 | 147 | :end 148 | @endlocal & set ERROR_CODE=%ERROR_CODE% 149 | 150 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 151 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 152 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 153 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 154 | :skipRcPost 155 | 156 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 157 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 158 | 159 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 160 | 161 | exit /B %ERROR_CODE% 162 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.aakkus 7 | docker-compose-initializr 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | docker-compose-initializr 12 | docker-compose-initializr 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.1.0.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 11 25 | 2.10.1 26 | 2.6 27 | 2.22.1 28 | 1.3.2 29 | 30 | 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-web 35 | 36 | 37 | org.springframework.boot 38 | spring-boot-starter-aop 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-mail 43 | 44 | 45 | org.springframework.retry 46 | spring-retry 47 | 48 | 49 | com.fasterxml.jackson.dataformat 50 | jackson-dataformat-yaml 51 | ${jackson-dataformat-yaml.version} 52 | 53 | 54 | com.fasterxml.jackson.core 55 | jackson-databind 56 | ${jackson-dataformat-yaml.version} 57 | 58 | 59 | com.fasterxml.jackson.core 60 | jackson-core 61 | ${jackson-dataformat-yaml.version} 62 | 63 | 64 | commons-io 65 | commons-io 66 | ${commons-io.version} 67 | 68 | 69 | org.springframework.boot 70 | spring-boot-configuration-processor 71 | true 72 | 73 | 74 | org.projectlombok 75 | lombok 76 | true 77 | 78 | 79 | org.springframework.boot 80 | spring-boot-starter-test 81 | test 82 | 83 | 84 | org.springframework.boot 85 | spring-boot-devtools 86 | 87 | 88 | org.junit.jupiter 89 | junit-jupiter-api 90 | test 91 | 92 | 93 | org.junit.jupiter 94 | junit-jupiter-engine 95 | test 96 | 97 | 98 | 99 | 100 | 101 | 102 | org.springframework.boot 103 | spring-boot-maven-plugin 104 | 105 | 106 | org.apache.maven.plugins 107 | maven-surefire-plugin 108 | ${maven-surefire-plugin.version} 109 | 110 | 111 | org.junit.platform 112 | junit-platform-surefire-provider 113 | ${junit-platform-surefire-provider.version} 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | spring-milestones 123 | Spring Milestones 124 | https://repo.spring.io/milestone 125 | 126 | false 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /scripts/cleanup-branches.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | read -p "Are you ready to delete all local branches except master, and delete unused tracking branches from your local (y/n)?" CONT 4 | if [ "$CONT" = "y" ]; then 5 | git branch | grep -v master | xargs git branch -D 6 | git fetch origin --prune 7 | else 8 | echo "Skipped. See you next time."; 9 | fi 10 | 11 | -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/DockerComposeInitializrApplication.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.retry.annotation.EnableRetry; 6 | import org.springframework.scheduling.annotation.EnableAsync; 7 | 8 | @EnableAsync 9 | @EnableRetry 10 | @SpringBootApplication 11 | public class DockerComposeInitializrApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(DockerComposeInitializrApplication.class, args); 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/domain/DockerComposeFileFacade.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.domain; 2 | 3 | import com.aakkus.dockercomposeinitializr.domain.model.CreateDockerComposeFileCommand; 4 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeFile; 5 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeServiceDefinition; 6 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeVersionDefinition; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class DockerComposeFileFacade { 13 | 14 | private final DockerComposeFilePort dockerComposeFilePort; 15 | 16 | public DockerComposeFileFacade(DockerComposeFilePort dockerComposeFilePort) { 17 | this.dockerComposeFilePort = dockerComposeFilePort; 18 | } 19 | 20 | public DockerComposeFile create(CreateDockerComposeFileCommand createDockerComposeFileCommand) { 21 | return dockerComposeFilePort.create(createDockerComposeFileCommand); 22 | } 23 | 24 | public List retrieveVersions() { 25 | return dockerComposeFilePort.retrieveDockerComposeVersions(); 26 | } 27 | 28 | public List retrieveServices() { 29 | return dockerComposeFilePort.retrieveDockerComposeServices(); 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/domain/DockerComposeFilePort.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.domain; 2 | 3 | import com.aakkus.dockercomposeinitializr.domain.model.CreateDockerComposeFileCommand; 4 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeFile; 5 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeServiceDefinition; 6 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeVersionDefinition; 7 | 8 | import java.util.List; 9 | 10 | public interface DockerComposeFilePort { 11 | 12 | DockerComposeFile create(CreateDockerComposeFileCommand createDockerComposeFileCommand); 13 | 14 | List retrieveDockerComposeVersions(); 15 | 16 | List retrieveDockerComposeServices(); 17 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/domain/FeedbackFacade.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.domain; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service 6 | public class FeedbackFacade { 7 | 8 | private final FeedbackPort feedbackPort; 9 | 10 | public FeedbackFacade(FeedbackPort feedbackPort) { 11 | this.feedbackPort = feedbackPort; 12 | } 13 | 14 | public void sendFeedback(String feedback) { 15 | feedbackPort.send(feedback); 16 | } 17 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/domain/FeedbackPort.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.domain; 2 | 3 | public interface FeedbackPort { 4 | 5 | void send(String feedback); 6 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/domain/model/CreateDockerComposeFileCommand.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.domain.model; 2 | 3 | import java.util.List; 4 | 5 | public class CreateDockerComposeFileCommand { 6 | 7 | private String version; 8 | private List services; 9 | 10 | public CreateDockerComposeFileCommand() { 11 | } 12 | 13 | private CreateDockerComposeFileCommand(Builder builder) { 14 | this.version = builder.version; 15 | this.services = builder.services; 16 | } 17 | 18 | public static Builder builder() { 19 | return new Builder(); 20 | } 21 | 22 | public String getVersion() { 23 | return version; 24 | } 25 | 26 | public void setVersion(String version) { 27 | this.version = version; 28 | } 29 | 30 | public List getServices() { 31 | return services; 32 | } 33 | 34 | public void setServices(List services) { 35 | this.services = services; 36 | } 37 | 38 | public static final class Builder { 39 | private String version; 40 | private List services; 41 | 42 | private Builder() { 43 | } 44 | 45 | public CreateDockerComposeFileCommand build() { 46 | return new CreateDockerComposeFileCommand(this); 47 | } 48 | 49 | public Builder version(String version) { 50 | this.version = version; 51 | return this; 52 | } 53 | 54 | public Builder services(List services) { 55 | this.services = services; 56 | return this; 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/domain/model/DockerComposeFile.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.domain.model; 2 | 3 | import java.util.List; 4 | 5 | public class DockerComposeFile { 6 | 7 | private String version; 8 | private List services; 9 | private String composeFileContent; 10 | 11 | public DockerComposeFile() { 12 | } 13 | 14 | private DockerComposeFile(Builder builder) { 15 | this.version = builder.version; 16 | this.services = builder.services; 17 | this.composeFileContent = builder.composeFileContent; 18 | } 19 | 20 | public static Builder builder() { 21 | return new Builder(); 22 | } 23 | 24 | public String getVersion() { 25 | return version; 26 | } 27 | 28 | public void setVersion(String version) { 29 | this.version = version; 30 | } 31 | 32 | public List getServices() { 33 | return services; 34 | } 35 | 36 | public void setServices(List services) { 37 | this.services = services; 38 | } 39 | 40 | public String getComposeFileContent() { 41 | return composeFileContent; 42 | } 43 | 44 | public void setComposeFileContent(String composeFileContent) { 45 | this.composeFileContent = composeFileContent; 46 | } 47 | 48 | public static final class Builder { 49 | private String version; 50 | private List services; 51 | private String composeFileContent; 52 | 53 | private Builder() { 54 | } 55 | 56 | public DockerComposeFile build() { 57 | return new DockerComposeFile(this); 58 | } 59 | 60 | public Builder version(String version) { 61 | this.version = version; 62 | return this; 63 | } 64 | 65 | public Builder services(List services) { 66 | this.services = services; 67 | return this; 68 | } 69 | 70 | public Builder composeFileContent(String composeFileContent) { 71 | this.composeFileContent = composeFileContent; 72 | return this; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/domain/model/DockerComposeServiceDefinition.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.domain.model; 2 | 3 | import java.util.Map; 4 | 5 | public class DockerComposeServiceDefinition { 6 | 7 | private String name; 8 | private String command; 9 | private String image; 10 | private String restartCondition; 11 | private String[] ports; 12 | private Map environments = Map.of(); 13 | 14 | public String getName() { 15 | return name; 16 | } 17 | 18 | public void setName(String name) { 19 | this.name = name; 20 | } 21 | 22 | public String getCommand() { 23 | return command; 24 | } 25 | 26 | public void setCommand(String command) { 27 | this.command = command; 28 | } 29 | 30 | public String getImage() { 31 | return image; 32 | } 33 | 34 | public void setImage(String image) { 35 | this.image = image; 36 | } 37 | 38 | public String getRestartCondition() { 39 | return restartCondition; 40 | } 41 | 42 | public void setRestartCondition(String restartCondition) { 43 | this.restartCondition = restartCondition; 44 | } 45 | 46 | public String[] getPorts() { 47 | return ports; 48 | } 49 | 50 | public void setPorts(String[] ports) { 51 | this.ports = ports; 52 | } 53 | 54 | public Map getEnvironments() { 55 | return environments; 56 | } 57 | 58 | public void setEnvironments(Map environments) { 59 | this.environments = environments; 60 | } 61 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/domain/model/DockerComposeVersionDefinition.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.domain.model; 2 | 3 | public class DockerComposeVersionDefinition { 4 | 5 | private String name; 6 | private String version; 7 | 8 | public DockerComposeVersionDefinition() { 9 | } 10 | 11 | private DockerComposeVersionDefinition(Builder builder) { 12 | this.name = builder.name; 13 | this.version = builder.version; 14 | } 15 | 16 | public static Builder builder() { 17 | return new Builder(); 18 | } 19 | 20 | public String getName() { 21 | return name; 22 | } 23 | 24 | public void setName(String name) { 25 | this.name = name; 26 | } 27 | 28 | public String getVersion() { 29 | return version; 30 | } 31 | 32 | public void setVersion(String version) { 33 | this.version = version; 34 | } 35 | 36 | public static final class Builder { 37 | private String name; 38 | private String version; 39 | 40 | private Builder() { 41 | } 42 | 43 | public DockerComposeVersionDefinition build() { 44 | return new DockerComposeVersionDefinition(this); 45 | } 46 | 47 | public Builder name(String name) { 48 | this.name = name; 49 | return this; 50 | } 51 | 52 | public Builder version(String version) { 53 | this.version = version; 54 | return this; 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/infra/adapter/DockerComposeFileAdapter.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.infra.adapter; 2 | 3 | import com.aakkus.dockercomposeinitializr.domain.DockerComposeFilePort; 4 | import com.aakkus.dockercomposeinitializr.domain.model.CreateDockerComposeFileCommand; 5 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeFile; 6 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeServiceDefinition; 7 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeVersionDefinition; 8 | import com.aakkus.dockercomposeinitializr.infra.adapter.model.DockerComposeService; 9 | import com.aakkus.dockercomposeinitializr.infra.config.DockerComposeConfiguration; 10 | import com.fasterxml.jackson.annotation.JsonInclude; 11 | import com.fasterxml.jackson.databind.MapperFeature; 12 | import com.fasterxml.jackson.databind.ObjectMapper; 13 | import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; 14 | import org.slf4j.Logger; 15 | import org.slf4j.LoggerFactory; 16 | import org.springframework.beans.factory.annotation.Value; 17 | import org.springframework.stereotype.Service; 18 | 19 | import java.util.*; 20 | import java.util.function.Function; 21 | import java.util.stream.Collectors; 22 | 23 | @Service 24 | public class DockerComposeFileAdapter implements DockerComposeFilePort { 25 | 26 | private static final Logger logger = LoggerFactory.getLogger(DockerComposeFileAdapter.class); 27 | 28 | private final ObjectMapper objectMapper; 29 | private final DockerComposeConfiguration dockerComposeConfiguration; 30 | private final String containerNamePrefix; 31 | 32 | public DockerComposeFileAdapter(DockerComposeConfiguration dockerComposeConfiguration, @Value("${spring.application.name}") String containerNamePrefix) { 33 | this.objectMapper = new ObjectMapper(new YAMLFactory()); 34 | this.objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); 35 | this.objectMapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, false); 36 | this.dockerComposeConfiguration = dockerComposeConfiguration; 37 | this.containerNamePrefix = containerNamePrefix.concat("-"); 38 | } 39 | 40 | @Override 41 | public DockerComposeFile create(CreateDockerComposeFileCommand createDockerComposeFileCommand) { 42 | Map serviceMap = createServiceMap(createDockerComposeFileCommand); 43 | DockerComposeVersionDefinition versionDefinition = createServiceDefinition(createDockerComposeFileCommand); 44 | 45 | Map composeFileMap = Map.of("version", versionDefinition.getVersion(), "services", serviceMap); 46 | String composeFileContent = createDockerComposeFileContent(composeFileMap); 47 | 48 | logger.info("Docker compose file created successfully. Version: {} and Services: {}", versionDefinition.getVersion(), createDockerComposeFileCommand.getServices()); 49 | return DockerComposeFile.builder() 50 | .services(createDockerComposeFileCommand.getServices()) 51 | .version(versionDefinition.getVersion()) 52 | .composeFileContent(composeFileContent) 53 | .build(); 54 | } 55 | 56 | @Override 57 | public List retrieveDockerComposeVersions() { 58 | return dockerComposeConfiguration.getVersions(); 59 | } 60 | 61 | @Override 62 | public List retrieveDockerComposeServices() { 63 | return dockerComposeConfiguration.getServices() 64 | .stream() 65 | .sorted(Comparator.comparing(DockerComposeServiceDefinition::getName)) 66 | .collect(Collectors.toList()); 67 | } 68 | 69 | private Map createServiceMap(CreateDockerComposeFileCommand createDockerComposeFileCommand) { 70 | List dockerComposeServices = createDockerComposeFileCommand.getServices().stream() 71 | .map(service -> dockerComposeConfiguration.getServices().stream().filter(s -> service.equalsIgnoreCase(s.getName())).findFirst()) 72 | .map(this::convertToDockerComposeService) 73 | .filter(Objects::nonNull) 74 | .collect(Collectors.toList()); 75 | 76 | return dockerComposeServices 77 | .stream() 78 | .collect(Collectors.toMap(DockerComposeService::getServiceName, Function.identity())); 79 | } 80 | 81 | private DockerComposeVersionDefinition createServiceDefinition(CreateDockerComposeFileCommand createDockerComposeFileCommand) { 82 | return dockerComposeConfiguration.getVersions() 83 | .stream() 84 | .filter(service -> createDockerComposeFileCommand.getVersion().equalsIgnoreCase(service.getVersion())) 85 | .findAny() 86 | .orElse(dockerComposeConfiguration.getVersions().get(0)); 87 | } 88 | 89 | private String createDockerComposeFileContent(Map map) { 90 | try { 91 | return objectMapper.writeValueAsString(map).replaceFirst("---\\n",""); 92 | } catch (Exception e) { 93 | throw new RuntimeException(e); 94 | } 95 | } 96 | 97 | private DockerComposeService convertToDockerComposeService(Optional dockerComposeServiceDefinition) { 98 | return dockerComposeServiceDefinition 99 | .map(definition -> DockerComposeService.builder() 100 | .serviceName(definition.getName().replaceAll("/", "-")) 101 | .containerName(containerNamePrefix.concat(definition.getName().replaceAll("/", "-"))) 102 | .restart(definition.getRestartCondition()) 103 | .ports(definition.getPorts()) 104 | .image(definition.getImage()) 105 | .command(definition.getCommand()) 106 | .environment(definition.getEnvironments()) 107 | .build()) 108 | .orElse(null); 109 | } 110 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/infra/adapter/FeedbackAdapter.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.infra.adapter; 2 | 3 | import com.aakkus.dockercomposeinitializr.domain.FeedbackPort; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.boot.autoconfigure.mail.MailProperties; 7 | import org.springframework.mail.MailSender; 8 | import org.springframework.mail.SimpleMailMessage; 9 | import org.springframework.retry.annotation.Backoff; 10 | import org.springframework.retry.annotation.Recover; 11 | import org.springframework.retry.annotation.Retryable; 12 | import org.springframework.scheduling.annotation.Async; 13 | import org.springframework.stereotype.Service; 14 | 15 | @Service 16 | public class FeedbackAdapter implements FeedbackPort { 17 | 18 | private final static Logger logger = LoggerFactory.getLogger(FeedbackAdapter.class); 19 | 20 | private final MailSender mailSender; 21 | private final MailProperties mailProperties; 22 | 23 | public FeedbackAdapter(MailSender mailSender, MailProperties mailProperties) { 24 | this.mailSender = mailSender; 25 | this.mailProperties = mailProperties; 26 | } 27 | 28 | @Async 29 | @Override 30 | @Retryable(backoff = @Backoff(value = 3000L)) 31 | public void send(String feedback) { 32 | SimpleMailMessage simpleMailMessage = new SimpleMailMessage(); 33 | 34 | simpleMailMessage.setText(feedback); 35 | simpleMailMessage.setTo(retrieveMailProperty("to")); 36 | simpleMailMessage.setSubject(retrieveMailProperty("subject")); 37 | 38 | mailSender.send(simpleMailMessage); 39 | 40 | logger.info("Feedback sent: {}", simpleMailMessage); 41 | } 42 | 43 | @Recover 44 | private void feedbackSendRecover(Exception e, String feedback) { 45 | logger.error("An error occurred while sending feedback: {}, Exception: {}", feedback, e); 46 | } 47 | 48 | private String retrieveMailProperty(String property) { 49 | return mailProperties.getProperties().get(property); 50 | } 51 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/infra/adapter/model/DockerComposeService.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.infra.adapter.model; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | 6 | import java.util.Map; 7 | 8 | public class DockerComposeService { 9 | 10 | @JsonIgnore 11 | private String serviceName; 12 | 13 | @JsonProperty("container_name") 14 | private String containerName; 15 | private String image; 16 | private String command; 17 | private String restart; 18 | private String[] ports; 19 | private Map environment; 20 | 21 | public DockerComposeService() { 22 | } 23 | 24 | private DockerComposeService(Builder builder) { 25 | this.serviceName = builder.serviceName; 26 | this.containerName = builder.containerName; 27 | this.image = builder.image; 28 | this.command = builder.command; 29 | this.restart = builder.restart; 30 | this.ports = builder.ports; 31 | this.environment = builder.environment; 32 | } 33 | 34 | public static Builder builder() { 35 | return new Builder(); 36 | } 37 | 38 | public String getServiceName() { 39 | return serviceName; 40 | } 41 | 42 | public void setServiceName(String serviceName) { 43 | this.serviceName = serviceName; 44 | } 45 | 46 | public String getContainerName() { 47 | return containerName; 48 | } 49 | 50 | public void setContainerName(String containerName) { 51 | this.containerName = containerName; 52 | } 53 | 54 | public String getImage() { 55 | return image; 56 | } 57 | 58 | public void setImage(String image) { 59 | this.image = image; 60 | } 61 | 62 | public String getCommand() { 63 | return command; 64 | } 65 | 66 | public void setCommand(String command) { 67 | this.command = command; 68 | } 69 | 70 | public String getRestart() { 71 | return restart; 72 | } 73 | 74 | public void setRestart(String restart) { 75 | this.restart = restart; 76 | } 77 | 78 | public String[] getPorts() { 79 | return ports; 80 | } 81 | 82 | public void setPorts(String[] ports) { 83 | this.ports = ports; 84 | } 85 | 86 | public Map getEnvironment() { 87 | return environment; 88 | } 89 | 90 | public void setEnvironment(Map environment) { 91 | this.environment = environment; 92 | } 93 | 94 | public static final class Builder { 95 | private String serviceName; 96 | private String containerName; 97 | private String image; 98 | private String command; 99 | private String restart; 100 | private String[] ports; 101 | private Map environment; 102 | 103 | private Builder() { 104 | } 105 | 106 | public DockerComposeService build() { 107 | return new DockerComposeService(this); 108 | } 109 | 110 | public Builder serviceName(String serviceName) { 111 | this.serviceName = serviceName; 112 | return this; 113 | } 114 | 115 | public Builder containerName(String containerName) { 116 | this.containerName = containerName; 117 | return this; 118 | } 119 | 120 | public Builder image(String image) { 121 | this.image = image; 122 | return this; 123 | } 124 | 125 | 126 | public Builder command(String command) { 127 | this.command = command; 128 | return this; 129 | } 130 | 131 | public Builder restart(String restart) { 132 | this.restart = restart; 133 | return this; 134 | } 135 | 136 | public Builder ports(String[] ports) { 137 | this.ports = ports; 138 | return this; 139 | } 140 | 141 | public Builder environment(Map environment) { 142 | this.environment = environment; 143 | return this; 144 | } 145 | } 146 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/infra/config/DockerComposeConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.infra.config; 2 | 3 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeServiceDefinition; 4 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeVersionDefinition; 5 | import org.springframework.boot.context.properties.ConfigurationProperties; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | import java.util.List; 9 | 10 | @Configuration 11 | @ConfigurationProperties(prefix = "docker.compose") 12 | public class DockerComposeConfiguration { 13 | 14 | private List versions; 15 | private List services; 16 | 17 | public List getVersions() { 18 | return versions; 19 | } 20 | 21 | public void setVersions(List versions) { 22 | this.versions = versions; 23 | } 24 | 25 | public List getServices() { 26 | return services; 27 | } 28 | 29 | public void setServices(List services) { 30 | this.services = services; 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/infra/rest/DockerComposeRestController.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.infra.rest; 2 | 3 | import com.aakkus.dockercomposeinitializr.domain.DockerComposeFileFacade; 4 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeFile; 5 | import com.aakkus.dockercomposeinitializr.infra.rest.model.DockerComposeServiceDefinitionModel; 6 | import com.aakkus.dockercomposeinitializr.infra.rest.model.DockerComposeVersionDefinitionModel; 7 | import com.aakkus.dockercomposeinitializr.infra.rest.request.CreateDockerComposeFileRequest; 8 | import com.aakkus.dockercomposeinitializr.infra.rest.response.DockerComposeResponse; 9 | import org.springframework.http.ResponseEntity; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | import java.util.List; 13 | import java.util.stream.Collectors; 14 | 15 | @RestController 16 | @RequestMapping("/api/v1/docker-compose") 17 | public class DockerComposeRestController { 18 | 19 | private final DockerComposeFileFacade dockerComposeFileFacade; 20 | 21 | public DockerComposeRestController(DockerComposeFileFacade dockerComposeFileFacade) { 22 | this.dockerComposeFileFacade = dockerComposeFileFacade; 23 | } 24 | 25 | @GetMapping 26 | public ResponseEntity retrieveDockerComposeMetadata() { 27 | List versions = dockerComposeFileFacade.retrieveVersions() 28 | .stream() 29 | .map(DockerComposeVersionDefinitionModel::toModel) 30 | .collect(Collectors.toList()); 31 | 32 | List services = dockerComposeFileFacade.retrieveServices() 33 | .stream() 34 | .map(DockerComposeServiceDefinitionModel::toModel) 35 | .collect(Collectors.toList()); 36 | 37 | return ResponseEntity.ok(new DockerComposeResponse(versions, services)); 38 | } 39 | 40 | @PostMapping 41 | public ResponseEntity createDockerComposeFile(@RequestBody CreateDockerComposeFileRequest createDockerComposeFileRequest) { 42 | DockerComposeFile dockerComposeFile = dockerComposeFileFacade.create(createDockerComposeFileRequest.toCommand()); 43 | return ResponseEntity.ok(dockerComposeFile); 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/infra/rest/FeedbackController.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.infra.rest; 2 | 3 | import com.aakkus.dockercomposeinitializr.domain.FeedbackFacade; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | @RestController 11 | @RequestMapping("/api/v1/feedback") 12 | public class FeedbackController { 13 | 14 | private final FeedbackFacade feedbackFacade; 15 | 16 | public FeedbackController(FeedbackFacade feedbackFacade) { 17 | this.feedbackFacade = feedbackFacade; 18 | } 19 | 20 | @PostMapping 21 | public ResponseEntity sendFeedback(@RequestBody String feedback) { 22 | feedbackFacade.sendFeedback(feedback); 23 | return ResponseEntity.ok().build(); 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/infra/rest/model/DockerComposeServiceDefinitionModel.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.infra.rest.model; 2 | 3 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeServiceDefinition; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | 6 | public class DockerComposeServiceDefinitionModel { 7 | 8 | @JsonProperty("value") 9 | private String name; 10 | 11 | public DockerComposeServiceDefinitionModel() { 12 | } 13 | 14 | private DockerComposeServiceDefinitionModel(String name) { 15 | this.name = name; 16 | } 17 | 18 | public static DockerComposeServiceDefinitionModel toModel(DockerComposeServiceDefinition definition) { 19 | return new DockerComposeServiceDefinitionModel(definition.getName()); 20 | } 21 | 22 | public String getName() { 23 | return name; 24 | } 25 | 26 | public void setName(String name) { 27 | this.name = name; 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/infra/rest/model/DockerComposeVersionDefinitionModel.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.infra.rest.model; 2 | 3 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeVersionDefinition; 4 | 5 | public class DockerComposeVersionDefinitionModel { 6 | 7 | private String name; 8 | private String version; 9 | 10 | public DockerComposeVersionDefinitionModel() { 11 | } 12 | 13 | private DockerComposeVersionDefinitionModel(String name, String version) { 14 | this.name = name; 15 | this.version = version; 16 | } 17 | 18 | public String getName() { 19 | return name; 20 | } 21 | 22 | public void setName(String name) { 23 | this.name = name; 24 | } 25 | 26 | public String getVersion() { 27 | return version; 28 | } 29 | 30 | public void setVersion(String version) { 31 | this.version = version; 32 | } 33 | 34 | public static DockerComposeVersionDefinitionModel toModel(DockerComposeVersionDefinition definition) { 35 | return new DockerComposeVersionDefinitionModel(definition.getName(), definition.getVersion()); 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/infra/rest/request/CreateDockerComposeFileRequest.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.infra.rest.request; 2 | 3 | import com.aakkus.dockercomposeinitializr.domain.model.CreateDockerComposeFileCommand; 4 | 5 | import java.util.List; 6 | 7 | public class CreateDockerComposeFileRequest { 8 | 9 | private String version; 10 | private List services; 11 | 12 | public String getVersion() { 13 | return version; 14 | } 15 | 16 | public void setVersion(String version) { 17 | this.version = version; 18 | } 19 | 20 | public List getServices() { 21 | return services; 22 | } 23 | 24 | public void setServices(List services) { 25 | this.services = services; 26 | } 27 | 28 | public CreateDockerComposeFileCommand toCommand() { 29 | return CreateDockerComposeFileCommand.builder() 30 | .services(services) 31 | .version(version) 32 | .build(); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/com/aakkus/dockercomposeinitializr/infra/rest/response/DockerComposeResponse.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.infra.rest.response; 2 | 3 | import com.aakkus.dockercomposeinitializr.infra.rest.model.DockerComposeServiceDefinitionModel; 4 | import com.aakkus.dockercomposeinitializr.infra.rest.model.DockerComposeVersionDefinitionModel; 5 | 6 | import java.util.List; 7 | 8 | public class DockerComposeResponse { 9 | 10 | private List versions; 11 | private List services; 12 | 13 | public DockerComposeResponse() { 14 | } 15 | 16 | public DockerComposeResponse(List versions, List services) { 17 | this.versions = versions; 18 | this.services = services; 19 | } 20 | 21 | public List getVersions() { 22 | return versions; 23 | } 24 | 25 | public void setVersions(List versions) { 26 | this.versions = versions; 27 | } 28 | 29 | public List getServices() { 30 | return services; 31 | } 32 | 33 | public void setServices(List services) { 34 | this.services = services; 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: docker-compose-initializr 4 | mail: 5 | host: smtp.gmail.com 6 | port: 587 7 | username: ${mail-username} 8 | password: ${mail-password} 9 | protocol: smtp 10 | defaultEncoding: UTF-8 11 | properties: 12 | subject: ${mail-subject} 13 | to: ${mail-to} 14 | mail.smtp.auth: true 15 | mail.smtp.starttls.enable: true 16 | mail.smtp.starttls.required: true 17 | 18 | docker: 19 | compose: 20 | versions: 21 | - 22 | version: '3.0' 23 | name: 'Version 3.0 for Docker 1.13.0+' 24 | - 25 | version: '3.1' 26 | name: 'Version 3.1 for Docker 1.13.1+' 27 | - 28 | version: '3.5' 29 | name: 'Version 3.5 for Docker 17.12.0+' 30 | - 31 | version: '3.6' 32 | name: 'Version 3.6 for Docker 18.02.0+' 33 | - 34 | version: '3.7' 35 | name: 'Version 3.7 for Docker 18.06.0+' 36 | services: 37 | - 38 | name: 'redis' 39 | image: 'redis:latest' 40 | restartCondition: 'on-failure' 41 | ports: 42 | - '6379:6379' 43 | - 44 | name: 'mongo' 45 | image: 'mongo:latest' 46 | restartCondition: 'on-failure' 47 | ports: 48 | - '27017:27017' 49 | environments: 50 | MONGO_INITDB_ROOT_USERNAME: root 51 | MONGO_INITDB_ROOT_PASSWORD: password 52 | - 53 | name: 'confluent/kafka' 54 | image: 'confluent/kafka:latest' 55 | restartCondition: 'on-failure' 56 | ports: 57 | - '9092:9092' 58 | environments: 59 | KAFKA_BROKER_ID: 1 60 | KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 61 | KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 62 | KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 63 | KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0 64 | KAFKA_AUTO_CREATE_TOPICS_ENABLE: true 65 | - 66 | name: 'postgres' 67 | image: 'postgres:latest' 68 | restartCondition: 'on-failure' 69 | ports: 70 | - '5432:5432' 71 | environments: 72 | POSTGRES_PASSWORD: password 73 | - 74 | name: 'nginx' 75 | image: 'nginx:latest' 76 | restartCondition: 'on-failure' 77 | ports: 78 | - '8080:80' 79 | environments: 80 | NGINX_PORT: 80 81 | - 82 | name: 'mysql' 83 | command: --default-authentication-plugin=mysql_native_password 84 | image: 'mysql:latest' 85 | restartCondition: 'on-failure' 86 | ports: 87 | - '3306:3306' 88 | environments: 89 | MYSQL_ROOT_PASSWORD: password 90 | - 91 | name: 'mariadb' 92 | image: 'mariadb:latest' 93 | restartCondition: 'on-failure' 94 | ports: 95 | - '3306:3306' 96 | environments: 97 | MYSQL_ROOT_PASSWORD: password 98 | - 99 | name: 'memcached' 100 | image: 'memcached:latest' 101 | restartCondition: 'on-failure' 102 | ports: 103 | - '11211:11211' 104 | - 105 | name: 'registry' 106 | image: 'registry:latest' 107 | restartCondition: 'on-failure' 108 | ports: 109 | - '5000:5000' 110 | - 111 | name: 'rabbitmq' 112 | image: 'rabbitmq:latest' 113 | restartCondition: 'on-failure' 114 | ports: 115 | - '5672:5672' 116 | environments: 117 | RABBITMQ_DEFAULT_USER: user 118 | RABBITMQ_DEFAULT_PASS: password 119 | - 120 | name: 'rabbitmq management' 121 | image: 'rabbitmq:3-management' 122 | restartCondition: 'on-failure' 123 | ports: 124 | - '8080:15672' 125 | - 126 | name: 'wordpress' 127 | image: 'wordpress:latest' 128 | restartCondition: 'on-failure' 129 | ports: 130 | - '8080:80' 131 | environments: 132 | WORDPRESS_DB_HOST: db 133 | WORDPRESS_DB_USER: user 134 | WORDPRESS_DB_PASSWORD: password 135 | WORDPRESS_DB_NAME: name 136 | - 137 | name: 'elasticsearch' 138 | image: 'elasticsearch:6.5.1' 139 | restartCondition: 'on-failure' 140 | ports: 141 | - '9200:9200' 142 | - '9300:9300' 143 | environments: 144 | DISCOVERY_TYPE: single-node 145 | - 146 | name: 'influxdb' 147 | image: 'influxdb:latest' 148 | restartCondition: 'on-failure' 149 | ports: 150 | - '8086:8086' 151 | - 152 | name: 'tomcat' 153 | image: 'tomcat:latest' 154 | restartCondition: 'on-failure' 155 | ports: 156 | - '8888:8080' 157 | - 158 | name: 'jenkins' 159 | image: 'jenkins:latest' 160 | restartCondition: 'on-failure' 161 | ports: 162 | - '8080:8080' 163 | - '50000:50000' 164 | - 165 | name: 'ghost' 166 | image: 'ghost:latest' 167 | restartCondition: 'on-failure' 168 | ports: 169 | - '2368:2368' 170 | - 171 | name: 'kibana' 172 | image: 'kibana:latest' 173 | restartCondition: 'on-failure' 174 | ports: 175 | - '5601:5601' 176 | - 177 | name: 'drupal' 178 | image: 'drupal:latest' 179 | restartCondition: 'on-failure' 180 | ports: 181 | - '8080:80' 182 | - 183 | name: 'cassandra' 184 | image: 'cassandra:latest' 185 | restartCondition: 'on-failure' 186 | ports: 187 | - '7000:7000' 188 | - '7001:7001' 189 | - '7199:7199' 190 | - '9042:9042' 191 | - '9160:9160' 192 | - 193 | name: 'sonarqube' 194 | image: 'sonarqube:latest' 195 | restartCondition: 'on-failure' 196 | ports: 197 | - '9000:9000' 198 | - '9092:9092' 199 | - '7199:7199' 200 | - '9042:9042' 201 | - '9160:9160' 202 | environments: 203 | SONARQUBE_JDBC_USERNAME: sonar 204 | SONARQUBE_JDBC_PASSWORD: sonar 205 | SONARQUBE_JDBC_URL: jdbc:postgresql://localhost/sonar 206 | - 207 | name: 'vault' 208 | image: 'vault:latest' 209 | restartCondition: 'on-failure' 210 | ports: 211 | - '8200:8200' 212 | environments: 213 | VAULT_ADDR: http://127.0.0.1:8200 214 | - 215 | name: 'neo4j' 216 | image: 'neo4j:latest' 217 | restartCondition: 'on-failure' 218 | ports: 219 | - '7474:7474' 220 | - '7687:7687' 221 | - 222 | name: 'owncloud' 223 | image: 'owncloud:latest' 224 | restartCondition: 'on-failure' 225 | ports: 226 | - '80:80' 227 | - 228 | name: 'solr' 229 | image: 'solr:latest' 230 | restartCondition: 'on-failure' 231 | ports: 232 | - '8983:8983' 233 | - 234 | name: 'rethinkdb' 235 | image: 'rethinkdb:latest' 236 | restartCondition: 'on-failure' 237 | ports: 238 | - '28015:28015' 239 | - '29015:29015' 240 | - '8080:8080' 241 | - 242 | name: 'chronograf' 243 | image: 'chronograf:latest' 244 | restartCondition: 'on-failure' 245 | ports: 246 | - '8888:8888' 247 | - 248 | name: 'zookeeper' 249 | image: 'zookeeper:latest' 250 | restartCondition: 'on-failure' 251 | ports: 252 | - '2181:2181' 253 | - '2888:2888' 254 | - '3888:3888' 255 | environments: 256 | ZOOKEEPER_CLIENT_PORT: 2181 257 | ZOOKEEPER_TICK_TIME: 2000 258 | - 259 | name: 'couchdb' 260 | image: 'couchdb:latest' 261 | restartCondition: 'on-failure' 262 | ports: 263 | - '5984:5984' 264 | - 265 | name: 'joomla' 266 | image: 'joomla:latest' 267 | restartCondition: 'on-failure' 268 | ports: 269 | - '8080:80' 270 | environments: 271 | JOOMLA_DB_HOST: joomladb 272 | JOOMLA_DB_PASSWORD: password 273 | - 274 | name: 'adminer' 275 | image: 'adminer:latest' 276 | restartCondition: 'on-failure' 277 | ports: 278 | - '8080:8080' 279 | - 280 | name: 'jetty' 281 | image: 'jetty:latest' 282 | restartCondition: 'on-failure' 283 | ports: 284 | - '8080:8080' 285 | - '8443:8443' 286 | - 287 | name: 'redmine' 288 | image: 'redmine:latest' 289 | restartCondition: 'on-failure' 290 | ports: 291 | - '8080:3000' 292 | - 293 | name: 'couchbase' 294 | image: 'couchbase:latest' 295 | restartCondition: 'on-failure' 296 | ports: 297 | - '8091-8094:8091-8094' 298 | - '11210:11210' 299 | - 300 | name: 'kapacitor' 301 | image: 'kapacitor:latest' 302 | restartCondition: 'on-failure' 303 | ports: 304 | - '9092:9092' 305 | - 306 | name: 'crate' 307 | image: 'crate:latest' 308 | restartCondition: 'on-failure' 309 | ports: 310 | - '4200:4200' 311 | - 312 | name: 'odoo' 313 | image: 'odoo:latest' 314 | restartCondition: 'on-failure' 315 | ports: 316 | - '8069:8069' 317 | environments: 318 | HOST: odoodb 319 | USER: odoo 320 | PASSWORD: password 321 | - 322 | name: 'arangodb' 323 | image: 'arangodb:latest' 324 | restartCondition: 'on-failure' 325 | ports: 326 | - '8529:8529' 327 | - 328 | name: 'nextcloud' 329 | image: 'nextcloud:latest' 330 | restartCondition: 'on-failure' 331 | ports: 332 | - '8080:80' 333 | - 334 | name: 'kong' 335 | image: 'kong:latest' 336 | restartCondition: 'on-failure' 337 | ports: 338 | - '8000:8000' 339 | - '8443:8443' 340 | - '8001:8001' 341 | - '8444:8444' 342 | environments: 343 | KONG_DATABASE: cassandra 344 | KONG_CASSANDRA_CONTACT_POINTS: kong-database 345 | KONG_PROXY_ACCESS_LOG: /dev/stdout 346 | KONG_ADMIN_ACCESS_LOG: /dev/stdout 347 | KONG_PROXY_ERROR_LOG: /dev/stderr 348 | KONG_ADMIN_ERROR_LOG: /dev/stderr 349 | KONG_ADMIN_LISTEN: 0.0.0.0:8001 350 | KONG_ADMIN_LISTEN_SSL: 0.0.0.0:8444 351 | - 352 | name: 'hazelcast' 353 | image: 'hazelcast/hazelcast:latest' 354 | restartCondition: 'on-failure' 355 | ports: 356 | - '5701:5701' 357 | environments: 358 | JAVA_OPTS: '-Dhazelcast.local.publicAddress=CHANGE_THIS_WITH_HOST_IP:5701' 359 | - 360 | name: 'hazelcast-management-center' 361 | image: 'hazelcast/management-center:latest' 362 | restartCondition: 'on-failure' 363 | ports: 364 | - '8080:8080' 365 | -------------------------------------------------------------------------------- /src/main/resources/static/css/app.css: -------------------------------------------------------------------------------- 1 | @import url("//unpkg.com/element-ui@2.4.11/lib/theme-chalk/index.css"); 2 | .el-header, .el-footer { 3 | background-color: #B3C0D1; 4 | color: #333; 5 | text-align: center; 6 | line-height: 60px; 7 | } 8 | 9 | .el-aside { 10 | background-color: #D3DCE6; 11 | color: #333; 12 | text-align: center; 13 | line-height: 200px; 14 | } 15 | 16 | .el-main { 17 | background-color: #E9EEF3; 18 | color: #333; 19 | text-align: center; 20 | line-height: 160px; 21 | } 22 | 23 | body > .el-container { 24 | margin-bottom: 40px; 25 | } 26 | 27 | .el-container:nth-child(5) .el-aside, 28 | .el-container:nth-child(6) .el-aside { 29 | line-height: 260px; 30 | } 31 | 32 | .el-container:nth-child(7) .el-aside { 33 | line-height: 320px; 34 | } 35 | 36 | .navbar-nav.navbar-center { 37 | position: absolute; 38 | left: 50%; 39 | transform: translatex(-50%); 40 | } 41 | 42 | .footer { 43 | position: absolute; 44 | bottom: 0; 45 | width: 100%; 46 | /* Set the fixed height of the footer here */ 47 | height: 60px; 48 | line-height: 60px; /* Vertically center the text there */ 49 | background-color: #f5f5f5; 50 | } 51 | 52 | .footer > .container { 53 | padding-right: 15px; 54 | padding-left: 15px; 55 | } 56 | 57 | [v-cloak] { display: none; } -------------------------------------------------------------------------------- /src/main/resources/static/css/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlicanAkkus/docker-compose-initializr/7455a4996fd07b697debd8d38b11d8b59277f078/src/main/resources/static/css/fonts/element-icons.ttf -------------------------------------------------------------------------------- /src/main/resources/static/css/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlicanAkkus/docker-compose-initializr/7455a4996fd07b697debd8d38b11d8b59277f078/src/main/resources/static/css/fonts/element-icons.woff -------------------------------------------------------------------------------- /src/main/resources/static/images/docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlicanAkkus/docker-compose-initializr/7455a4996fd07b697debd8d38b11d8b59277f078/src/main/resources/static/images/docker.png -------------------------------------------------------------------------------- /src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 43 | 44 | Docker Compose Initializr 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
61 | 80 | 81 |
82 | 83 |
84 |
85 | 86 |
87 |
88 |
89 |
90 | Add docker services to your infrastructure 91 |
92 |
93 |
94 |
95 |
96 | 97 |
98 |
99 | 100 |
101 |
102 | 103 |
104 |
105 |
106 |
107 | 108 | 113 | 114 | 115 |
116 |
117 | 121 | 122 | 123 |
124 |
125 | 127 | Generate 128 | 129 |
130 |
131 |
132 |
133 | 134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 | 143 | Selected Services 144 | 145 | 147 | {{service}} 148 | 149 |
150 |
151 |
152 |
153 |
154 |
155 | 162 |
163 | 164 | 165 | -------------------------------------------------------------------------------- /src/main/resources/static/js/app.js: -------------------------------------------------------------------------------- 1 | window.onload = function (ev) { 2 | new Vue({ 3 | el: "#app", 4 | data: { 5 | feedback: '', 6 | serviceInput: '', 7 | createProgressDoesItContinue: false, 8 | selectedServices: [], 9 | version: '', 10 | versions: [], 11 | defaultServices: [] 12 | }, 13 | mounted: function(){ 14 | this.$http.get("/api/v1/docker-compose") 15 | .then(function(response){ 16 | this.versions = response.data.versions; 17 | this.defaultServices = response.data.services; 18 | }, function (error) { 19 | console.error("An error occurred while fetching versions! Error: ", error); 20 | }).bind(this); 21 | }, 22 | methods: { 23 | deleteService: function (service) { 24 | this.selectedServices.splice(this.selectedServices.indexOf(service), 1); 25 | }, 26 | showNotification: function (title, message, type, position) { 27 | this.$notify({ 28 | title: title, 29 | message: message, 30 | type: type, 31 | position: position 32 | }); 33 | }, 34 | download: function (response) { 35 | var blob = new Blob([response.data.composeFileContent]); 36 | var link = document.createElement('a'); 37 | link.href = window.URL.createObjectURL(blob); 38 | link.download = "docker-compose.yml"; 39 | link.click(); 40 | }, 41 | createDockerComposeFile: function () { 42 | if(this.checkVersionIsSelectedAndLeastOneServiceSelected()){ 43 | this.createProgressDoesItContinue = true; 44 | this.$http.post('/api/v1/docker-compose', { version: this.version, services: this.selectedServices }) 45 | .then(function (response) { 46 | this.download(response); 47 | this.showNotification('Success', 'docker-compose.yml file successfully created :)', 'success', 'top-right'); 48 | 49 | this.selectedServices = []; 50 | this.version = ''; 51 | this.createProgressDoesItContinue = false; 52 | 53 | gtag('event', 'docker-compose-generate', { version: this.version, services: this.selectedServices }); 54 | }, function (error) { 55 | console.error(error); 56 | this.createProgressDoesItContinue = false; 57 | }).bind(this); 58 | } 59 | }, 60 | sendFeedback: function(){ 61 | if(this.feedback !== ''){ 62 | this.$http.post('/api/v1/feedback', this.feedback) 63 | .then(function (response){ 64 | this.feedback = ''; 65 | this.showNotification('Success', 'Feedback successfully send, thank you :)', 'success', 'top-right'); 66 | }, function (error) { 67 | console.error(error); 68 | this.feedback = ''; 69 | }).bind(this); 70 | }else{ 71 | this.showWarning("Please type somethings :)", 'info'); 72 | } 73 | }, 74 | querySearch: function (queryString, cb) { 75 | var results = queryString ? this.defaultServices.filter(this.createFilter(queryString)) : this.defaultServices; 76 | // call callback function to return suggestions 77 | cb(results); 78 | }, 79 | createFilter: function (queryString) { 80 | return (service) => { 81 | return (service.value.toLowerCase().includes(queryString.toLowerCase()) > 0); 82 | } 83 | }, 84 | handleSelect: function (service) { 85 | this.serviceInput = ''; 86 | if (!this.selectedServices.includes(service.value)){ 87 | this.selectedServices.push(service.value); 88 | } 89 | }, 90 | showWarning: function (message, type) { 91 | this.$message({ 92 | message: message, 93 | type: type 94 | }); 95 | }, 96 | checkVersionIsSelectedAndLeastOneServiceSelected: function () { 97 | if(this.version === ''){ 98 | this.showWarning('Please select docker compose version', 'warning'); 99 | return false; 100 | } 101 | 102 | if(this.selectedServices.length === 0){ 103 | this.showWarning('Please select least one service', 'warning'); 104 | return false; 105 | } 106 | 107 | return true; 108 | } 109 | } 110 | }); 111 | }; -------------------------------------------------------------------------------- /src/main/resources/static/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v4.0.0 (https://getbootstrap.com) 3 | * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e(t.bootstrap={},t.jQuery,t.Popper)}(this,function(t,e,n){"use strict";function i(t,e){for(var n=0;n0?i:null}catch(t){return null}},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(n){t(n).trigger(e.end)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s)){var r=n[s],o=e[s],a=o&&i.isElement(o)?"element":(l=o,{}.toString.call(l).match(/\s([a-zA-Z]+)/)[1].toLowerCase());if(!new RegExp(r).test(a))throw new Error(t.toUpperCase()+': Option "'+s+'" provided type "'+a+'" but expected type "'+r+'".')}var l}};return e=("undefined"==typeof window||!window.QUnit)&&{end:"transitionend"},t.fn.emulateTransitionEnd=n,i.supportsTransitionEnd()&&(t.event.special[i.TRANSITION_END]={bindType:e.end,delegateType:e.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}),i}(e),L=(a="alert",h="."+(l="bs.alert"),c=(o=e).fn[a],u={CLOSE:"close"+h,CLOSED:"closed"+h,CLICK_DATA_API:"click"+h+".data-api"},f="alert",d="fade",_="show",g=function(){function t(t){this._element=t}var e=t.prototype;return e.close=function(t){t=t||this._element;var e=this._getRootElement(t);this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.dispose=function(){o.removeData(this._element,l),this._element=null},e._getRootElement=function(t){var e=P.getSelectorFromElement(t),n=!1;return e&&(n=o(e)[0]),n||(n=o(t).closest("."+f)[0]),n},e._triggerCloseEvent=function(t){var e=o.Event(u.CLOSE);return o(t).trigger(e),e},e._removeElement=function(t){var e=this;o(t).removeClass(_),P.supportsTransitionEnd()&&o(t).hasClass(d)?o(t).one(P.TRANSITION_END,function(n){return e._destroyElement(t,n)}).emulateTransitionEnd(150):this._destroyElement(t)},e._destroyElement=function(t){o(t).detach().trigger(u.CLOSED).remove()},t._jQueryInterface=function(e){return this.each(function(){var n=o(this),i=n.data(l);i||(i=new t(this),n.data(l,i)),"close"===e&&i[e](this)})},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},s(t,null,[{key:"VERSION",get:function(){return"4.0.0"}}]),t}(),o(document).on(u.CLICK_DATA_API,'[data-dismiss="alert"]',g._handleDismiss(new g)),o.fn[a]=g._jQueryInterface,o.fn[a].Constructor=g,o.fn[a].noConflict=function(){return o.fn[a]=c,g._jQueryInterface},g),R=(m="button",E="."+(v="bs.button"),T=".data-api",y=(p=e).fn[m],C="active",I="btn",A="focus",b='[data-toggle^="button"]',D='[data-toggle="buttons"]',S="input",w=".active",N=".btn",O={CLICK_DATA_API:"click"+E+T,FOCUS_BLUR_DATA_API:"focus"+E+T+" blur"+E+T},k=function(){function t(t){this._element=t}var e=t.prototype;return e.toggle=function(){var t=!0,e=!0,n=p(this._element).closest(D)[0];if(n){var i=p(this._element).find(S)[0];if(i){if("radio"===i.type)if(i.checked&&p(this._element).hasClass(C))t=!1;else{var s=p(n).find(w)[0];s&&p(s).removeClass(C)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!p(this._element).hasClass(C),p(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!p(this._element).hasClass(C)),t&&p(this._element).toggleClass(C)},e.dispose=function(){p.removeData(this._element,v),this._element=null},t._jQueryInterface=function(e){return this.each(function(){var n=p(this).data(v);n||(n=new t(this),p(this).data(v,n)),"toggle"===e&&n[e]()})},s(t,null,[{key:"VERSION",get:function(){return"4.0.0"}}]),t}(),p(document).on(O.CLICK_DATA_API,b,function(t){t.preventDefault();var e=t.target;p(e).hasClass(I)||(e=p(e).closest(N)),k._jQueryInterface.call(p(e),"toggle")}).on(O.FOCUS_BLUR_DATA_API,b,function(t){var e=p(t.target).closest(N)[0];p(e).toggleClass(A,/^focus(in)?$/.test(t.type))}),p.fn[m]=k._jQueryInterface,p.fn[m].Constructor=k,p.fn[m].noConflict=function(){return p.fn[m]=y,k._jQueryInterface},k),j=function(t){var e="carousel",n="bs.carousel",i="."+n,o=t.fn[e],a={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0},l={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean"},h="next",c="prev",u="left",f="right",d={SLIDE:"slide"+i,SLID:"slid"+i,KEYDOWN:"keydown"+i,MOUSEENTER:"mouseenter"+i,MOUSELEAVE:"mouseleave"+i,TOUCHEND:"touchend"+i,LOAD_DATA_API:"load"+i+".data-api",CLICK_DATA_API:"click"+i+".data-api"},_="carousel",g="active",p="slide",m="carousel-item-right",v="carousel-item-left",E="carousel-item-next",T="carousel-item-prev",y={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},C=function(){function o(e,n){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this._config=this._getConfig(n),this._element=t(e)[0],this._indicatorsElement=t(this._element).find(y.INDICATORS)[0],this._addEventListeners()}var C=o.prototype;return C.next=function(){this._isSliding||this._slide(h)},C.nextWhenVisible=function(){!document.hidden&&t(this._element).is(":visible")&&"hidden"!==t(this._element).css("visibility")&&this.next()},C.prev=function(){this._isSliding||this._slide(c)},C.pause=function(e){e||(this._isPaused=!0),t(this._element).find(y.NEXT_PREV)[0]&&P.supportsTransitionEnd()&&(P.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},C.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},C.to=function(e){var n=this;this._activeElement=t(this._element).find(y.ACTIVE_ITEM)[0];var i=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0))if(this._isSliding)t(this._element).one(d.SLID,function(){return n.to(e)});else{if(i===e)return this.pause(),void this.cycle();var s=e>i?h:c;this._slide(s,this._items[e])}},C.dispose=function(){t(this._element).off(i),t.removeData(this._element,n),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},C._getConfig=function(t){return t=r({},a,t),P.typeCheckConfig(e,t,l),t},C._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(d.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&(t(this._element).on(d.MOUSEENTER,function(t){return e.pause(t)}).on(d.MOUSELEAVE,function(t){return e.cycle(t)}),"ontouchstart"in document.documentElement&&t(this._element).on(d.TOUCHEND,function(){e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout(function(t){return e.cycle(t)},500+e._config.interval)}))},C._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},C._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(y.ITEM)),this._items.indexOf(e)},C._getItemByDirection=function(t,e){var n=t===h,i=t===c,s=this._getItemIndex(e),r=this._items.length-1;if((i&&0===s||n&&s===r)&&!this._config.wrap)return e;var o=(s+(t===c?-1:1))%this._items.length;return-1===o?this._items[this._items.length-1]:this._items[o]},C._triggerSlideEvent=function(e,n){var i=this._getItemIndex(e),s=this._getItemIndex(t(this._element).find(y.ACTIVE_ITEM)[0]),r=t.Event(d.SLIDE,{relatedTarget:e,direction:n,from:s,to:i});return t(this._element).trigger(r),r},C._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(y.ACTIVE).removeClass(g);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(g)}},C._slide=function(e,n){var i,s,r,o=this,a=t(this._element).find(y.ACTIVE_ITEM)[0],l=this._getItemIndex(a),c=n||a&&this._getItemByDirection(e,a),_=this._getItemIndex(c),C=Boolean(this._interval);if(e===h?(i=v,s=E,r=u):(i=m,s=T,r=f),c&&t(c).hasClass(g))this._isSliding=!1;else if(!this._triggerSlideEvent(c,r).isDefaultPrevented()&&a&&c){this._isSliding=!0,C&&this.pause(),this._setActiveIndicatorElement(c);var I=t.Event(d.SLID,{relatedTarget:c,direction:r,from:l,to:_});P.supportsTransitionEnd()&&t(this._element).hasClass(p)?(t(c).addClass(s),P.reflow(c),t(a).addClass(i),t(c).addClass(i),t(a).one(P.TRANSITION_END,function(){t(c).removeClass(i+" "+s).addClass(g),t(a).removeClass(g+" "+s+" "+i),o._isSliding=!1,setTimeout(function(){return t(o._element).trigger(I)},0)}).emulateTransitionEnd(600)):(t(a).removeClass(g),t(c).addClass(g),this._isSliding=!1,t(this._element).trigger(I)),C&&this.cycle()}},o._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n),s=r({},a,t(this).data());"object"==typeof e&&(s=r({},s,e));var l="string"==typeof e?e:s.slide;if(i||(i=new o(this,s),t(this).data(n,i)),"number"==typeof e)i.to(e);else if("string"==typeof l){if("undefined"==typeof i[l])throw new TypeError('No method named "'+l+'"');i[l]()}else s.interval&&(i.pause(),i.cycle())})},o._dataApiClickHandler=function(e){var i=P.getSelectorFromElement(this);if(i){var s=t(i)[0];if(s&&t(s).hasClass(_)){var a=r({},t(s).data(),t(this).data()),l=this.getAttribute("data-slide-to");l&&(a.interval=!1),o._jQueryInterface.call(t(s),a),l&&t(s).data(n).to(l),e.preventDefault()}}},s(o,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return a}}]),o}();return t(document).on(d.CLICK_DATA_API,y.DATA_SLIDE,C._dataApiClickHandler),t(window).on(d.LOAD_DATA_API,function(){t(y.DATA_RIDE).each(function(){var e=t(this);C._jQueryInterface.call(e,e.data())})}),t.fn[e]=C._jQueryInterface,t.fn[e].Constructor=C,t.fn[e].noConflict=function(){return t.fn[e]=o,C._jQueryInterface},C}(e),H=function(t){var e="collapse",n="bs.collapse",i="."+n,o=t.fn[e],a={toggle:!0,parent:""},l={toggle:"boolean",parent:"(string|element)"},h={SHOW:"show"+i,SHOWN:"shown"+i,HIDE:"hide"+i,HIDDEN:"hidden"+i,CLICK_DATA_API:"click"+i+".data-api"},c="show",u="collapse",f="collapsing",d="collapsed",_="width",g="height",p={ACTIVES:".show, .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},m=function(){function i(e,n){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(n),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var i=t(p.DATA_TOGGLE),s=0;s0&&(this._selector=o,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var o=i.prototype;return o.toggle=function(){t(this._element).hasClass(c)?this.hide():this.show()},o.show=function(){var e,s,r=this;if(!this._isTransitioning&&!t(this._element).hasClass(c)&&(this._parent&&0===(e=t.makeArray(t(this._parent).find(p.ACTIVES).filter('[data-parent="'+this._config.parent+'"]'))).length&&(e=null),!(e&&(s=t(e).not(this._selector).data(n))&&s._isTransitioning))){var o=t.Event(h.SHOW);if(t(this._element).trigger(o),!o.isDefaultPrevented()){e&&(i._jQueryInterface.call(t(e).not(this._selector),"hide"),s||t(e).data(n,null));var a=this._getDimension();t(this._element).removeClass(u).addClass(f),this._element.style[a]=0,this._triggerArray.length>0&&t(this._triggerArray).removeClass(d).attr("aria-expanded",!0),this.setTransitioning(!0);var l=function(){t(r._element).removeClass(f).addClass(u).addClass(c),r._element.style[a]="",r.setTransitioning(!1),t(r._element).trigger(h.SHOWN)};if(P.supportsTransitionEnd()){var _="scroll"+(a[0].toUpperCase()+a.slice(1));t(this._element).one(P.TRANSITION_END,l).emulateTransitionEnd(600),this._element.style[a]=this._element[_]+"px"}else l()}}},o.hide=function(){var e=this;if(!this._isTransitioning&&t(this._element).hasClass(c)){var n=t.Event(h.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();if(this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",P.reflow(this._element),t(this._element).addClass(f).removeClass(u).removeClass(c),this._triggerArray.length>0)for(var s=0;s0&&t(n).toggleClass(d,!i).attr("aria-expanded",i)}},i._getTargetFromElement=function(e){var n=P.getSelectorFromElement(e);return n?t(n)[0]:null},i._jQueryInterface=function(e){return this.each(function(){var s=t(this),o=s.data(n),l=r({},a,s.data(),"object"==typeof e&&e);if(!o&&l.toggle&&/show|hide/.test(e)&&(l.toggle=!1),o||(o=new i(this,l),s.data(n,o)),"string"==typeof e){if("undefined"==typeof o[e])throw new TypeError('No method named "'+e+'"');o[e]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return a}}]),i}();return t(document).on(h.CLICK_DATA_API,p.DATA_TOGGLE,function(e){"A"===e.currentTarget.tagName&&e.preventDefault();var i=t(this),s=P.getSelectorFromElement(this);t(s).each(function(){var e=t(this),s=e.data(n)?"toggle":i.data();m._jQueryInterface.call(e,s)})}),t.fn[e]=m._jQueryInterface,t.fn[e].Constructor=m,t.fn[e].noConflict=function(){return t.fn[e]=o,m._jQueryInterface},m}(e),W=function(t){var e="dropdown",i="bs.dropdown",o="."+i,a=".data-api",l=t.fn[e],h=new RegExp("38|40|27"),c={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,CLICK:"click"+o,CLICK_DATA_API:"click"+o+a,KEYDOWN_DATA_API:"keydown"+o+a,KEYUP_DATA_API:"keyup"+o+a},u="disabled",f="show",d="dropup",_="dropright",g="dropleft",p="dropdown-menu-right",m="dropdown-menu-left",v="position-static",E='[data-toggle="dropdown"]',T=".dropdown form",y=".dropdown-menu",C=".navbar-nav",I=".dropdown-menu .dropdown-item:not(.disabled)",A="top-start",b="top-end",D="bottom-start",S="bottom-end",w="right-start",N="left-start",O={offset:0,flip:!0,boundary:"scrollParent"},k={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)"},L=function(){function a(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var l=a.prototype;return l.toggle=function(){if(!this._element.disabled&&!t(this._element).hasClass(u)){var e=a._getParentFromElement(this._element),i=t(this._menu).hasClass(f);if(a._clearMenus(),!i){var s={relatedTarget:this._element},r=t.Event(c.SHOW,s);if(t(e).trigger(r),!r.isDefaultPrevented()){if(!this._inNavbar){if("undefined"==typeof n)throw new TypeError("Bootstrap dropdown require Popper.js (https://popper.js.org)");var o=this._element;t(e).hasClass(d)&&(t(this._menu).hasClass(m)||t(this._menu).hasClass(p))&&(o=e),"scrollParent"!==this._config.boundary&&t(e).addClass(v),this._popper=new n(o,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===t(e).closest(C).length&&t("body").children().on("mouseover",null,t.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),t(this._menu).toggleClass(f),t(e).toggleClass(f).trigger(t.Event(c.SHOWN,s))}}}},l.dispose=function(){t.removeData(this._element,i),t(this._element).off(o),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},l.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},l._addEventListeners=function(){var e=this;t(this._element).on(c.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},l._getConfig=function(n){return n=r({},this.constructor.Default,t(this._element).data(),n),P.typeCheckConfig(e,n,this.constructor.DefaultType),n},l._getMenuElement=function(){if(!this._menu){var e=a._getParentFromElement(this._element);this._menu=t(e).find(y)[0]}return this._menu},l._getPlacement=function(){var e=t(this._element).parent(),n=D;return e.hasClass(d)?(n=A,t(this._menu).hasClass(p)&&(n=b)):e.hasClass(_)?n=w:e.hasClass(g)?n=N:t(this._menu).hasClass(p)&&(n=S),n},l._detectNavbar=function(){return t(this._element).closest(".navbar").length>0},l._getPopperConfig=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=r({},e.offsets,t._config.offset(e.offsets)||{}),e}:e.offset=this._config.offset,{placement:this._getPlacement(),modifiers:{offset:e,flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}}},a._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(i);if(n||(n=new a(this,"object"==typeof e?e:null),t(this).data(i,n)),"string"==typeof e){if("undefined"==typeof n[e])throw new TypeError('No method named "'+e+'"');n[e]()}})},a._clearMenus=function(e){if(!e||3!==e.which&&("keyup"!==e.type||9===e.which))for(var n=t.makeArray(t(E)),s=0;s0&&r--,40===e.which&&rdocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},p._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},p._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent"},f="show",d="out",_={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,INSERTED:"inserted"+o,CLICK:"click"+o,FOCUSIN:"focusin"+o,FOCUSOUT:"focusout"+o,MOUSEENTER:"mouseenter"+o,MOUSELEAVE:"mouseleave"+o},g="fade",p="show",m=".tooltip-inner",v=".arrow",E="hover",T="focus",y="click",C="manual",I=function(){function a(t,e){if("undefined"==typeof n)throw new TypeError("Bootstrap tooltips require Popper.js (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var I=a.prototype;return I.enable=function(){this._isEnabled=!0},I.disable=function(){this._isEnabled=!1},I.toggleEnabled=function(){this._isEnabled=!this._isEnabled},I.toggle=function(e){if(this._isEnabled)if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(p))return void this._leave(null,this);this._enter(null,this)}},I.dispose=function(){clearTimeout(this._timeout),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,null!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},I.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var i=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){t(this.element).trigger(i);var s=t.contains(this.element.ownerDocument.documentElement,this.element);if(i.isDefaultPrevented()||!s)return;var r=this.getTipElement(),o=P.getUID(this.constructor.NAME);r.setAttribute("id",o),this.element.setAttribute("aria-describedby",o),this.setContent(),this.config.animation&&t(r).addClass(g);var l="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,h=this._getAttachment(l);this.addAttachmentClass(h);var c=!1===this.config.container?document.body:t(this.config.container);t(r).data(this.constructor.DATA_KEY,this),t.contains(this.element.ownerDocument.documentElement,this.tip)||t(r).appendTo(c),t(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new n(this.element,r,{placement:h,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:v},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){e._handlePopperPlacementChange(t)}}),t(r).addClass(p),"ontouchstart"in document.documentElement&&t("body").children().on("mouseover",null,t.noop);var u=function(){e.config.animation&&e._fixTransition();var n=e._hoverState;e._hoverState=null,t(e.element).trigger(e.constructor.Event.SHOWN),n===d&&e._leave(null,e)};P.supportsTransitionEnd()&&t(this.tip).hasClass(g)?t(this.tip).one(P.TRANSITION_END,u).emulateTransitionEnd(a._TRANSITION_DURATION):u()}},I.hide=function(e){var n=this,i=this.getTipElement(),s=t.Event(this.constructor.Event.HIDE),r=function(){n._hoverState!==f&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),e&&e()};t(this.element).trigger(s),s.isDefaultPrevented()||(t(i).removeClass(p),"ontouchstart"in document.documentElement&&t("body").children().off("mouseover",null,t.noop),this._activeTrigger[y]=!1,this._activeTrigger[T]=!1,this._activeTrigger[E]=!1,P.supportsTransitionEnd()&&t(this.tip).hasClass(g)?t(i).one(P.TRANSITION_END,r).emulateTransitionEnd(150):r(),this._hoverState="")},I.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},I.isWithContent=function(){return Boolean(this.getTitle())},I.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-tooltip-"+e)},I.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},I.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(m),this.getTitle()),e.removeClass(g+" "+p)},I.setElementContent=function(e,n){var i=this.config.html;"object"==typeof n&&(n.nodeType||n.jquery)?i?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[i?"html":"text"](n)},I.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},I._getAttachment=function(t){return c[t.toUpperCase()]},I._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==C){var i=n===E?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,s=n===E?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(s,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=r({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},I._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},I._enter=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?T:E]=!0),t(n.getTipElement()).hasClass(p)||n._hoverState===f?n._hoverState=f:(clearTimeout(n._timeout),n._hoverState=f,n.config.delay&&n.config.delay.show?n._timeout=setTimeout(function(){n._hoverState===f&&n.show()},n.config.delay.show):n.show())},I._leave=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?T:E]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState=d,n.config.delay&&n.config.delay.hide?n._timeout=setTimeout(function(){n._hoverState===d&&n.hide()},n.config.delay.hide):n.hide())},I._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},I._getConfig=function(n){return"number"==typeof(n=r({},this.constructor.Default,t(this.element).data(),n)).delay&&(n.delay={show:n.delay,hide:n.delay}),"number"==typeof n.title&&(n.title=n.title.toString()),"number"==typeof n.content&&(n.content=n.content.toString()),P.typeCheckConfig(e,n,this.constructor.DefaultType),n},I._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},I._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(l);null!==n&&n.length>0&&e.removeClass(n.join(""))},I._handlePopperPlacementChange=function(t){this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},I._fixTransition=function(){var e=this.getTipElement(),n=this.config.animation;null===e.getAttribute("x-placement")&&(t(e).removeClass(g),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},a._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(i),s="object"==typeof e&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new a(this,s),t(this).data(i,n)),"string"==typeof e)){if("undefined"==typeof n[e])throw new TypeError('No method named "'+e+'"');n[e]()}})},s(a,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return u}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return i}},{key:"Event",get:function(){return _}},{key:"EVENT_KEY",get:function(){return o}},{key:"DefaultType",get:function(){return h}}]),a}();return t.fn[e]=I._jQueryInterface,t.fn[e].Constructor=I,t.fn[e].noConflict=function(){return t.fn[e]=a,I._jQueryInterface},I}(e),x=function(t){var e="popover",n="bs.popover",i="."+n,o=t.fn[e],a=new RegExp("(^|\\s)bs-popover\\S+","g"),l=r({},U.Default,{placement:"right",trigger:"click",content:"",template:''}),h=r({},U.DefaultType,{content:"(string|element|function)"}),c="fade",u="show",f=".popover-header",d=".popover-body",_={HIDE:"hide"+i,HIDDEN:"hidden"+i,SHOW:"show"+i,SHOWN:"shown"+i,INSERTED:"inserted"+i,CLICK:"click"+i,FOCUSIN:"focusin"+i,FOCUSOUT:"focusout"+i,MOUSEENTER:"mouseenter"+i,MOUSELEAVE:"mouseleave"+i},g=function(r){var o,g;function p(){return r.apply(this,arguments)||this}g=r,(o=p).prototype=Object.create(g.prototype),o.prototype.constructor=o,o.__proto__=g;var m=p.prototype;return m.isWithContent=function(){return this.getTitle()||this._getContent()},m.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-popover-"+e)},m.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},m.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(f),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(e.find(d),n),e.removeClass(c+" "+u)},m._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},m._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(a);null!==n&&n.length>0&&e.removeClass(n.join(""))},p._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n),s="object"==typeof e?e:null;if((i||!/destroy|hide/.test(e))&&(i||(i=new p(this,s),t(this).data(n,i)),"string"==typeof e)){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e]()}})},s(p,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return l}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return n}},{key:"Event",get:function(){return _}},{key:"EVENT_KEY",get:function(){return i}},{key:"DefaultType",get:function(){return h}}]),p}(U);return t.fn[e]=g._jQueryInterface,t.fn[e].Constructor=g,t.fn[e].noConflict=function(){return t.fn[e]=o,g._jQueryInterface},g}(e),K=function(t){var e="scrollspy",n="bs.scrollspy",i="."+n,o=t.fn[e],a={offset:10,method:"auto",target:""},l={offset:"number",method:"string",target:"(string|element)"},h={ACTIVATE:"activate"+i,SCROLL:"scroll"+i,LOAD_DATA_API:"load"+i+".data-api"},c="dropdown-item",u="active",f={DATA_SPY:'[data-spy="scroll"]',ACTIVE:".active",NAV_LIST_GROUP:".nav, .list-group",NAV_LINKS:".nav-link",NAV_ITEMS:".nav-item",LIST_ITEMS:".list-group-item",DROPDOWN:".dropdown",DROPDOWN_ITEMS:".dropdown-item",DROPDOWN_TOGGLE:".dropdown-toggle"},d="offset",_="position",g=function(){function o(e,n){var i=this;this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(n),this._selector=this._config.target+" "+f.NAV_LINKS+","+this._config.target+" "+f.LIST_ITEMS+","+this._config.target+" "+f.DROPDOWN_ITEMS,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,t(this._scrollElement).on(h.SCROLL,function(t){return i._process(t)}),this.refresh(),this._process()}var g=o.prototype;return g.refresh=function(){var e=this,n=this._scrollElement===this._scrollElement.window?d:_,i="auto"===this._config.method?n:this._config.method,s=i===_?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),t.makeArray(t(this._selector)).map(function(e){var n,r=P.getSelectorFromElement(e);if(r&&(n=t(r)[0]),n){var o=n.getBoundingClientRect();if(o.width||o.height)return[t(n)[i]().top+s,r]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},g.dispose=function(){t.removeData(this._element,n),t(this._scrollElement).off(i),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},g._getConfig=function(n){if("string"!=typeof(n=r({},a,n)).target){var i=t(n.target).attr("id");i||(i=P.getUID(e),t(n.target).attr("id",i)),n.target="#"+i}return P.typeCheckConfig(e,n,l),n},g._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},g._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},g._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},g._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var s=this._offsets.length;s--;){this._activeTarget!==this._targets[s]&&t>=this._offsets[s]&&("undefined"==typeof this._offsets[s+1]||t=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(e),t.Util=P,t.Alert=L,t.Button=R,t.Carousel=j,t.Collapse=H,t.Dropdown=W,t.Modal=M,t.Popover=x,t.Scrollspy=K,t.Tab=V,t.Tooltip=U,Object.defineProperty(t,"__esModule",{value:!0})}); 7 | //# sourceMappingURL=bootstrap.min.js.map -------------------------------------------------------------------------------- /src/main/resources/static/js/popper.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) Federico Zivolo 2018 3 | Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). 4 | */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=getComputedStyle(e,null);return t?o[t]:o}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function r(e){return 11===e?re:10===e?pe:re||pe}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1=o.clientWidth&&n>=o.clientHeight}),l=0a[e]&&!t.escapeWithReference&&(n=J(f[o],a[e]-('right'===e?f.width:f.height))),ae({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=le({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!q(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-us[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,y=t(e.instance.popper),w=parseFloat(y['margin'+f],10),E=parseFloat(y['border'+f+'Width'],10),v=b-e.offsets.popper[m]-w-E;return v=$(J(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},ae(n,m,Q(v)),ae(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case he.FLIP:p=[n,i];break;case he.CLOCKWISE:p=z(n);break;case he.COUNTERCLOCKWISE:p=z(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)f(l.top)||'bottom'===n&&f(a.top)f(o.right),g=f(a.top)f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,y=-1!==['top','bottom'].indexOf(n),w=!!t.flipVariations&&(y&&'start'===r&&h||y&&'end'===r&&c||!y&&'start'===r&&g||!y&&'end'===r&&u);(m||b||w)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),w&&(r=G(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=le({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!q(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.right versionDefinitionList = dockerComposeFilePort.retrieveDockerComposeVersions(); 71 | 72 | //then 73 | assertThat(versionDefinitionList) 74 | .isNotEmpty() 75 | .hasSize(5) 76 | .extracting("version", "name") 77 | .containsOnly( 78 | tuple("3.0", "Version 3.0 for Docker 1.13.0+"), 79 | tuple("3.1", "Version 3.1 for Docker 1.13.1+"), 80 | tuple("3.5", "Version 3.5 for Docker 17.12.0+"), 81 | tuple("3.6", "Version 3.6 for Docker 18.02.0+"), 82 | tuple("3.7", "Version 3.7 for Docker 18.06.0+") 83 | ); 84 | } 85 | 86 | @Test 87 | void should_retrieveDockerComposeServices() { 88 | //when 89 | List composeServiceDefinitionList = dockerComposeFilePort.retrieveDockerComposeServices(); 90 | 91 | //then 92 | assertThat(composeServiceDefinitionList) 93 | .isNotEmpty() 94 | .hasSize(42); 95 | } 96 | } -------------------------------------------------------------------------------- /src/test/java/com/aakkus/dockercomposeinitializr/infra/rest/DockerComposeRestControllerTest.java: -------------------------------------------------------------------------------- 1 | package com.aakkus.dockercomposeinitializr.infra.rest; 2 | 3 | import com.aakkus.dockercomposeinitializr.domain.model.DockerComposeFile; 4 | import com.aakkus.dockercomposeinitializr.infra.rest.request.CreateDockerComposeFileRequest; 5 | import com.aakkus.dockercomposeinitializr.infra.rest.response.DockerComposeResponse; 6 | import org.junit.jupiter.api.Test; 7 | import org.junit.jupiter.api.extension.ExtendWith; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.boot.test.context.SpringBootTest; 10 | import org.springframework.boot.test.web.client.TestRestTemplate; 11 | import org.springframework.boot.web.server.LocalServerPort; 12 | import org.springframework.http.ResponseEntity; 13 | import org.springframework.test.context.junit.jupiter.SpringExtension; 14 | 15 | import java.util.List; 16 | 17 | import static org.assertj.core.api.Assertions.assertThat; 18 | 19 | @ExtendWith(SpringExtension.class) 20 | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) 21 | class DockerComposeRestControllerTest { 22 | 23 | @LocalServerPort 24 | private Integer port; 25 | 26 | @Autowired 27 | private TestRestTemplate testRestTemplate; 28 | 29 | @Test 30 | void should_retrieveDockerComposeMetadata() { 31 | //when 32 | ResponseEntity responseEntity = testRestTemplate.getForEntity("http://localhost:" + port + "/api/v1/docker-compose", DockerComposeResponse.class); 33 | 34 | //then 35 | assertThat(responseEntity).isNotNull(); 36 | assertThat(responseEntity.getBody()).isNotNull(); 37 | assertThat(responseEntity.getBody().getVersions()).hasSize(5); 38 | assertThat(responseEntity.getBody().getServices()).hasSize(42); 39 | } 40 | 41 | @Test 42 | void should_createDockerComposeFile() { 43 | //given 44 | CreateDockerComposeFileRequest createDockerComposeFileRequest = new CreateDockerComposeFileRequest(); 45 | createDockerComposeFileRequest.setVersion("3.0"); 46 | createDockerComposeFileRequest.setServices(List.of("redis")); 47 | 48 | //when 49 | ResponseEntity responseEntity = testRestTemplate.postForEntity("http://localhost:" + port + "/api/v1/docker-compose", createDockerComposeFileRequest, DockerComposeFile.class); 50 | 51 | //then 52 | assertThat(responseEntity).isNotNull(); 53 | assertThat(responseEntity.getBody()).isNotNull(); 54 | assertThat(responseEntity.getBody().getVersion()).isEqualTo("3.0"); 55 | assertThat(responseEntity.getBody().getServices()).isEqualTo(List.of("redis")); 56 | assertThat(responseEntity.getBody().getComposeFileContent()).isNotNull().contains("docker-compose-initializr-redis"); 57 | } 58 | } -------------------------------------------------------------------------------- /system.properties: -------------------------------------------------------------------------------- 1 | java.runtime.version=11 --------------------------------------------------------------------------------