name: cocmd automations: - name: web content: description: start the website env: osx steps: - title: Cocmd website πŸ‘‹πŸ‘‹πŸ‘‹ runner: markdown content: | Let's get started with the cocmd website. It's a docusaurus site, so make sure you have node installed. This will install all the tools you need to get started. it's best to run the full onboarding first with: `cocmd run cocmd.contrib-onboarding --from https://github.com/cocmd/cocmd` Good to have you here πŸŽ‰πŸŽ‰πŸŽ‰ Cheers - title: install node if needed approval_message: Ready to start? runner: shell content: | # if node not installed, run cocmd install node.setup if ! node -v &> /dev/null then echo "node not installed" cocmd --silent install node.setup fi # if yarn not installed, run cocmd install yarn.setup if ! yarn -v &> /dev/null then echo "yarn not installed" cocmd --silent install node.yarn.setup fi - title: install runner: shell content: | cd cocmd-project/website yarn - title: start runner: shell content: | cd cocmd-project/website yarn start - name: contrib-onboarding content: description: "onboarding for project https://github.com/JKHeadley/appy" env: osx steps: - title: Hello πŸ‘‹πŸ‘‹πŸ‘‹ runner: markdown content: | ## Welcome to Cocmd Contributor onboarding πŸŽ‰πŸŽ‰πŸŽ‰ This is a guide to getting started with cocmd development. This will install all the tools you need to get started. it's going to: - install git - install rust - install node - install vscode - clone all Cocmd repos - build the website - build cocmd cli - install local hub packages - open vscode with all the repos - title: lets start runner: shell approval_message: Ready to start? content: echo lets start - title: install vscode runner: cocmd approval_message: Cocmd is vscode-ready. install vscode? content: vscode.setup - title: install git runner: cocmd content: git.setup - title: install rust runner: cocmd content: rust.setup - title: install node runner: cocmd content: node.setup - title: git clones runner: shell content: | mkdir -p cocmd-project cd cocmd-project for name in homebrew-tap cocmd website hub example-repo-template; do repo="git@github.com:cocmd/$name.git" echo "cloning $name" if [ -d ./$name ]; then echo "$name project already exists" else echo "$repo doesn't exist" git clone $repo fi done open . - title: add git hooks description: pre-commit and pre-push hooks for rust fmt and clippy runner: shell content: | cd cocmd-project/cocmd touch .git/hooks/pre-commit chmod +x .git/hooks/pre-commit cat << 'EOF' > .git/hooks/pre-commit #!/bin/bash cargo clippy --fix --allow-dirty cargo fmt cargo fix --allow-dirty # Add any changes made by the formatting commands git add . EOF echo "pre-push hook added" cat .git/hooks/pre-commit touch .git/hooks/pre-push chmod +x .git/hooks/pre-push cat << 'EOF' > .git/hooks/pre-push #!/bin/bash cargo clippy EOF echo "pre-push hook added" cat .git/hooks/pre-push - title: run website runner: shell content: | cd cocmd-project/website yarn echo "website ready to run - yarn start" - title: build cli runner: shell content: | cd cocmd-project/cocmd rustup target add x86_64-unknown-linux-gnu rustup target add x86_64-pc-windows-gnu rustup target add wasm32-unknown-unknown rustup target add aarch64-apple-darwin # for coverage with grcov rustup component add llvm-tools-preview cargo install grcov rustup toolchain install nightly cargo install --path . echo "cocmd cli ready to run - cocmd --help" - title: install local hub runner: shell content: | echo "installing local hub packages" cocmd install -y ./cocmd-project/hub/packages echo echo "hub packages installed" echo "- this means that web you change local hub packages, you can test them locally" echo "run 'cocmd show packages' to see them" - title: open IDEs runner: shell approval_message: To open the code with VSCode? content: | # check if vscode not installed if code -v &> /dev/null then code cocmd-project else echo "vscode could not be found. open cocmd-project in your IDE of choice" fi - title: final message runner: markdown content: | ## All done! You're all set up to contribute to cocmd. ### How can you help? - [Add an Idea πŸ’‘πŸ’‘πŸ’‘ for a new playbook](https://github.com/cocmd/hub/issues/new) - [Code with us - πŸ”₯features / πŸ”₯bugs](https://github.com/cocmd/cocmd/contribute) - [Report a bug 🐞🧨🐞](https://github.com/cocmd/cocmd/issues/new) Thank you for your help! πŸ™πŸ™πŸ™ Join us on [Discord](https://discord.gg/PzaBZade)