Commit d7097605 authored by Philipp Nowinski's avatar Philipp Nowinski

[FEATURE] backport from website base

parent 847841b1
......@@ -7,15 +7,23 @@
## Installation
Move the 'sg-cli' folder inside your project root and execute the install script.
Move the 'sgc-core' folder inside your project root and execute the install script.
```bash
./sg-cli/install.sh
./sgc-core/install.sh
```
### Local Installation
If you don't want to install the sgc command globally (e.g. in a server environment), just pass the --local flag to the install script.
```bash
./sgc-core/install.sh --local
```
## Configuration
To configure the frontend build process to you needs, you will have to modify the config.json inside the sg-cli/gulp folder.
To configure the frontend build process to you needs, you will have to modify the config.json inside the sgc-core/gulp folder.
### directories
......@@ -127,14 +135,14 @@ run this task on a regular basis to compress user uploaded media.
# Extending the sgc with your own modules
You can easily extend the sgc functionality by writing your own modules. Simply create a sgc-modules folder next to sg-cli
You can easily extend the sgc functionality by writing your own modules. Simply create a sgc-scripts folder next to sgc-core
and put your custom scripts in there. Right now only shell-scripts with are supported, other languages might follow in the future.
Execute your custom scripts by calling sgc <scriptName>
```
+ sg-cli
+ sgc-modules
+ sgc-core
+ sgc-scripts
- updateInstance.sh
- updateDeployData.sh
```
......@@ -151,7 +159,7 @@ sgc updateInstance
Please try to remove the npm-shrinkgwrap.json file and execute the following commands:
```bash
cd sg-cli
cd sgc-core
rm -rf node_modules
npm set registry http://registry.npmjs.org/
npm install
......
#!/bin/bash
. ./sg-cli/core/version.conf
. ./sg-cli/.sgc_version
. ./sgc-core/core/version.conf
. ./sgc-core/.sgc_version
if [ $SGC_VERSION != $INSTALLED_SGC_VERSION ]; then
echo -e "\n\033[0;31mYour installed sgc version does not match the one inside your project. Please execute the install.sh script.\033[0m\n";
......@@ -10,12 +10,12 @@ fi
if [ "$1" == "shortlist" ]; then
echo server images css css:sprites css:svg css:abovethefold images:uploaded js:compile js:qa js updateInstance updateDeployData updateProductionBranch shortlist;
elif [ -e "sg-cli/modules/$1.sh" ]; then
./sg-cli/modules/$1.sh
elif [ -e "./sgc-modules/$1.sh" ]; then
./sgc-modules/$1.sh
elif [ -e "sgc-core/modules/$1.sh" ]; then
./sgc-core/modules/$1.sh
elif [ -e "./sgc-scripts/$1.sh" ]; then
./sgc-scripts/$1.sh
else
cd sg-cli
cd sgc-core
. ~/.nvm/nvm.sh
# include version config
......
#!/bin/bash
if [ ! -e "./sg-cli/core/cli.sh" ]; then
echo -e "\n\033[0;31mWrong directory! Call this script from the directory that contains sg-cli!\033[0m\n";
exit 1;
if [ ! -e "./sgc-core/core/cli.sh" ]; then
if [ "$1" == "shortlist" ]; then
echo -e "";
else
echo -e "\n\033[0;31mWrong directory! Call this script from the directory that contains sgc-core!\033[0m\n";
exit 1;
fi
else
./sg-cli/core/cli.sh "$@"
./sgc-core/core/cli.sh "$@"
fi
......@@ -86,7 +86,7 @@ gulp.task('css:svg', function() {
return gulp.src(settings.getPath() + '/' + config.directories.svg + '/**/*.svg')
.pipe(plugins.svgmin())
.pipe(plugins.inlineSvg({
template: 'sg-cli/gulp/inline-svg-template.mustache'
template: 'sgc-core/gulp/inline-svg-template.mustache'
}))
.pipe(gulp.dest(settings.getPath() + '/' + config.directories.sass));
});
......
......@@ -11,15 +11,15 @@ echo -e "\n"
echo -e "\033[0;32mWelcome to the sgalinski CLI.\033[0m"
if [ ! -e ./sg-cli ]
if [ ! -e ./sgc-core ]
then
echo -e "\n\033[0;31mWrong directory! Call this script from the directory that contains the sg-cli folder! This is usually your project root directory.\033[0m\n";
echo -e "\n\033[0;31mWrong directory! Call this script from the directory that contains the sgc-core folder! This is usually your project root directory.\033[0m\n";
exit 1;
fi
echo -e "\033[0;32mSetup is in progress...\033[0m\n"
cd ./sg-cli
cd ./sgc-core
# check for nvm and install it if not present
echo -e "\033[0;32mSetup Node Version Manager...\033[0m\n"
......@@ -44,11 +44,18 @@ rm -rf ./node_modules
npm install --depth 0
echo -e "\033[0;32mDependencies installed ✓\033[0m\n"
# install cli globally
echo -e "\033[0;34mInstall sgc\033[0m";
echo -e "\033[0;34mYou need to grant permission in order to install the sgc command\033[0m";
sudo cp ./core/sgc /usr/local/bin
sudo cp ./core/autocompletion.sh /etc/bash_completion.d/sgc
if [ "$1" == "--local" ]; then
# install cli locally
echo -e "\033[0;34mInstall sgc\033[0m";
cp ./core/sgc ../sgc
else
# install cli globally
echo -e "\033[0;34mInstall sgc\033[0m";
echo -e "\033[0;34mYou need to grant permission in order to install the sgc command\033[0m";
sudo cp ./core/sgc /usr/local/bin
sudo cp ./core/autocompletion.sh /etc/bash_completion.d/sgc
fi
# store current version number
. ./core/version.conf
......@@ -60,7 +67,7 @@ echo -e "\033[0;32msgc installed ✓\033[0m\n"
echo -e "\033[0;32mYou can now use the 'sgc' command inside your project root.\033[0m\n"
echo -e "\033[0;32mRestart your shell in order to activate the autocompletion feature.\033[0m\n";
if [[ $SHELL == *"zsh"* ]]
if [[ $SHELL == *"zsh"* && "$1" != "--local" ]]
then
echo -e "\033[0;34mIt seems like you are using zsh.\033[0m";
echo -e "\033[0;34mYou might want to put these lines in your .zshrc-file to enable sgc autocompletion\033[0m";
......
......@@ -10,7 +10,7 @@
"toolchain:upgrade": "rm -rf node_modules && rm npm-shrinkwrap.json && npm install && npm shrinkwrap --dev",
"toolchain:update": "rm -rf node_modules && npm install"
},
"license": "LICENSE.md",
"license": "SEE LICENSE IN LICENSE.md",
"devDependencies": {},
"engines": {
"node": "~6.3.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment