Skip to content

SwingDev/bootstrap-bootstrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bootstrap Bootstrap

Requirements

  • Bash
  • Docker
  • Git

Installation

To start working with bootstrap simply clone bootstrap repository with our repository upstream renamed to upstream. It will help you get the updates from our repository while keeping your changes for your project.

git clone git@github.com:SwingDev/bootstrap-bootstrap.git . -o upstream

Self-update

Script updates itself automatically on a daily basis.

Usage

The repository consists of three main components:

  • modules.txt - which points to all dependent repositories
  • docker-compose.yml - which describes how the components should build and interact
  • boostrap.sh - main script for managing and running the project

Fetching all the dependencies

To fetch all dependencies simply run:

./bootstrap.sh

Running / rebuilding project

To run the project simply use up command:

./bootstrap.sh up

Optionally you can pass a list of services to be rebuilt:

./bootstrap.sh up api web

Building only

You can just build the services without starting them up:

./bootstrap build

As with other commands you can specify which services to build

./bootstrap build api

Logs

To see the logs use the logs command:

./bootstrap.sh logs

To see logs from only a couple of services, pass their names as arguments:

./bootstrap.sh logs api web

Running commands on containers

You can run arbitrary commands within running containers via:

./bootstrap.sh exec api /bin/sh

The above example will start a shell on the api service.

Stopping the project

To stop the project simply use down command:

./bootstrap.sh down

Stopping will delete all containers and all network leftovers, so make sure to mount everything you need persisted.

Checking branches

To check on which branch each of the modules is, simply use the following command:

./bootstrap.sh branch
# Example of the output
frontend:       master
backend:        feature/#54
pdf-generator:  master

Checking statuses

To check status of all the modules, use the following command:

./boostrap.sh status
# Example of the output
frontend:
     On branch master
     Your branch is up-to-date with 'origin/master'.
     nothing to commit, working tree clean
 backend:
      On branch master
      Your branch is up-to-date with 'origin/master'.
      Untracked files:
        (use "git add <file>..." to include in what will be committed)

      	new-file.txt

      nothing added to commit but untracked files present (use "git add" to track)
pdf-generator:
     On branch master
     Your branch is up-to-date with 'origin/master'.
     nothing to commit, working tree clean

Custom docker-compose.yml location

It is possible to specify custom docker-compose.yml location. It might be useful if you have few configurations with different settings - for example configuration with frontend live-reload, backend live-reload or verbose output or different configuration for your CI with different ports binding. To do that, use -c parameter for any command:

./bootstrap.sh -c docker-compose.frontend.yml up

Setup

Adding new dependency

To add new dependency, simply use:

./bootstrap.sh add-module <repository-url> <directory>

This will add new line to modules.txt, fetch the repository and add its directory to bootstrap's .gitignore. If fetched repository constains .docker-compose.template.yml, it will be appended to your docker-compose.yml file. In future versions we plan to extend this with templating mechanism, for now it is just pasting the content with the proper indentation (name of the container is set to the name of the directory you provide for the command).

In the template, you can use <PROJECT_DIR> template string which will be replaced with a directory name where the project will be fetched. You can use it to setup docker volumes correctly for example.

Authors

The tool is an Open Sourced version of the tool we are using internally in SwingDev.

Contribution

We are open to your pull requests! If you want to improve the project, simply create a new pull request describing in detail new functionality, including update to this readme.

License

This software is provided under MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages