From 6a59508df8537cc6cf42a33f4e17229e701959e4 Mon Sep 17 00:00:00 2001 From: rimutaka Date: Sat, 28 Aug 2021 19:52:01 +1200 Subject: [PATCH] Updated deployment scripts --- .gitignore | 2 ++ README.md | 8 ++++---- distro/README.md | 20 ++++++++++++++++++++ distro/ubuntu/build_release.sh | 9 +++++++++ 4 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 distro/ubuntu/build_release.sh diff --git a/.gitignore b/.gitignore index a052199..db4348b 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index d8d9194..bd18d1f 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/distro/README.md b/distro/README.md index cb94be1..abe4976 100644 --- a/distro/README.md +++ b/distro/README.md @@ -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. @@ -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*. diff --git a/distro/ubuntu/build_release.sh b/distro/ubuntu/build_release.sh new file mode 100644 index 0000000..6d74028 --- /dev/null +++ b/distro/ubuntu/build_release.sh @@ -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