Skip to content

Commit

Permalink
Updated deployment scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rimutaka committed Aug 28, 2021
1 parent 97d2289 commit 6a59508
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ trace*.txt
*.pri
*.zip
distro/msix/manifest_*/stm_rules
stackmuncher-x86_64-unknown-linux-gnu
stackmuncher-x86_64-unknown-linux-musl
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ The app creates a sample stack report on the first run over a project without su
_This is an alpha release and the only way to run this app is to compile it from the source in Rust._

1. Download the latest binary from GitHub
* Linux (GNU): `sudo curl -o /usr/bin/stackmuncher -L https://github.com/stackmuncher/stm_app/releases/download/v0.1.3/stackmuncher-x86_64-unknown-linux-gnu && sudo chmod 755 /usr/bin/stackmuncher`
* Linux (MUSL): `sudo curl -o /usr/bin/stackmuncher -L https://github.com/stackmuncher/stm_app/releases/download/v0.1.3/stackmuncher-x86_64-unknown-linux-musl && sudo chmod 755 /usr/bin/stackmuncher`
* Windows: `invoke-webrequest -uri https://github.com/stackmuncher/stm_app/releases/download/v0.1.3/stackmuncher-x86_64-pc-windows-msvc.exe -outfile $env:windir\stackmuncher.exe`
* Linux (GNU): `sudo curl -o /usr/bin/stackmuncher -L https://github.com/stackmuncher/stm_app/releases/download/v0.1.4/stackmuncher-x86_64-unknown-linux-gnu && sudo chmod 755 /usr/bin/stackmuncher`
* Linux (MUSL): `sudo curl -o /usr/bin/stackmuncher -L https://github.com/stackmuncher/stm_app/releases/download/v0.1.4/stackmuncher-x86_64-unknown-linux-musl && sudo chmod 755 /usr/bin/stackmuncher`
* Windows: `invoke-webrequest -uri https://github.com/stackmuncher/stm_app/releases/download/v0.1.4/stackmuncher-x86_64-pc-windows-msvc.exe -outfile $env:windir\stackmuncher.exe`
2. Change the current directory to one of your projects with a Git repository (has _.git_ subfolder) and run:
* Linux: `stackmuncher`
* Windows PowerShell: `.\stackmuncher.exe`
* Windows PowerShell: `stackmuncher`

The app will access the local Git repository for the current directory and create a stack report, but will NOT submit any data to the Directory to let you review the stack report first. It will start updating your profile on subsequent runs unless `--dryrun` flag is used.

Expand Down
20 changes: 20 additions & 0 deletions distro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ All *.sh* and *.ps1* scripts should be run from the project root.

The app should be deployed to `/usr/bin/stackmuncher` and the rules to `/usr/share/stackmuncher/stm_rules/`. The choice is based on [Linux Filesystem Hierarchy Standard](https://www.pathname.com/fhs/).

### Pre-requisites
1. Make sure musl build tools are installed
```shell
sudo apt update
sudo apt install musl-tools
```
2. Manual build: [distro/ubuntu/build_release.sh](distro/ubuntu/build_release.sh)

### deb package

deb builds rely on [cargo-deb](https://crates.io/crates/cargo-deb) crate. See config inside [stackmuncher/Cargo.toml](stackmuncher/Cargo.toml) `[package.metadata.deb]` table.
Expand Down Expand Up @@ -57,6 +65,18 @@ Installation process:

Dev cert: http://distro.stackmuncher.com/msix/stm_dev.cer <-- FOR DEVELOPMENT ONLY

### Manual binary build
```powershell
cargo build --release --target x86_64-pc-windows-msvc
cp target\x86_64-pc-windows-msvc\release\stackmuncher.exe ..\stackmuncher-x86_64-pc-windows-msvc.exe
signtool sign /f ..\stm.pfx /p $env:stmpfxpwd /t http://timestamp.digicert.com /fd SHA256 ..\stackmuncher-x86_64-pc-windows-msvc.exe
cp ..\stackmuncher-x86_64-pc-windows-msvc.exe $env:windir\stackmuncher.exe
# TEST-RUN IT BEFORE UPLOADING
aws s3 cp ..\stackmuncher-x86_64-pc-windows-msvc.exe s3://$env:stmdistrobucket/
```
Copy the Win distributable from _distro_ bucket: `aws s3 cp s3://$STM_S3_BUCKET_DISTRO/stackmuncher-x86_64-pc-windows-msvc.exe .`


#### Dev and testing

*stm_dev.pfx* is needed to sign a package. *stm_dev.cer* should be installed on the test machine. Both files can be generated with *distro\msix\cert_gen_self_signed.ps1*.
Expand Down
9 changes: 9 additions & 0 deletions distro/ubuntu/build_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# sudo apt update
# sudo apt install musl-tools
# cargo clean
# cargo update

cargo build --release --target x86_64-unknown-linux-gnu
cp -f target/x86_64-unknown-linux-gnu/release/stackmuncher stackmuncher-x86_64-unknown-linux-gnu
cargo build --release --target x86_64-unknown-linux-musl
cp -f target/x86_64-unknown-linux-musl/release/stackmuncher stackmuncher-x86_64-unknown-linux-musl

0 comments on commit 6a59508

Please sign in to comment.