[ jenkins ] Role Strategy Plugin

ref : https://wiki.jenkins.io/display/JENKINS/Role+Strategy+Plugin

Setup

1.Manage Jenkins > Manage and Assign Roles > Manage Roles > Project roles

Role

roleName

Pattern

jobsFolderName.*

Job

check the following checkbox

Build Cancel Configure Create Delete Discover Move Read Workspace

Replay

check the following checkbox

Delete Replay Update

SCM

check the following checkbox

Tag

 

2. Manage Jenkins > Manage and Assign Roles > Assign Roles > Item roles

Add user, then check the roleName checkbox for each user

Advertisements

[ mbtest ] mock server

run server

mb --configfile imposters.ejs --allowInjection

imposters.ejs

{
"imposters": [
,
]
}

originServer.ejs

{
"port": 5555,
"protocol": "http",
"name": "whatever",

"recordRequests": false,

"stubs": [
{
"predicates": [{
"equals": {
"method": "GET",
"path": "/whatever/whatever"
}
}],
"responses": [{ "is": { "body": "" }}]
},
{
"responses": [{ "inject": "function (request, state) { let d = []; for(let i=1; i <= 20; i++) { d.push({ title: `Pizza-${i}`, price: 99, address: 'lorem ipsum', ref: 'REST' }) }; return { body: d }; }" }]
}
]
}

ref : http://www.mbtest.org/docs/commandLine#config-file

[ MySQL ] disable ONLY_FULL_GROUP_BY

Problem

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘db.table.col’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

check whether it is there

ONLY_FULL_GROUP_BY

mysql> SELECT @@sql_mode;
+---------------------------------------------------------------+
| @@sql_mode |
+---------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+---------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
Query OK, 0 rows affected (0.02 sec)

mysql> SELECT @@sql_mode;
+--------------------------------------------+
| @@sql_mode |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+
1 row in set (0.00 sec)

ref : https://stackoverflow.com/questions/23921117/disable-only-full-group-by

import csv to mysql

#!/bin/bash
db_name=scotchbox
db_user=root
db_password=root

for filename in ./*.csv; do
filebasename=$(basename "$filename")
echo "importing $filebasename"
mysql -u"$db_user" -p"$db_password" -e "
use $db_name; DELETE FROM ${filebasename%.*}; LOAD DATA LOCAL INFILE \"$filebasename\" INTO TABLE ${filebasename%.*} CHARACTER SET 'utf8' FIELDS TERMINATED BY ',' ENCLOSED BY '\"' ESCAPED BY '\"' LINES TERMINATED BY '\n' IGNORE 1 LINES;
"
done