Skip to content

Build Expert helps the developers by building Spring Boot projects with the Maven package manager with the ability to switch the desired git branch and create compressed artifacts to any given directory by its user. Also, can take additional arguments to skip tests or enable/disable debug and quiet mode.

Notifications You must be signed in to change notification settings

huyagci/buildexpert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Protein DevOps Engineer Bootcamp

Project of the Second Week

Built with;

Linux Bash Git VirtualBox Vagrant

#️⃣ Assignment

Create a bash script that helps the developer to build a project1 on a specified branch in a working git repository.

Script has to be able to ;

  • Switch between branches and build from a given branch upon user requests.
  • Warn the user if the branch is main or master.
  • Create a new branch upon user requests.
  • Enable/disable debug mode of maven. (Default must be disabled)
  • Allow users to specify the compressed archive format as "zip" or "tar.gz" formats. (Default must be "tar.gz")
  • Terminate if any other compressed algorithms are given. (Must use the default if not specified)
  • Set the archive name as the selected branch name.
  • Set the output directory for compressed archives upon user requests. (Default must be the working directory)

📖 Table of Contents

  1. Overview
  2. Features
  3. Installation
  4. Usage
  5. Technologies
  6. Directories
  7. Submitted Assignment

📔 Overview 🔝

This repository contains an assignment project developed under the Patika.dev & Protein DevOps Engineer Bootcamp. Bootstrapper is an initializer script that sets up the machine as instructed. Git Buddy is an auxiliary script to manage multiple git instances and was originally not a part of the assignment. Build Expert is the main script that is coded by the terms of the project.

Features 🔝

Bootstrapper

  • Sets the timezone of the machine as UTC+3 (Europe/Istanbul) and enables Network Time Protocol.
  • Downloads the latest package information.
  • Downloads, installs, and configures Java 18, Apache Maven 3.8.5 , and the latest version of Git SCM.
  • Sets the environment variables for the stated technologies above.
  • Sets the permissions of the script files.
  • Defines system-wide aliases for the scripts for easy use.

 

Git Buddy Branding Image

Git Buddy

  • The main goal of this script is to assist the Build Expert script by managing multiple git repositories simultaneously.
  • Searches for all initialized git repositories under the project directory.
  • Can terminate all git repositories at the same time.
  • Can initialize git instances for all directories under the project directory simultaneously.

 

Build Expert Branding Image

Build Expert

  • Manages git and maven package manager to fulfill the tasks given by the user.
  • Switches between branches and build the project depending on the user requests.
  • Warns the user if the branch is main or master.
  • Creates a new branch and build the project from it if specified.
  • Enables or disables maven debug mode and quiet mode. Also can skip tests.
  • Can create compressed artifacts of the project as "zip" or "tar.gz" formats.
  • Renames the archive files as branchName.zip or branchName.tar.gz automatically.
  • Sets output directory to user-specified directory.
  • Cleans the target directory of the maven project.

⚙️ Installation 🔝

Automated
  1. Install VirtualBox and Vagrant to your machine if you do not have them.
  2. Clone the project to your machine.
  3. Open your CLI, change directory to project directory, and type vagrant up.
  4. Vagrant will configure the virtual machine first then you may test the project.
Manual
  1. Download all of the project files.
  2. Copy all scripts under the /shared/scripts and sample project from /shared/project/java to your environment.
  3. Execute bootstrap.sh first to configure the machine settings.
  4. Run the scripts with the aliases configured or manually from the directories that are stated below.

🔧 Usage 🔝

  • Built-in aliases are gitbuddy and buildexpert. You may execute them if you executed bootstrap.sh first.
  • Optionally, you may call the scripts from any directory with an acceptable arguments that are stated below.
  • The target directory of Git Buddy scripts is /opt/project directory.
  • The target directory of Build Expert scripts is /opt/project/java directory.
  • You can change these settings by re-defining the TARGET_DIR variable within the scripts.
Parameters
OPTIONS:    ARGUMENTS:         DESCRIPTION:                             DEFAULT VALUE:

[-b]        <branch_name>      Branch name to get the build from.       Current Branch
[-f]        <zip|tar.gz>       Compress format of the artifact.         tar.gz
[-p]        <artifact_path>    Output path of compressed artifacts.     Current Directory
[-n]        <new_branch>       Creates a new branch if applied.

[-q]        <true|false>       Enable or disable quiet mode.            Enabled
[-d]        <true|false>       Enable or disable debug mode.            Disabled
[-t]        <true|false>       Apply or skip tests.                     Skip

[-c]                           Cleans the maven project if applied.
[-h]                           Shows usage/help.

💻 Technologies 🔝

  • Linux
  • Bash Scripting ❤️
  • Git SCM
  • Oracle VM VirtualBox
  • Vagrant by HashiCorp

📂 Directories 🔝

Scripts             : /opt/scripts
Project Samples     : /mnt/project

💾 Submitted Assignment 🔝

You may check out the submitted version of this project here.

View Counter

Footnotes

  1. Java Spring Boot with Maven Package Manager is provided as a sample project and the script is built upon this configuration. (Can be modified to any other project)

About

Build Expert helps the developers by building Spring Boot projects with the Maven package manager with the ability to switch the desired git branch and create compressed artifacts to any given directory by its user. Also, can take additional arguments to skip tests or enable/disable debug and quiet mode.

Topics

Resources

Stars

Watchers

Forks