Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Latest commit

 

History

History
334 lines (224 loc) · 9.29 KB

README.md

File metadata and controls

334 lines (224 loc) · 9.29 KB

Being a web developer is hard. You often find yourself asking stuff like:

  • How to setup this project?
  • Which script will start the compilation?
  • How to deploy?
  • How to sync between environments?

😩 These things can really slow down the process of development if they are not sufficiently documented.

By covering all necessary requirements for the development process automatically, Make-up gives you more time for creativity 🎨.

No matter what project you are working on, no matter what software is used. @see Make-up works with


Make-up does stuff like:

📦 Initial project setup after git clone

Make-up installs all required tools to get you started with development.

🏃‍♀️ Start developing process

Make-up controls all necessary background-processes so that you can focus on programming.

🚀 Deployment

Make-up shows you where and how you can successfully deploy your project.

♻️ Sync between environments

Make-up synchronizes databases and files between different environments.

And so much more.


Table of contents


Requirements

🖥 To run Make-up you need a terminal application which can run Linux commands.

Tested Operating Systems

OS Version
macOS Mojave 10.14.6

Tested Shells

Name Version
Terminal 2.9.5
iTerm2 3.3.7

Features

To list all available Make-up commands run

cd my-project

# Help
make help

make help

Make-up works with

Make-up automatically detects the following tools/software and attempts to perform related tasks.

Add Make-up to your project

  1. Add Make-up as a git submodule to your project:

    cd my-project
    git submodule add https://github.com/fork/make-up

    or get the latest files if Make-up is already listed in ../.gitmodules:

    cd my-project
    git submodule update --init
  2. Install Make-up

    cd make-up
    make install-make-up

    This will create a reference Makefile and a .env file. This enables you to use Make-up's Makefile from inside your project root directory.

    The .env file is where we will put sensible information like passwords etc. to synchronize and deploy from and to different environments (and other stuff). To avoid having this information in your project, make sure .env files are never added to your repository.

    💡 My project already contains a .env file, can I continue using that one?

    Yes you can. Just create a reference:

    cd my-project
    
    # remove .env file (generated by '$ make install-make-up')
    rm .env
    
    # create symbolic link to your real .env file
    ln -s path-to/.env .env
  3. Add this to your Readme

    **This project uses [Make-up](http://github.com/fork/make-up).**
  4. Add this to the description of your project setup

    After `$ git clone` run this command to enable _Make-up_ in your project:
    
    `$ git submodule update`
    
    Setup _Make-up_ as described [here](make-up/README.md#add-make-up-to-your-project).
  5. Now you may use Make-up from your project root:

    cd my-project
    make help

Customization

The scripts provided here contain general information to work for as many different project-setups as possible. All functions can therefore be modified, extended or overwritten.

Add a new command

You may add your custom Makefile methods to ./../Makefile:

## this comment will appear in `$ make help` as a description of 'foo'
foo:
  @echo Bar

They will automatically show up in when you run $ make help.

Run a script from a command

You may run a bash script from a Makefile command like so:

@./path-to/foo.bash

If you want to run an existing script from Make-up, use the following:

@./$(HELPER_SCRIPTS)/foo.bash

Access environmental variables

From within your Makefile, you have direct access to each variable stored in ../.env.

So if this was in your .env file:

FOO="bar"

you could call the variable FOO

  • in your custom bash script

    echo $FOO
  • or in your ../Makefile

    echo "$(FOO)"

Overwrite an existing command

You may overwrite an existing command in ../Makefile, by reusing a method name, already appearing in $ make help. You may continue as if you would add a new command.

Note: An overridden command will produce a warning (which is ok) like this:

Makefile:x: warning: overwriding commands for target `foo'
make-up/Makefile:123: warning: ignoring old commands for target `foo'
Bar

Extend an existing command

You may extend existing methods with custom bash scripts. To do so, you need to put them in a specific folder and structure:

cd my-project

# create directory
mkdir more-make-up

You may now mirror the structure of Make-up like so:

make-up
  → scripts
    → foo
      → bar.bash

more-make-up
  → scripts
    → foo
      → bar.bash

Whenever a script in Make-up is run – for example make-up/scripts/foo/bar.bash, Make-up tries to execute more-make-up/scripts/foo/bar.bash if it exists.

Create a new bash script

Begin every bash script with the following lines:

#!/bin/bash

# load helper
my_dir="$(dirname "$0")"
source "$my_dir/../../helper.bash"

After having the ./helper.bash loaded, you may access gloabl variables like colors, text-transforms, etc. to decorate your output.

Note: Before you can execute a bash script, set the correct permissions:

chmod +x foo.bash

Troubleshooting

Craft 3

Expand
Name Description
'HTTP 503 – Service Unavailable' after install ❓ If you installed Craft 3 and visit your sites Frontend, you will get a 503 error.
✅ Visit your sites Backend and follow the instructions.
💡 Use $ make info to get the URLs for Front- and Backend.
'HTTP 503 – Service Unavailable' after sync ❓ This error can also show up if you sync between environments.
✅ Restart the sync process.
Invalid working directory specified ❓ During installation this error message may come up: Invalid working directory specified, /var/www/html does not exist.
✅ Remove all docker containers and restart the project.

To Dos

  • 06.02.2020 Craft funktioniert nicht ohne unser docker setup, daher sollte das docker setup auch öffentlich verfügbar sein.

Fork Logo

Brought to you by Fork Unstable Media GmbH