小编pap*_*ito的帖子

Git 如何使用 SSH 密钥、用户名进行克隆

我有以下内容,我需要在 Windows 终端命令提示符或 linux 中克隆存储库。

  • 网址: git@xxxxx.com:xxx/xxx/git
  • 用户名: xxx@xxx.in
  • SSH 密钥: ssh-rsa AAAAB3NzaC1yxxxxxxxxxxxx....xxx@xxx.in

我试过:

git clone git@xxxxx.com:xxx/xxx/git
Run Code Online (Sandbox Code Playgroud)

我得到

Permission denied(public key)
Couldn't read from remote repository
Run Code Online (Sandbox Code Playgroud)

还尝试将 URL 更改为:

git clone https://xxxxx.com:xxx/xxx/git
Run Code Online (Sandbox Code Playgroud)

git clone

35
推荐指数
3
解决办法
6万
查看次数

Ansible 集合的角色依赖性处理

创建 ansible 角色时,您可以在中指定依赖项meta/main.yml如下所示

\n
dependencies:\n- role: papanito.xxx\n
Run Code Online (Sandbox Code Playgroud)\n

我该怎么做,如果papanito.xxx如果转换成集合或者让我们换个说法:如何告诉我的角色,它依赖于集合中的模块/角色?

\n

如果我跑ansible-playbook使用某个角色的命令,该角色依赖于集合中的角色,则会出现以下错误:

\n
ERROR! the role \'papanito.xxx\' was not found in ansible.legacy:\n/home/papanito/Workspaces/devenv/roles:\n/home/papanito/.ansible/roles:\n/usr/share/ansible/roles:\n/etc/ansible/roles:\n/home/papanito/Workspaces/devenv/roles:\n/home/papanito/Workspaces/devenv\n
Run Code Online (Sandbox Code Playgroud)\n

正如我所看到的,ansible 检查这些角色的路径,但是,集合存储在/home/papanito/.ansible/collections/ansible_collections/.

\n

我怀疑这与提到有关ansible.legacy,但是我没有配置类似的东西 - 至少是故意的。

\n

使用role: the_namespace.the_collection.the_role并不能解决问题,但我仍然遇到同样的错误。

\n

进一步的文档

\n
\n

在角色内,您可以collections使用 role\xe2\x80\x99s 中的 collections 关键字来控制哪个 Ansible 搜索角色内的任务meta/main.yml

\n
\n

所以我更新了meta/main.yml

\n
dependencies:\n- role: papanito.xxx\n
Run Code Online (Sandbox Code Playgroud)\n

当我运行剧本时,这仍然会导致与上面完全相同的错误。

\n

ansible

12
推荐指数
1
解决办法
6448
查看次数

java.lang.NoSuchMethodError: 在步骤中找不到这样的 DSL 方法“$”

我有以下 dsl

pipeline {
    agent {
        label 'test'
    }
    parameters {        
        booleanParam(defaultValue: false, description: 'This is a Release build', name: 'isRelease')
    }

    stages {
        stage('Build') {
            steps {
                 script {
                     if (${params.isRelease}) {
                          echo("This is a release")
                     }
                 }
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这失败并出现以下错误

java.lang.NoSuchMethodError: No such DSL method '$' found among steps 
Run Code Online (Sandbox Code Playgroud)

我做错了什么?我在用

  • 詹金斯 2.89.4
  • 工作 DSL 1.68
  • 流水线作业 2.20
  • 管道:API 2.27
  • 管道:基本步骤 2.7
  • 管道:构建步骤 2.7
  • 管道:声明性 1.2.9

jenkins

6
推荐指数
1
解决办法
1万
查看次数

使用ansible模块的两个文件的区别

我想看看本地和远程主机上的文件是否有任何更改。如果有任何区别,它应该在屏幕上可见,使用 Ansible 执行此操作的最佳方法是什么

例如:

src : /tmp/abc.txt
dest : hostname:/tmp/cde.txt
Run Code Online (Sandbox Code Playgroud)

ansible

6
推荐指数
2
解决办法
7865
查看次数

特征的名称和顺序对预测算法重要吗

我的 X_test 数据帧的列的名称/顺序是否必须与我用于拟合的 X_train 相同?

下面是一个例子

我正在训练我的模型:

model.fit(X_train,y)
Run Code Online (Sandbox Code Playgroud)

在哪里X_train=data['var1','var2']

但在预测过程中,当我使用:

model.predict(X_test)
Run Code Online (Sandbox Code Playgroud)

X_test定义为:X_test=data['var1','var3']

其中var3可能是与 完全不同的变量var2

是否predict假设 与中的第二列var3相同?var2X_test

如果什么:

X_live被定义为:X_live=data['var2','var1']

预测会知道重新排序 X 以使它们正确排列吗?

python predict data-fitting

6
推荐指数
1
解决办法
3606
查看次数

Kubectl get events 说没有资源

我正在使用 Azure kubernetes 服务(托管服务)。kubectl get events -namespace abc说有no resources

我一直在同一个集群上使用获取事件,然后突然返回没有资源。有人可以帮忙吗?

备注:这是一个当前流量很大并且应该有事件的集群。

kubernetes kubectl azure-aks

5
推荐指数
1
解决办法
9145
查看次数

Jenkins 共享库中的全局变量

我有一个使用共享库的 Jenkinsfile。我想创建一个可在共享库的所有函数中使用的全局变量,类似于对象params。然而我总是最终得到

groovy.lang.MissingPropertyException: No such property: pipelineParams for class: groovy.lang.Binding
Run Code Online (Sandbox Code Playgroud)

遵循此准则,我Field在以下位置定义 a Jenkinsfile

import org.apache.commons.io.FileUtils
@groovy.transform.Field
def pipelineParams

library identifier: 'pipeline-helper@master', retriever: modernSCM(
  [$class: 'GitSCMSource',
       remote: 'https://bitbucket/scm/jenkins/pipeline-helper.git',
       credentialsId: 'bitbucket.service.user'
  ])

defaultCiPipelineMSBuild {
    nodes     = 'TEST-NODES' /* label of jenkins nodes*/
    email     = 'example@example.com' /* group mail for notifications */
    msbuild   = 'MSBUILD-DOTNET-4.6' /* ms build tool to use */ 
}
Run Code Online (Sandbox Code Playgroud)

然后在defaultCiPipelineMSBuild我设置pipelineParams

def call(body) {
    // evaluate the body block, and …
Run Code Online (Sandbox Code Playgroud)

groovy jenkins jenkins-pipeline

5
推荐指数
1
解决办法
1万
查看次数

剧本和角色中忽略“remote_user”

我在我的中定义了以下内容ansible.cfg

# default user to use for playbooks if user is not specified
# (/usr/bin/ansible will use current user as default)
remote_user = ansible
Run Code Online (Sandbox Code Playgroud)

然而,我有一本剧本bootstrap.yaml,我可以在其中联系root而不是ansible

---
- hosts: "{{ target }}"
  become: no
  gather_facts: false
  remote_user: root

  vars:
    os_family: "{{ osfamily }}}"

  roles:
  - role: papanito.bootstrap
Run Code Online (Sandbox Code Playgroud)

然而,它似乎remote_user: root被忽略了,因为我总是收到连接错误,因为它使用用户ansible而不是rootssh 连接

fatal: [node001]: UNREACHABLE! => {"changed": false,
"msg": "Failed to connect to the host via ssh:
 ansible@node001: Permission denied (publickey,password).", …
Run Code Online (Sandbox Code Playgroud)

ansible ansible-2.x

5
推荐指数
1
解决办法
3884
查看次数

kubectl 补丁部署导致““”无效”

我尝试使用以下命令修补部署:

kubectl patch deployment spin-clouddriver -n spinnaker --type='json' -p='[{"op": "add", "path": "/spec/spec/containers/0/volumeMounts", "value": {"mountPath": "/etc/ssl/certs/java/cacerts", "subPath": "cacerts", "name": "cacerts"}}]'
Run Code Online (Sandbox Code Playgroud)

这导致

The  "" is invalid
Run Code Online (Sandbox Code Playgroud)

我看不到错误在哪里,也看不到该消息如何帮助我找到问题。有什么提示吗?

kubernetes

4
推荐指数
1
解决办法
8116
查看次数

IntelliJ/Maven 回购问题

我真的被这个问题惹恼了,这是我尝试修复它的第二天。我尝试了网络上所有可用的资源(在东部我能找到的)

我正在使用 Spring MVC 并尝试启动新的 Maven 项目。发生的事情是该项目是从模板构建的,这是我遇到的错误。

下载:

    https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-archetype-plugin/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.224 s
[INFO] Finished at: 2018-08-28T11:52:04+01:00
[INFO] Final Memory: 7M/30M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-archetype-plugin:RELEASE or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-archetype-plugin:jar:RELEASE: Failed to resolve version for org.apache.maven.plugins:maven-archetype-plugin:jar:RELEASE: …
Run Code Online (Sandbox Code Playgroud)

java repository intellij-idea maven

3
推荐指数
1
解决办法
3105
查看次数