Skip to content

Commit 05a3b91

Browse files
committed
initial commit
0 parents  commit 05a3b91

File tree

7 files changed

+133
-0
lines changed

7 files changed

+133
-0
lines changed

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# IntelliJ / PhpStorm
2+
.idea/*
3+
*.ipr
4+
*.iml
5+
*.iws
6+
7+
# Bootstrap
8+
app/bootstrap*
9+
10+
# Symfony directories
11+
vendor/*
12+
*/logs/*
13+
*/cache/*
14+
web/uploads/*
15+
web/bundles/*
16+
17+
# Configuration files
18+
app/config/parameters.ini
19+
app/config/parameters.yml
20+
21+
# Composer
22+
composer.phar

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Helpful
2+
=======
3+
4+
A repository of helpful scripts... and stuff.

git_hooks/post-receive.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
export GIT_WORK_TREE=/var/www/html/yoursite.tld
4+
export GIT_DIR=/var/git/yoursite.git
5+
6+
git --work-tree=$GIT_WORK_TREE --git-dir=$GIT_DIR checkout -f
7+
8+
while read oldrev newrev refname
9+
do
10+
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
11+
if [ "master" == "$branch" ]; then
12+
echo "updating vendors..."
13+
rm -rf $GIT_WORK_TREE/vendor
14+
cd $GIT_WORK_TREE
15+
export SYMFONY_ENV=prod
16+
composer install --optimize-autoloader
17+
else
18+
git merge $refname
19+
echo "skipping vendors..."
20+
cd $GIT_WORK_TREE
21+
export SYMFONY_ENV=prod
22+
fi
23+
done
24+
25+
26+
echo "Setting Symfony production settings..."
27+
php app/console cache:clear --env=prod --no-debug
28+
php app/console assetic:dump --env=prod --no-debug

git_hooks/readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a quickly hacked together post-receive git hook file to allow master branch to recreate vendors, but also allow other branches to merge in without replacing vendors. Useful on servers with low ram primarily. Use at your own risk.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = function (grunt) {
2+
grunt.initConfig({
3+
exec: {
4+
run_only_unit_tests: {
5+
cmd: 'php vendor/codeception/codeception/codecept run unit'
6+
}
7+
},
8+
watch: {
9+
test: {
10+
files: ['tests/unit/**/*.*'],
11+
tasks: ['exec']
12+
}
13+
}
14+
});
15+
16+
grunt.loadNpmTasks('grunt-contrib-watch');
17+
grunt.loadNpmTasks('grunt-exec');
18+
};
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Installation instructions for Ubuntu
2+
3+
The following instructions are for installing the pre-requisites to automatically run your codeception tests whenever a file is changed, in the "watched" folders on your server.
4+
5+
There are some troubleshooting steps at the bottom of this file.
6+
7+
If you're using an older version of Ubuntu, you may need to update:
8+
9+
sudo apt-get update -y && sudo apt-get upgrade -y
10+
11+
Run the above if you experience any strange 404 ip not found errors when carrying out the following:
12+
13+
* sudo apt-get install nodejs
14+
* sudo apt-get install npm
15+
* sudo npm install -g grunt-cli
16+
* copy package.json to your web / project root folder
17+
* copy gruntfile.js to your web / project root folder
18+
* from your web / project root folder, run:
19+
* sudo npm install
20+
21+
To start, run:
22+
23+
grunt watch
24+
25+
See below if this throws an error.
26+
27+
This will take over your console session until you cancel (ctrl+c).
28+
29+
Now, whenever a file in a 'watched' folder (anything in 'tests/unit/*' by default) changes, the codeception unit tests will re-run automatically.
30+
31+
Feel free to edit, change, hack to your hearts content.
32+
33+
34+
## Troubleshooting
35+
36+
### FIX - /usr/bin/env: node: No such file or directory
37+
38+
Do one of the following:
39+
40+
sudo apt-get install nodejs-legacy
41+
42+
or
43+
44+
sudo ln -s /usr/bin/nodejs /usr/bin/node
45+
46+
47+
### Strange 404 ip not found errors during 'sudo apt-get install npm'
48+
49+
Likely your installation of Ubuntu is old.
50+
51+
Re-run: sudo apt-get update -y && sudo apt-get upgrade -y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "automated_testing",
3+
"version": "1.0.0",
4+
"devDependencies": {
5+
"grunt": "~0.4.2",
6+
"grunt-contrib-watch": "~0.5.3",
7+
"grunt-exec": "~0.4.5"
8+
}
9+
}

0 commit comments

Comments
 (0)