This repository has been archived by the owner on Jul 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from JoaoDanielRufino/formula/beagle-generate…
…-scaffold [Formula] - #140 Beagle Scaffold (Mobile/Web/Backend)
- Loading branch information
Showing
153 changed files
with
5,415 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"long": "Generate beagle objects", | ||
"short": "Generate beagle objects" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Generate beagle objects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM cimg/base:stable-20.04 | ||
|
||
USER root | ||
|
||
COPY . / | ||
|
||
RUN sed -i 's/\r//g' /set_umask.sh | ||
RUN sed -i 's/\r//g' /run.sh | ||
RUN chmod +x /set_umask.sh | ||
RUN mkdir /app | ||
|
||
ENV DOCKER_EXECUTION=true | ||
ENV CURRENT_PWD=/app | ||
|
||
WORKDIR / | ||
|
||
ENTRYPOINT ["/set_umask.sh"] | ||
CMD ["/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# SH | ||
BINARY_NAME=run.sh | ||
BIN_FOLDER=bin | ||
|
||
build: bash-build docker | ||
|
||
bash-build: | ||
mkdir -p $(BIN_FOLDER) | ||
cp -r src/* $(BIN_FOLDER) | ||
mv $(BIN_FOLDER)/main.sh $(BIN_FOLDER)/$(BINARY_NAME) | ||
chmod +x $(BIN_FOLDER)/$(BINARY_NAME) | ||
|
||
docker: | ||
cp Dockerfile set_umask.sh $(BIN_FOLDER) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!-- markdownlint-disable-file MD013 --> | ||
# Ritchie Formula | ||
|
||
## command | ||
|
||
```bash | ||
rit beagle generate scaffold | ||
``` | ||
|
||
## description | ||
|
||
This formula generates a backend project with beagle and also, if needed, generates a web and/or mobile project with beagle. | ||
|
||
## How it works | ||
|
||
![gif](doc/beagle-generate-scaffold.gif) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"dockerImageBuilder": "cimg/base:stable-20.04", | ||
"inputs": [] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"long": "Generates a backend project with beagle and also, if needed, generates a web and/or mobile project with beagle", | ||
"short": "Manipulate scaffold" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Manipulate scaffold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"execution": [ | ||
"local", | ||
"docker" | ||
], | ||
"os": { | ||
"deps": [], | ||
"support": [ | ||
"mac", | ||
"linux" | ||
] | ||
}, | ||
"tags": [ | ||
"beagle", | ||
"generate", | ||
"scaffold" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
umask 0011 | ||
$1 |
13 changes: 13 additions & 0 deletions
13
beagle/generate/scaffold/src/formula/backend-generator/_vendor/beagle-micronaut/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Thumbs.db | ||
.DS_Store | ||
.gradle | ||
build/ | ||
target/ | ||
out/ | ||
.idea | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.project | ||
.settings | ||
.classpath |
110 changes: 110 additions & 0 deletions
110
...rmula/backend-generator/_vendor/beagle-micronaut/.mvn/wrapper/MavenWrapperDownloader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/* | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
*/ | ||
|
||
import java.net.*; | ||
import java.io.*; | ||
import java.nio.channels.*; | ||
import java.util.Properties; | ||
|
||
public class MavenWrapperDownloader { | ||
|
||
/** | ||
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. | ||
*/ | ||
private static final String DEFAULT_DOWNLOAD_URL = | ||
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar"; | ||
|
||
/** | ||
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to | ||
* use instead of the default one. | ||
*/ | ||
private static final String MAVEN_WRAPPER_PROPERTIES_PATH = | ||
".mvn/wrapper/maven-wrapper.properties"; | ||
|
||
/** | ||
* Path where the maven-wrapper.jar will be saved to. | ||
*/ | ||
private static final String MAVEN_WRAPPER_JAR_PATH = | ||
".mvn/wrapper/maven-wrapper.jar"; | ||
|
||
/** | ||
* Name of the property which should be used to override the default download url for the wrapper. | ||
*/ | ||
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; | ||
|
||
public static void main(String args[]) { | ||
System.out.println("- Downloader started"); | ||
File baseDirectory = new File(args[0]); | ||
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); | ||
|
||
// If the maven-wrapper.properties exists, read it and check if it contains a custom | ||
// wrapperUrl parameter. | ||
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); | ||
String url = DEFAULT_DOWNLOAD_URL; | ||
if(mavenWrapperPropertyFile.exists()) { | ||
FileInputStream mavenWrapperPropertyFileInputStream = null; | ||
try { | ||
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); | ||
Properties mavenWrapperProperties = new Properties(); | ||
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); | ||
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); | ||
} catch (IOException e) { | ||
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); | ||
} finally { | ||
try { | ||
if(mavenWrapperPropertyFileInputStream != null) { | ||
mavenWrapperPropertyFileInputStream.close(); | ||
} | ||
} catch (IOException e) { | ||
// Ignore ... | ||
} | ||
} | ||
} | ||
System.out.println("- Downloading from: : " + url); | ||
|
||
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); | ||
if(!outputFile.getParentFile().exists()) { | ||
if(!outputFile.getParentFile().mkdirs()) { | ||
System.out.println( | ||
"- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'"); | ||
} | ||
} | ||
System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); | ||
try { | ||
downloadFileFromURL(url, outputFile); | ||
System.out.println("Done"); | ||
System.exit(0); | ||
} catch (Throwable e) { | ||
System.out.println("- Error downloading"); | ||
e.printStackTrace(); | ||
System.exit(1); | ||
} | ||
} | ||
|
||
private static void downloadFileFromURL(String urlString, File destination) throws Exception { | ||
URL website = new URL(urlString); | ||
ReadableByteChannel rbc; | ||
rbc = Channels.newChannel(website.openStream()); | ||
FileOutputStream fos = new FileOutputStream(destination); | ||
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); | ||
fos.close(); | ||
rbc.close(); | ||
} | ||
|
||
} |
Binary file added
BIN
+47.2 KB
...old/src/formula/backend-generator/_vendor/beagle-micronaut/.mvn/wrapper/maven-wrapper.jar
Binary file not shown.
1 change: 1 addition & 0 deletions
1
.../formula/backend-generator/_vendor/beagle-micronaut/.mvn/wrapper/maven-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip |
4 changes: 4 additions & 0 deletions
4
beagle/generate/scaffold/src/formula/backend-generator/_vendor/beagle-micronaut/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM openjdk:14-alpine | ||
COPY target/bff-micronaut-*.jar bff-micronaut.jar | ||
EXPOSE 8080 | ||
CMD ["java", "-Dcom.sun.management.jmxremote", "-Xmx128m", "-jar", "bff-micronaut.jar"] |
3 changes: 3 additions & 0 deletions
3
...erate/scaffold/src/formula/backend-generator/_vendor/beagle-micronaut/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Feature http-client documentation | ||
|
||
- [Micronaut Micronaut HTTP Client documentation](https://docs.micronaut.io/latest/guide/index.html#httpClient) |
22 changes: 22 additions & 0 deletions
22
...enerate/scaffold/src/formula/backend-generator/_vendor/beagle-micronaut/micronaut-cli.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
applicationType: default | ||
defaultPackage: ${package_name} | ||
testFramework: junit | ||
sourceLanguage: kotlin | ||
buildTool: maven | ||
features: | ||
[ | ||
annotation-api, | ||
app-name, | ||
docker, | ||
file-watch, | ||
http-client, | ||
junit, | ||
kotlin, | ||
kotlin-application, | ||
logback, | ||
maven, | ||
netty-server, | ||
readme, | ||
shade, | ||
yaml, | ||
] |
Oops, something went wrong.