Skip to main content

A generic makefile for projects.

Project description

sumake

Install

docker-run-remote

Introduction

sumake is an extension of make that simplifies deployment tasks by providing integrated, convenient operations. It makes the deployment process effortless and efficient. With sumake, you can easily build, run, and manage your Docker containers both locally and remotely. The commands are straightforward and designed to save you time and effort.

Feature

  • Remote Docker Operations: Build images and run containers on remote servers seamlessly using "remote access for Docker" (docker-build-remote, docker-run-remote).
    • Automatic Restart Container: Automatically build on the server, automatically restart containers. Simple, hassle-free, effortless!
    • Simplified Workflow: Provides intuitive make targets abstracting complex Docker commands.
    • Environment Variable Integration: Easily configure builds and runs using environment variables and .env.make files.
    • Multi-Server Deployment: Supports one-click deployment to multiple servers, simplifying the process of managing and scaling your applications across different environments.

Install

  1. Install GNU Make

  2. install pip

  3. pip install sumake -U
    

docker-run-remote

Example

.env.make

DOCKER_REPOSITORY=sucicada
DOCKER_SERVICE_NAME=japanese-red-blue-book
#DOCKER_SERVICE_PORT=9096
DOCKER_HOST=server.sucicada.me
DOCKER_RUN_OPTS="-p 9086:80"

run at the root of the project:

sumake docker-run-remote

it same as :

DOCKER_HOST=server.sucicada.me \
    docker build -t \
    sucicada/japanese-red-blue-book:latest .

DOCKER_HOST=server.sucicada.me \
    docker stop japanese-red-blue-book 

DOCKER_HOST=server.sucicada.me \
    docker rm japanese-red-blue-book 

DOCKER_HOST=server.sucicada.me \
    docker run -d --name japanese-red-blue-book \
    -p 9086:80 \
    sucicada/japanese-red-blue-book:latest

Prerequisites

  • Remote Access for Docker: Ensure that the Docker daemon on the remote server is configured to accept remote connections. https://docs.docker.com/engine/daemon/remote-access/
    Once configured, you can check the access to the remote server by running:
    sumake docker-info-remote
    
    If you see the correct remote docker info, it means the remote access for Docker is working.

How to use

  1. go to the root of the project.

  2. Set the environment variables in the .env.make file. Configuration reference

  3. Run the command:

    sumake docker-run-remote
    
  4. You can see the remote docker build logs

Environment Variables:

  • DOCKER_SERVICE_NAME: (required) The name of the docker container.
  • DOCKER_SERVICE_PORT: (optional) The port of the docker container. You can set it when you want to expose the port of the docker container. (Equal to docker command: "-p <port>:<port>")
  • DOCKER_HOST: (required) The host of the docker server. Remember to set remote access for Docker on the server. remote access for Docker
  • DOCKER_REPOSITORY: (optional) The Docker repository name. Defaults to your Docker Hub username if not set. Used to tag the image (e.g., <DOCKER_REPOSITORY>/<DOCKER_SERVICE_NAME>:latest).
  • DOCKER_RUN_OPTS: (optional) Additional options for the docker run command (e.g., "-p 8080:80 -v /data:/app/data"). This allows for flexible configuration like port mapping, volume mounting, etc.

Install GNU Make

macOS:

brew install make

Ubuntu / Debian / Linux Mint:

sudo apt-get install make

Red Hat / Fedora / CentOS:

sudo yum install make

Arch Linux:

sudo pacman -S make

dev

(For project development)

make install

pip install .

Note: make install assumes a local development setup and might require a Makefile in the project root.

zsh

~/.zshrc

autoload -U compinit
compinit
_sumake() {
_make "$@"
}
compdef _sumake sumake
zstyle ':completion::complete:sumake:*:targets' call-command true

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sumake-0.3.2.tar.gz (9.9 kB view details)

Uploaded Source

File details

Details for the file sumake-0.3.2.tar.gz.

File metadata

  • Download URL: sumake-0.3.2.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.10

File hashes

Hashes for sumake-0.3.2.tar.gz
Algorithm Hash digest
SHA256 2431afa2e44e3caf6cd9fa79b4f8cdb3303451cf3d0184ff4b9557939ffb9d8b
MD5 55541ea2a96bc1bedaf356f60b3b4fd5
BLAKE2b-256 7de707e527aee136a5418ba7f5d36380d2f083dc891faa2d38ea0c69692f99dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page