我正在使用 gitlab runner 在本地测试我的 CI。
我运行它:
sudo gitlab-runner exec docker godep --docker-privileged
Run Code Online (Sandbox Code Playgroud)
godep 是我需要运行的工作
现在,下一步是gobuild,但这一步依赖于上一步,因为它将生成一个工件
是否可以使用 gitlab-runner 运行多个作业???
我正在尝试跑步
/usr/bin/docker run --rm -v /var/data/redis:/data -v /var/data/conf/redis.conf:/usr/local/etc/redis/redis.conf --name redis -p 6379:6379 redis:5.0.3-alpine3.9
Run Code Online (Sandbox Code Playgroud)
但我得到:
/usr/bin/docker: Error response from daemon: driver failed programming external connectivity on endpoint redis (f16f19b7727a710fb6c96be566dac66ce26282982960d97faa28861c24fcf2fb): Bind for 0.0.0.0:6379 failed: port is already allocated.
Run Code Online (Sandbox Code Playgroud)
当我尝试检查使用的端口时netstat,我得到:
[root@artik ~]# netstat -nlpute | grep 6379
tcp6 0 0 :::6379 :::* LISTEN 0 14384 2471/docker-proxy
Run Code Online (Sandbox Code Playgroud)
我现在没有运行 docker 容器。
我不明白这个问题,我该怎么办?
[root@artik ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Run Code Online (Sandbox Code Playgroud) 当我做
kubectl get pods -A
Run Code Online (Sandbox Code Playgroud)
我得到了所有的豆荚,我总是有 17 个不是“应用程序”的豆荚,它们属于命名空间 kube-system。我想要一个不打印它们的别名。
有没有办法打印所有 pod,不包括命名空间?
当我做:
$tournaments = Tournament::paginate(Config::get('constants.PAGINATION'));
Run Code Online (Sandbox Code Playgroud)
它有效,但我只需要拥有用户的锦标赛.
所以我这样做:
$tournaments = Auth::user()->tournaments;
$tournaments->paginate(Config::get('constants.PAGINATION'));
Run Code Online (Sandbox Code Playgroud)
我在用户模型中有一个hasMany Relationship
我得到了这个消息
Method paginate does not exist.
Run Code Online (Sandbox Code Playgroud)
我该如何解决?它似乎并不复杂,但我做不到!
编辑:@smartrahat
第二个查询的结果:Auth :: user() - >锦标赛
Collection {#385 ?
#items: array:1 [?
0 => Tournament {#386 ?
#table: "tournament"
+timestamps: true
#fillable: array:17 [?]
#dates: array:2 [?]
#connection: null
#primaryKey: "id"
#perPage: 15
+incrementing: true
#attributes: array:16 [?]
#original: array:16 [?]
#relations: []
#hidden: []
#visible: []
#appends: []
#guarded: array:1 [?]
#dateFormat: null
#casts: []
#touches: []
#observables: []
#with: …Run Code Online (Sandbox Code Playgroud) 我在Laravel 5.2中看到了关于油门的这个教程
看起来油门只用于API,但为什么不能用于其他控制器的东西,以避免人们通过邮差发送100次相同的形式.
我告诉你,因为在Kernel.php中,现在,中间件在web和apis之间明显划分:Kernel.php:Laravel 5.2
我需要使用以下 URL 注册参加锦标赛:
http://laravel.dev/tournaments/1/register/
Run Code Online (Sandbox Code Playgroud)
该 URL 位于中间件“auth”中,因此如果用户未登录,他将被重定向到登录/页面。
我需要的是重定向到
http://laravel.dev/tournaments/1/register/
Run Code Online (Sandbox Code Playgroud)
登录后。
在我的routes.php中,我有:
Route::get('tournaments/{tournamentId}/register', 'TournamentController@register');
Run Code Online (Sandbox Code Playgroud)
我被告知要使用
redirect()->intended
Run Code Online (Sandbox Code Playgroud)
但我不知道该怎么做。
在一般情况下,用户将被重定向到/admin,但在这种情况下,我希望他继续执行他的主要操作(注册锦标赛)...
我使用内置特征进行登录,因此我检查了系统在登录时执行的操作,并且它已经在使用此功能:
protected function handleUserWasAuthenticated(Request $request, $throttles)
{
if ($throttles) {
$this->clearLoginAttempts($request);
}
if (method_exists($this, 'authenticated')) {
return $this->authenticated($request, Auth::guard($this->getGuard())->user());
}
return redirect()->intended($this->redirectPath());
}
Run Code Online (Sandbox Code Playgroud)
问题是它会将我重定向到默认路径,而不是动态路径......
我看到Laravel Spark已经发布了!好消息.
现在,在文档中,
它说你需要在新鲜的laravel上安装它.
引发新的项目名称
如果您手动安装它,您只需在项目中下载spark文件夹解压缩.
https://spark.laravel.com/docs/1.0/installation#manual-download
另一方面,我有关于更新过程的一行:
所以我有点困惑,因为在购买之前我无法试用该产品.
在我现有的项目中使用spark是否可行?
当我已经开发了Login,Register,Invite系统时会发生什么......
我应该使用Spark Login或Invite系统而不是我的吗?如果我这样做,我应该与Spark更好地集成?
对于一个问题,这是一个很多问题,但我觉得只是通过Laracasts看到产品是盲目的
我在Laravel 5.3中使用了新的Laravel Notifications,我喜欢它!
现在,我需要在我的内容中添加一些格式,如下所示:
<strong>Name:</strong> My Name <br/>
<strong>City:</strong> NYC <br/>
<strong>Country:</strong>USA <br/>
Run Code Online (Sandbox Code Playgroud)
并且不在line()方法中解释标签.
我试图更改默认视图并发布它,但随后我的所有通知视图都被新视图更改,我只想在1个案例中应用....
我该怎么办?
我有一个这样的集合:
Collection {#750 ?
#items: array:18 [?
18 => User {#691 ?}
19 => User {#696 ?}
20 => User {#701 ?}
]
}
Run Code Online (Sandbox Code Playgroud)
18、19、20 应该不同的地方
我试着打电话
$collection->get(0);
$collection->get(1);
$collection->get(2);
Run Code Online (Sandbox Code Playgroud)
但显然,它不起作用
我找到了一种使用 shift 的解决方法,它返回第一个元素并将其从集合中删除,
$el1 = $collection->shift();
$el2 = $collection->shift();
$el3 = $collection->shift();
Run Code Online (Sandbox Code Playgroud)
但在这种情况下,我的原始收藏被破坏了。
知道我应该怎么做吗?
现在,我想对它们进行一些自定义,但似乎无法实现。
我收到 2 个警告,我想为我的所有项目删除这些警告:
MyTests::my_test_that_should_pass不是驼峰格式my_test_that_should_pass不是骆驼案例使用 PHPMD,我尝试更改 :.composer/vendor/phpmd/phpmd/src/main/resources/rulesets/controversial.xml并设置allow-underscore-test为这里true提到的
使用 PHPCS,我真的不知道该怎么做。
任何的想法???
laravel ×5
collections ×1
docker ×1
gitlab ×1
gitlab-ci ×1
kubernetes ×1
laravel-5 ×1
laravel-5.1 ×1
php ×1
phpcs ×1
phpmd ×1
routes ×1