Skip to content

Instantly share code, notes, and snippets.

@Prophe1
Created June 11, 2019 15:14
Show Gist options
  • Save Prophe1/bf02adbe62e3922093ca23a70c2d35a0 to your computer and use it in GitHub Desktop.
Save Prophe1/bf02adbe62e3922093ca23a70c2d35a0 to your computer and use it in GitHub Desktop.
Deploy project(Sage, Bedrock) with CircleCI to Kinsta
#! /bin/bash
if [ -z "$1" ]
then
echo "No branch supplied"
exit 1
fi
if [ -z "$2" ]
then
echo "No theme name set"
exit 1
fi
branch_name=$1
theme_name=$2
env_file="public/.env"
if [ -f "$env_file" ]
then
echo "Project ENV file found"
else
echo "Project ENV file not found"
exit 1
fi
echo "Deploying $branch_name | Theme $theme_name"
cd public/
git config --global user.email "ENTER EMAIL"
git config --global user.name "ENTER NAME"
git fetch --all
git reset --hard origin/"$branch_name"
git pull origin "$branch_name"
git checkout "$branch_name"
echo "TASK: Git PULL Finished"
composer install --no-dev --optimize-autoloader
echo "TASK: Project Composer install Finished"
cd web/app/themes/"$theme_name"/
composer install --no-dev --optimize-autoloader
echo "TASK: Theme Composer install Finished"
yarn
echo "TASK: Theme Yarn Dependencies Finished"
yarn build:production
echo "TASK: Theme Build Production Finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment