Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify build environment #480

Open
rich-murphey opened this issue Aug 31, 2019 · 8 comments
Open

clarify build environment #480

rich-murphey opened this issue Aug 31, 2019 · 8 comments
Labels
enhancement New feature or request

Comments

@rich-murphey
Copy link
Contributor

rich-murphey commented Aug 31, 2019

I thought it might be helpful for newcomers, for some of the packages required for building or installing this project to be enumerated.

Note that this is on Debian, which doesn't seem to have podman in the repos, so I substituted docker.

Also, in the Makefile, $(PWD) did not seem to work, so I substituted $(shell pwd).

Here are steps that build and deploy the project on current Debian.

install docker on Debian

sudo apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io

install rust

wget https://sh.rustup.rs -O rustup-init
sudo sh rustup-init -y

install cargo-web

sudo apt-get install -y pkg-config libssl-dev
sudo cargo install cargo-web

build the project

cd /opt
git clone https://github.com/saschagrunert/webapp.rs.git
cd webapp.rs
sed -si 's/$(PWD)/$(shell pwd)/' Makefile
sed -si 's/^CONTAINER_RUNTIME.*/CONTAINER_RUNTIME=docker/' Makefile

modify app URL and docker conn as needed

sed -i 's|^url.|url = "http://127.0.0.1:8888"|' Config.toml
sed -i 's/^host.
/host = "127.0.0.1"/' Config.toml
sed -i 's/^username./username = "webapp"/' Config.toml
sed -i 's/^password.
/password = "abcd1234"/' Config.toml
sed -i 's/^database.*/database = "webapp"/' Config.toml
make all

deploy the web app

sudo apt install -y postgresql-client
cargo install diesel_cli --no-default-features --features "postgres"
sudo make deploy
make run-app
docker ps -a

Also, note that the build should be done on a local filesystem so that it can be mapped as a volume in a container.

I'd be glad to help put this in a project wiki page if needed.

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.74. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@rich-murphey rich-murphey changed the title clarify clarify build environment Aug 31, 2019
@rich-murphey rich-murphey reopened this Aug 31, 2019
@saschagrunert
Copy link
Owner

Hey @rich-murphey, thank you for the contribution. 🙏 Are you willed to open up a PR to add these information to the README (or a dedicated file)?

@saschagrunert saschagrunert added enhancement New feature or request and removed feature_request labels Aug 31, 2019
@rich-murphey
Copy link
Contributor Author

Yes, I'll submit a PR for the README. If you have any other preferences, just let me know.

@saschagrunert
Copy link
Owner

Sounds good, thanks. :)

@JohnWaltonProjects
Copy link

This project is a rusty Gem of github. Thanks SO much for publishing this. Coming from a non-programming background this is a bit overwhelming but the programming appears to be extremely refined and thus, it is a massive learning experience! My only wish is more documentation and explanation of the 'moving parts' herin. Thanks for making this available and refining to close-perfection.

@saschagrunert
Copy link
Owner

This project is a rusty Gem of github. Thanks SO much for publishing this. Coming from a non-programming background this is a bit overwhelming but the programming appears to be extremely refined and thus, it is a massive learning experience! My only wish is more documentation and explanation of the 'moving parts' herin. Thanks for making this available and refining to close-perfection.

Thank you that’s so nice! :)

@hitchhooker
Copy link

   Compiling webapp-frontend v1.0.0 (/opt/webapp.rs/frontend)
error: failed to run custom build command for `webapp-frontend v1.0.0 (/opt/webapp.rs/frontend)`

--- stderr
Error: Error { inner: ErrorInner { kind: Wanted { expected: "newline", found: "an equals" }, line: Some(1), col: 29, at: Some(38), message: "", key: [] } }

error: build failed
make: *** [Makefile:53: build-frontend] Error 101

receiving following error when following this guide in latest debian

@jaques-sam
Copy link

@rich-murphey some additions... Maybe that changed since 2019, but this info is clearly missing.

make all still failed for me because these commands were missing:

  • sudo apt-get install libpq-dev (or you get linker error for not finding the postgresql lib)
  • cargo install wasm-pack (got /bin/sh: 2: wasm-pack: not found
  • npm install --global rollup (got /bin/sh: 2: rollup: not found)
  • sudo apt-get install npm (in case you didn't have npm, js package mananger)

Please correct where needed 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants