-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into remove-docker-compose-folder
- Loading branch information
Showing
18 changed files
with
439 additions
and
8 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 |
---|---|---|
|
@@ -22,6 +22,10 @@ jobs: | |
name: loaders-curl | ||
- context: ./src/services/java | ||
name: services-java | ||
- context: ./src/services/nodejs | ||
name: services-nodejs | ||
- context: ./src/databases/mysql | ||
name: databases-mysql | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
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,9 @@ | ||
FROM mysql:5.7 | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/cisco-open/app-simulator | ||
LABEL org.opencontainers.image.description="mysql database for app-simulator" | ||
LABEL org.opencontainers.image.licenses=BSD-3-Clause | ||
|
||
RUN yum install -y php-cli && yum clean all | ||
COPY setup.php /tmp/ | ||
COPY setup.sh /docker-entrypoint-initdb.d/ |
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,33 @@ | ||
<?php | ||
echo "Setup ...".PHP_EOL; | ||
|
||
$config = json_decode($_SERVER['APP_CONFIG']); | ||
|
||
$result = ""; | ||
|
||
foreach($config->databases as $database => $tables) { | ||
$result .= "CREATE DATABASE ".$database.";".PHP_EOL; | ||
$result .= "USE ".$database.";".PHP_EOL; | ||
foreach($tables as $table => $columns) { | ||
$result .="CREATE TABLE ".$table." (".PHP_EOL; | ||
foreach($columns as $column) { | ||
if($column === 'id') { | ||
$result .= " ".$column." INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,".PHP_EOL; | ||
} else { | ||
$result .= " ".$column. " VARCHAR(255),".PHP_EOL; | ||
} | ||
} | ||
|
||
$result = substr($result,0,-2).PHP_EOL; | ||
|
||
$result .=') ENGINE=InnoDB;'.PHP_EOL; | ||
} | ||
} | ||
|
||
echo '=====.PHP_EOL'; | ||
|
||
echo $result; | ||
|
||
echo '=====.PHP_EOL'; | ||
|
||
file_put_contents("/tmp/create.sql",$result); |
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/bash | ||
APP_CONFIG="$(</config.json)" php /tmp/setup.php | ||
mysql -uroot -p${MYSQL_ROOT_PASSWORD} < /tmp/create.sql |
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 @@ | ||
node_modules | ||
npm-debug.log | ||
package-lock.json | ||
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,4 @@ | ||
node_modules | ||
npm-debug.log | ||
package-lock.json | ||
node.log |
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 @@ | ||
FROM node:18 | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/cisco-open/app-simulator | ||
LABEL org.opencontainers.image.description="nodejs service for app-simulator" | ||
LABEL org.opencontainers.image.licenses=BSD-3-Clause | ||
|
||
WORKDIR /app | ||
COPY package*.json ./ | ||
RUN npm install | ||
COPY . . | ||
RUN chmod +x /app/entrypoint.sh | ||
EXPOSE 80 | ||
CMD ["/app/entrypoint.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,4 @@ | ||
#!/bin/bash | ||
echo "Running server on :8080" | ||
APP_CONFIG="$(</config.json)" node index.js 8080 | ||
#fi |
Oops, something went wrong.