Shopifly is a command-line utility that helps to enforce branch-theme parity.
At this time it is compatible only with config.yml
based Shopify Themekit
setups.
Shopifly requires the theme
command to be in your command line. See
installation instructions.
Add this line to your application's Gemfile:
gem 'shopifly'
And then execute:
$ bundle
Or install it globally using:
$ gem install shopifly
Shopi-fly requires two local files: config.stores.yml
and .current_store
.
These files should both be added to your .gitignore
.
The config.stores.yml
file tells it how to access the different stores you
own.
Sample Config:
# config.stores.yml
shared_config:
deploy_command: "theme deploy"
directory: ../shopify/
ignore_files:
- config/settings_data.json
stores:
default: "dev"
dev:
password: xxx
store: my-shop-dev.myshopify.com
qa:
password: xxx
store: my-shop-staging.myshopify.com
live
password: xxx
store: my-shop.myshopify.com
dev
The .current_store
file simply tells Shopifly which store you currently would like to
work with.
The .current_store
file should just be a one-line file with the name of the key from the stores
object in config.stores.yml
file that you'd currently like to work with. Using the .config.stores.yml
file above, possible values would be dev
, qa
, and live
.
You should add this file to your .gitignore
, and change it's value when you want to switch between stores.
Fly configures the local config.yml
to point to a theme that matches the current branch name.
It creates this theme if it does not exist.
Fly configures the build
, development
and production
keys of your
config.yml
to all point to this remote theme.
Note It is always important to quit any running file watch processes (i.e.
theme watch
) before switching branches.
$ git checkout -b new-branch
$ fly sync
"Theme doesn't exist, creating..."
"Setting config to point to new-branch, my-shop-dev.myshopify.com"
"Uploading theme!"
$ git checkout master
$ fly sync
"Theme already exists: master, mack-weldon.myshopify.com"
"Setting config to point to master, my-shop-dev.myshopify.com"
settings_data.json
from the currently published theme to an existing themeThis is useful if your theme does not have the latest settings_data.json
from the currently published theme.
$ git checkout existing-branch
$ fly sync --with-settings
"Downloading settings"
...
"Uploading settings"
Opens your shopify site with the current theme/branch
fly open
The fly sync
command performs the following:
Assuming we're on a branch called my-branch-theme
, and .current_store
==
dev
dev
store named my-branch-theme
.dev
store named my-branch-theme
.shared_config.deploy_command
from config.stores.yml
.--with-settings
flag is.current_store
andsettings_data.json
from the published theme to the my-branch-theme
config.yml
build
, development
and production
keys to pointIn this repo:
rake build
In another repo:
gem install --local ~/dev/lunchtime/shopifly/pkg/shopifly-X.X.X.gem
To install this gem onto your local machine and ruby version (found in
.ruby-version
), run bundle exec rake install
.
To release a new version, update the version number in version.rb
, and then
run bundle exec rake release
, which will create a git tag for the version,
push git commits and tags, and push the .gem
file to
rubygems.org.
GPL3 License, Lunchtime Labs LLC, 2020
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing