Skip to content

[WIP] Management/Admin scripts for the project #971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 4, 2016
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .eslintrc

This file was deleted.

8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- travis_retry npm install -g grunt-cli
- travis_retry npm install
- travis_retry pip install -r requirements.txt
- cp config/secrets.py.example config/secrets.py
- travis_retry npm run pip
- travis_retry npm run config
# lint python
- pep8 --ignore=E402 webcompat/ tests/ config/secrets.py.example
- git submodule init && git submodule update
- npm run module
- python run.py -t &

before_script:
- "sleep 2"
# lint JS in default eslint task
- grunt
- npm run build

# now run the tests!
# if this is a pull request from a fork, TRAVIS_SECURE_ENV_VARS will be false, so
Expand Down
19 changes: 9 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ You'll probably want to [set up a local development environment](#working-enviro

* Create your patch; commit your changes. Referencing the issue number you're working on from the message is recommended.

`git commit -m 'Issue #123 - Fixes broken layout on mobile browsers`
`git commit -m 'Issue #123 - Fixes broken layout on mobile browsers`

* Push your branch to GitHub:

`git push origin name-of-fix-branch`
`git push origin name-of-fix-branch`

* If you want to discuss your code or ask questions, please comment in the corresponding issue. You can link to the code you have pushed to your repository to ask for code review.

Expand Down Expand Up @@ -187,7 +187,7 @@ We do not use frameworks. However we use libraries, such suitcss-components-grid

The js folder contains two subfolders: `lib` contains all project source files and `vendor` contains all third party libraries. The files out of the two sub folders contain the compiled source code.

__Note: All code changes should be made to the files in `lib`__
__Note: All code changes should be made to the files in `lib`__

@@something to write by miketaylr@@

Expand Down Expand Up @@ -222,10 +222,9 @@ git clone https://github.com/<username>/webcompat.com.git #replace your github u
# change to directory
cd webcompat.com
# check out submodules
git submodule init
git submodule update
npm run module
# initializing project
[sudo] make install
[sudo] npm init
```

**Note**: if you got an error message, you may need to [install pip](#installing-pip) before running `make install` again.
Expand Down Expand Up @@ -341,7 +340,7 @@ or

``` bash
# start local server
make start
npm run start
```

You should now have a local instance of the site running at `http://localhost:5000/`. Please [file bugs](https://github.com/webcompat/webcompat.com/issues/new) if something went wrong!
Expand All @@ -358,21 +357,21 @@ You need to build the project before serving it from a webserver will work, and
You can build the entire project (CSS and JavaScript files and optimize images) by executing this command on Mac/Linux:

``` bash
make build
npm run build
```

and this on Window:

``` bash
grunt
npm run watch
```

## Coding


``` bash
# watching CSS and JS
make watch
npm run watch
```

By default, a build will *not* optimize images (which is done before deploys). If you'd like to do that, you can run `grunt imagemin`.
Expand Down
24 changes: 0 additions & 24 deletions Makefile

This file was deleted.

File renamed without changes.
59 changes: 59 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,64 @@
"postcss-url": "^5.1.1",
"suitcss-utils-align": "^0.2.0",
"suitcss-utils-display": "^0.4.0"
},
"scripts": {
"init": "npm run module && npm run virtualenv && && npm run pip && npm install && npm run config",

This comment was marked as abuse.

"watch" : "grunt watch",
"build": "grunt",
"module": "git submodule init && git submodule update",
"start": "source env/bin/activate && python run.py",
"virtualenv" : "pip install virtualenv && virtualenv env && source env/bin/activate",
"pip": "pip install -r config/requirements.txt",
"config": "cp config/secrets.py.example config/secrets.py",
"project-update": "pip install --upgrade pip && npm run backend-install && npm update"
},
"eslintConfig": {
"env": {
"browser": true
},
"extends": "eslint:recommended",
"globals": {
"jQuery": true,
"$": true,
"_": true,
"Backbone": true,
"console": true,
"define": true,
"issueNumber": true,
"markdownitEmoji": true,
"markdownitSanitizer": true,
"md": true,
"module": true,
"moment": true,
"Mousetrap": true,
"PaginationMixin": true,
"Prism": true,
"qr": true,
"repoPath": true,
"require": true,
"wcEvents": true
},
"rules": {
"comma-dangle": 0,
"curly": [2, "all"],
"eqeqeq": [2, "smart"],
"indent": [2, 2],
"linebreak-style": [2, "unix"],
"new-cap": 2,
"no-cond-assign": 0,
"no-spaced-func": 2,
"no-use-before-define": 2,
"one-var": [2, "never"],
"quotes": [2, "single"],
"semi": [2, "always"],
"space-after-keywords": 2,
"space-before-blocks": 2,
"space-before-function-paren": [2, "never"],
"space-before-keywords": [2, "always"],
"space-infix-ops": 2,
"space-return-throw-case": 2,
"space-unary-ops": 2
}
}
}
2 changes: 1 addition & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def check_pip_deps():
Make sure that the installed pip packages match what is in
requirements.txt, prompting the user to upgrade if not.
'''
for req in open("requirements.txt"):
for req in open("./config/requirements.txt"):
try:
pkg_resources.require(req)
except VersionConflict as e:
Expand Down
3 changes: 0 additions & 3 deletions webcompat.sh

This file was deleted.