GithubHelp home page GithubHelp logo

docker-grav's Introduction

GRAV dockerized

Folders with only version numbers contain the bare CMS, others are named based on the skeleton packages. Each CMS comes with the admin and git-sync plugin.

If you, like me, want to easily modify the themes and other assets, without the need of direct access to the server, you can change the default configuration of the git-sync plugin, based on the comments described in trilbymedia/grav-plugin-git-sync#21. Here is the TL;DR; version:

  • After starting the docker container on a server go the the admin plugin page and configure git-sync
  • Connect via SSH and change to the directory where you mounted the /var/www/html volume to modify 3 files
  • Make sure the user/.gitignore contains the following lines:
/*
!/pages
!/accounts
!/config
!/data
!/plugins
!/themes
  • Make sure user/config/plugins/git-sync.yaml contains the following lines:
enabled: true
text_var: 'Custom Text added by the **Git Sync** plugin (disable plugin to remove)'
folders:
  - pages
  - accounts
  - config
  - data
  - plugins
  - themes
... REST STAYS THE SAME ...
  • Make sure user/.git/info/sparse-checkout contains the following lines:
pages/
pages/*
accounts/
accounts/*
config/
config/*
data/
data/*
plugins/
plugins/*
themes/
themes/*
  • Use git on your server or through the container in the user sub folder, to commit the new changes
  • Congratulations, now you can modify plugins, data, themes and accounts from a different machine, and just sync via git back to your grav CMS instance

The above modifications converted into a bash script:

#Add gitignore
echo '' >> user/.gitignore
echo '!/accounts' >> user/.gitignore
echo '!/config' >> user/.gitignore
echo '!/data' >> user/.gitignore
echo '!/plugins' >> user/.gitignore
echo '!/themes' >> user/.gitignore

#Add config/git-sync file
sed -i '5i \ \ - accounts' user/config/plugins/git-sync.yaml
sed -i '5i \ \ - config' user/config/plugins/git-sync.yaml
sed -i '5i \ \ - data' user/config/plugins/git-sync.yaml
sed -i '5i \ \ - plugins' user/config/plugins/git-sync.yaml
sed -i '5i \ \ - themes' user/config/plugins/git-sync.yaml

#Add to git checkout
echo '' >> user/.git/info/sparse-checkout
echo 'accounts/' >> user/.git/info/sparse-checkout
echo 'accounts/*' >> user/.git/info/sparse-checkout
echo 'config/' >> user/.git/info/sparse-checkout
echo 'config/*' >> user/.git/info/sparse-checkout
echo 'data/' >> user/.git/info/sparse-checkout
echo 'data/*' >> user/.git/info/sparse-checkout
echo 'plugins/' >> user/.git/info/sparse-checkout
echo 'plugins/*' >> user/.git/info/sparse-checkout
echo 'themes/' >> user/.git/info/sparse-checkout
echo 'themes/*' >> user/.git/info/sparse-checkout

docker-grav's People

Contributors

fclaeys avatar flojon avatar pgrm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.