Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Walle Web Deployment System: Installation, Configuration, and Usage Guide

Tech May 15 1

Overview

Walle is a web-based deployment platform that streamlines the process of releasing code to production environments. It offers a clean interface and out-of-the-box functionality for managing deployments across multiple projects and environments.

Key Features

  • User authentication with role-based access control
  • Deployment workflow with approval mechanisms
  • Multi-project support with parallel task execution
  • Git and SVN version control integration
  • Quick rollback capabilities
  • Pre-deployment validation (pre-deploy tasks)
  • Post-deployment operations (post-deploy tasks like vendor installation)
  • Pre-release and post-release task hooks (service restarts)
  • SQL script execution support
  • File fingerprint verification

Architecture

The deployment architecture involves three key components:

  1. Code Repository - Git or SVN hosting services like GitHub or GitLab
  2. Deployment Server - The host machine where Walle runs, serving as the intermediary between code repositories and target servers
  3. Target Servers - Production or staging servers receiving the deployed code

The deployment server must establish SSH key trust relationships with both the code repository and all target machines. This enables secure, passwordless communication during the deployment process.

Deployment Procedure

Environment Requirements

  • Linux operating system with Bash (git, ssh)
  • Python 3.5+ or Python 2.7+
  • MySQL 5.6.5 or higher
  • All target servers must be accessible via SSH from the deployment server

Step 1: Database Setup

mysql -uroot -p
CREATE DATABASE walle DEFAULT CHARSET utf8;
GRANT ALL PRIVILEGES ON walle.* TO walle@'localhost' IDENTIFIED BY '123456';
FLUSH PRIVILEGES;

Step 2: Source Code Checkout

[root@localhost ~]# mkdir -pv /data/web/ && cd /data/web
[root@localhost web]# git clone https://github.com/meolu/walle-web.git

Step 3: Dependency Installation

# Update package repositories (CentOS 7 example)
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all && yum makecache

# Install required packages
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y mariadb-devel gcc gcc-c++ python-devel

Step 4: Configuration

Modify the production configuration file:

[root@localhost walle-web]# vim walle/config/settings_prod.py

# Server configuration
HOST = '192.168.56.11'
PORT = 5000
SSL = False

# Database connection
SQLALCHEMY_DATABASE_URI = 'mysql://walle:walle@localhost:3306/walle?charset=utf8'

# Code checkout path
CODE_BASE = '/tmp/walle/codebase/'

# Log file location
LOG_PATH = os.path.join(Config.PROJECT_ROOT, 'logs')

# Email notification settings
MAIL_SERVER = 'smtp.exmail.qq.com'
MAIL_PORT = 465
MAIL_USE_SSL = True
MAIL_USERNAME = 'service@walle-web.io'
MAIL_PASSWORD = 'Ki9y&3U82'

Step 5: Nginx Configuration

upstream webservers {
    server 192.168.56.11:5000 weight=1;
}

server {
    listen       82;
    server_name  192.168.56.11;
    index index.php index.html index.htm;
    
    location / {
        try_files $uri $uri/ /index.html;
        add_header access-control-allow-origin *;
        root /data/web/walle-web/fe;
    }

    location ^~ /api/ {
        add_header access-control-allow-origin *;
        proxy_pass      http://webservers;
        proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
    }

    location ^~ /socket.io/ {
        add_header access-control-allow-origin *;
        proxy_pass      http://webservers;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Step 6: Initialize and Start

[root@localhost walle-web]# sh admin.sh init
[root@localhost walle-web]# sh admin.sh migration
[root@localhost walle-web]# sh admin.sh start

Default credentials after installation:

Prerequisites Before Deployement

SSH Key Configuration

The PHP process user (typically www) on the deployment server must have SSH access to the Git repository. Add the user's public key to the Git server's deploy keys:

[www@linux-node1 ~]$ cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ... www@linux-node1.example.com

Additionally, configure passwordless SSH access from the deployment server to all target machines:

[www@linux-node1 ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub www@192.168.56.12
[www@linux-node1 ~]$ ssh www@192.168.56.12
Last login: Thu Jan 25 10:30:45 2018 from linux-node1

On target servers, prepare the version repository directory for rollback capabilities:

[root@localhost ~]# mkdir /opt/shop/version -p

User Roles and Permissions

Walle 2.x implements a role-based access control model:

  • SUPER - Platform administrators managing spaces and initial setup
  • OWNER - Busines line owners managing projects within their space
  • MASTER - Department leaders or project leaders handling deployment reviews
  • DEVELOPER - Regular users submitting deployment requests
  • REPORTER - Read-only access for viewing deployments

A user must be assigned to a space before logging into the system.

Project Configuration

Environment Setup

Configure multiple environments (development, staging, production) with appropriate settings.

Server Configuration

Add target servers to the system. Each server needs SSH connectivity from the deployment server.

Project Setup

Create projects and link them to Git repositories. Configure branch selection and deployment paths.

Advanced Task Configuration

Custom deployment hooks for various stages:

Java Application Example:

# Pre-deployment task
echo pre_deploy >> /tmp/cmd

# Post-deployment task
mvn package -Dmaven.test.skip=true
mvn clean
mv WEB-INF/config.Properties.test WEB-INF/config.Properties
rm -rf src

# Pre-release task
./xx.sh stop

# Post-release task
./xx.sh start

Deployment Workflow

  1. Create Deployment Request - Developer submits a deployment ticket through the web interface
  2. Review Process - Owner or Master reviews and approves the deployment request
  3. Execute Deployment - Upon approval, click deploy to initiate the deployment process
  4. Verification - Check that files are correctly deployed to target servers

After deployment, target servers will have symbolic links pointing to versioned release directories:

[www@linux-node2 web]$ ls -la
total 0
lrwxrwxrwx 1 www www 37 Jan 25 14:40 jxs -> /data/jxs/release/jxs/20180125-144001
lrwxrwxrwx 1 www www 37 Jan 25 14:40 wap -> /data/wap/release/wap/20180125-144026
lrwxrwxrwx 1 www www 37 Jan 26 09:45 www -> /data/www/release/www/20180126-094529

Rollback Process

To revert to a previous version, use the rollback feature in the web interface. The system maintains version history and allows reverting to any previous release by updating the symbolic links.

Troubleshooting

If deployment issues occur, check the runtime log file at logs/runtime.log for detailed error messages and stack tracees.

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.