Skip to content

Commit

Permalink
[skip ci] modify bootstrap scripts, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
chaim1221 committed Jan 19, 2020
1 parent 2a6c426 commit 5a4d05f
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 5 deletions.
7 changes: 6 additions & 1 deletion Machete.Util/sh/run-machete1.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

# ./Machete.Util/sh/run-machete1.sh
# This script runs the Machete.Web.dll binary inside a container behind an NginX proxy, which tests the creation of the container. Not needed for development.


# trap "{ rm -f machete1env.list; }" EXIT

docker rm machete1
Expand Down Expand Up @@ -27,4 +31,5 @@ dotnet user-secrets list --project=Machete.Web \
| sed s/Authentication/MACHETE_Authentication/g \
>> machete1env.list

docker run -it --name machete1 --network machete-bridge -p 443:443 --env-file machete1env.list ndlonmachete/debian:1.14.61
# TODO get latest tag from GitHub
docker run -it --name machete1 --network machete-bridge -p 443:443 --env-file machete1env.list ndlonmachete/debian:latest
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ You will also need [Docker](https://www.docker.com/get-started). Keep in mind th
levels of support for the Docker engine. Depending on your platform, Docker may be running inside a VM with very little
filesystem access. You probably won't need to worry about this unless you become more involved with the project.

Finally, you will need the [`dotnet` CLI](https://dotnet.microsoft.com/download).
Additionally, you will need the [`dotnet` CLI](https://dotnet.microsoft.com/download).

Finally, you will need `npm` for your distribution. We recommend [downloading and installing NodeJS](https://nodejs.org/en/)
for your distribution. Once you have `npm` installed you will need to run `npm install -g @angular/cli` in the terminal.

(If you're on Mac, you'll then need to `sudo chown -R $USER: /usr/local/lib/node_modules`, because Mac).

Great, now you should be good to go!

Expand All @@ -58,8 +63,18 @@ 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.

`./Machete.Util/sh/run-machete1.sh`
This script runs the Machete.Web.dll binary inside a container behind an NginX proxy, which tests the creation of the container. Not needed for development.
`./make_env_file.sh`
This file will create an environment file that you can source to set certain variables. Only needed for OAuth development.

`./completely-clean-build-and-run.sh`
This file will:
1. [Disable msbuild 're-use'](https://github.com/Microsoft/msbuild/issues/3362) in `dotnet`.
2. Prompt you to create the environment variables file if it doesn't exist.
3. Source the environment variables file.
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.

`🎺 💃 🇲🇽`

Expand Down
9 changes: 8 additions & 1 deletion completely-clean-build-and-run.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# https://github.com/Microsoft/msbuild/issues/3362
export MSBUILDDISABLENODEREUSE=1

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

for var in $(cat machete1env.list); do
export $var
done

dotnet clean

# assumes you've run git submodule update --init #--force #etc.
cd UI
if [ $(ls | wc -l) -eq 0 ]; then cd .. ; git submodule update --init --force ; cd UI ; fi
npm install
npm run build-local-dev
npm run start-local-dev &
cd ..
Expand Down
21 changes: 21 additions & 0 deletions make_env_file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

export MACHETE_Authentication__State=fakestate
read -p "Google Client ID: " MACHETE_Authentication__Google__ClientId
read -s -p "Google Client Secret: " MACHETE_Authentication__Google__ClientSecret
echo ""
read -p "Facebook App ID: " MACHETE_Authentication__Facebook__AppId
read -s -p "Facebook App Secret: " MACHETE_Authentication__Facebook__AppSecret
echo ""

if [ -f machete1env.list ]; then rm machete1env.list; fi

echo "MACHETE_Authentication__State=$MACHETE_Authentication__State" >> machete1env.list
echo "MACHETE_Authentication__Google__ClientId=$MACHETE_Authentication__Google__ClientId" >> machete1env.list
echo "MACHETE_Authentication__Google__ClientSecret=$MACHETE_Authentication__Google__ClientSecret" >> machete1env.list
echo "MACHETE_Authentication__Facebook__AppId=$MACHETE_Authentication__Facebook__AppId" >> machete1env.list
echo "MACHETE_Authentication__Facebook__AppSecret=$MACHETE_Authentication__Facebook__AppSecret" >> machete1env.list

echo "You must now:"
echo "source machete1env.list"
echo ""

0 comments on commit 5a4d05f

Please sign in to comment.