Skip to content

Commit

Permalink
a bunch of work in progress, potential rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
chaim1221 committed Mar 2, 2020
1 parent 5a4d05f commit 7db7eb4
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Machete\.Web/Content/Machete\.min\.css
Machete\.Web/Published

machete1env.list
machete1env.json

node_modules/

Expand Down
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
[![Join the chat at https://gitter.im/machete-project/Lobby](https://badges.gitter.im/machete-project/Lobby.svg)](https://gitter.im/machete-project/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0.en.html)



Machete is a web application that manages a day labor referral service. Machete tracks work orders for employers looking
for short term, casual labor. It also provides a means for matching laborers with specific skills to requests made by
employers for skilled labor.
Expand All @@ -27,6 +25,7 @@ please contact [email protected].

`☮️ 💟 🍁`


## How to get started
<hr>

Expand All @@ -53,6 +52,7 @@ Great, now you should be good to go!

`☕️ 💻 🐈`


## Setup scripts
<hr>

Expand All @@ -63,8 +63,13 @@ inquiries should be directed to the [email]([email protected]) above.
Aptly named, this file will dispose of whatever database container you have running (as long as you have the environment
variable for it set, which the script does), and create an entirely new database container.

`./make_env_file.sh`
This file will create an environment file that you can source to set certain variables. Only needed for OAuth development.
`./make_env_secrets_file.sh`
This file will create an environment file that you can source to set certain variables. Needed for OAuth development. If Machete is run in production
mode, this file must be sourced (e.g., inside the container) so that `dotnet` can read the secrets from the environment.

`./make_json_secrets_file.sh`
This will take the file produced by the above script and turn it into a JSON file that can be piped to `dotnet user-secrets set --project=Machete.Web`.
Eventually we should be doing this for production as well, but the pipeline depends on the `bash` variables.

`./completely-clean-build-and-run.sh`
This file will:
Expand All @@ -74,10 +79,14 @@ This file will:
4. Clean up any existing build(s).
5. Initialize the submodule, if it isn't initialized.
6. Start the Angular webpack server as a background process.
7. Build and run Machete.
7. Build and run Machete in production mode.

Clearly, this is not a full development kit. We recommend using JetBrains Rider for debugging .NET applications on *nix. If you need user secrets in
Rider, you can use the ones that are stored in the `dotnet user-secrets` store, as mentioned above.

`🎺 💃 🇲🇽`


## How to connect to the database
<hr>
Download DataGrip. It has a 30 day evaluation period, but is not free software.
Expand Down
12 changes: 10 additions & 2 deletions completely-clean-build-and-run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/bin/bash

# https://github.com/Microsoft/msbuild/issues/3362

trap 'kill $(jobs -p)' EXIT

echo "This script runs Machete in production mode, and should not be run simultaneously with a development build."
sleep 2

export MSBUILDDISABLENODEREUSE=1

if [ ! -f machete1env.list ]; then ./make_env_file.sh ; fi
if [ ! -f machete1env.json ]; then ./make_env_file.sh ; fi

for var in $(cat machete1env.list); do
export $var
Expand All @@ -17,4 +25,4 @@ npm run start-local-dev &
cd ..

dotnet build
dotnet run --project Machete.Web --configuration=Debug
dotnet run --project Machete.Web --configuration=Release
File renamed without changes.
16 changes: 16 additions & 0 deletions make_json_secrets_file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

echo '' > machete1env.json

echo "{" >> machete1env.json
#echo " \"Authentication\": {" >> machete1env.json
for i in $(cat machete1env.list); do
fieldname=$(echo $i | awk -F= '{print $1}' | sed s/__/:/g | awk -F_ '{print $2}')
fieldvalue=$(echo $i | awk -F= '{print $2}')
echo " \"${fieldname}\": \"${fieldvalue}\"," >> machete1env.json
done

echo " \"stupidHack\": \"I don't have a comma\"" >> machete1env.json

#echo " }" >> machete1env.json
echo "}" >> machete1env.json

0 comments on commit 7db7eb4

Please sign in to comment.