小编Omr*_*mri的帖子

无法将文件推送到git由于:无法推送一些引用

我有一个目录,我想变成一个git项目.

我在gitlab中创建了一个新项目,然后我执行了以下操作:

git init
git remote add origin git@gitlab.com:a/b/c.git
git add .
git commit -m "Initial commit"
git push -u origin master
Run Code Online (Sandbox Code Playgroud)

另外,我创建了以下.gitignore文件:

*
!*/scripts
!*/jobs
Run Code Online (Sandbox Code Playgroud)

运行后git push -u origin master我得到以下错误:

Counting objects: 33165, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (32577/32577), done.
Writing objects: 100% (33165/33165), 359.84 MiB | 1.70 MiB/s, done.
Total 33165 (delta 21011), reused 0 (delta 0)
remote: Resolving deltas: 100% (21011/21011), done.
remote: GitLab: 
remote: A default …
Run Code Online (Sandbox Code Playgroud)

git gitlab

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

在cherrypy中的静态URL

我有一个基于python(cherrypy)的网站服务器,我需要一些帮助.如果这个问题太基础,我很抱歉.到目前为止,我在这方面没有丰富的经验.

我的主页面已打开http://host:9090/home/static/index.html.我想重写上面的地址,并将以下地址定义为主页:http://host:9090/home/.代码本身假设保持在同一个地方.我只想要一个更短的链接,所以/home/static/index.html也可以使用/home/.

重写URL是我需要的吗?如果是这样,我发现了以下链接,但不幸的是我不知道如何在我的代码中实现它:http: //www.aminus.org/blogs/index.php/2005/10/27/url_rewriting_in_cherrypy_2_1?博客= 2

 cherrypy.config.update({
                            'server.socket_port': 9090,
                            'server.socket_host': '0.0.0.0'
                           })
    conf = {
        '/': {
                'tools.sessions.on': True,
                'tools.staticdir.root': os.path.abspath(os.getcwd())
             },
        '/static': {
                'tools.staticdir.on': True,
                'tools.staticdir.dir': './static/html'
             },
        '/js': {
                'tools.staticdir.on': True,
                'tools.staticdir.dir': './static/js'
             },
        '/css': {
                'tools.staticdir.on': True,
                'tools.staticdir.dir': './static/css'
             },
        '/img': {
                'tools.staticdir.on': True,
                'tools.staticdir.dir': './static/img'
             },
        '/fonts': {
                'tools.staticdir.on': True,
                'tools.staticdir.dir': './static/fonts'
        }

    }

    class Root(object):
        def __init__(self, target):
            self.target_server = target

    webapp = Root(args.target)
    cherrypy.quickstart(webapp, '/home', …
Run Code Online (Sandbox Code Playgroud)

python url cherrypy

9
推荐指数
1
解决办法
561
查看次数

使用 SQLite 加载多个 CSV 文件

我正在使用 SQLite,我需要将数百个 CSV 文件加载到一个表中。我没有设法在网上找到这样的东西。是否可以?

请注意,一开始我使用了 Oracle,但由于 Oracle 每个表有 1000 列的限制,而我的 CSV 文件每个都有超过 1500 列,我不得不找到另一种解决方案。我不想尝试 SQLite,因为我可以快速轻松地安装它。这些 CSV 文件已经提供了诸如列的数量,我无法更改或拆分它们(不管为什么)。

请指教。

csv sqlite

7
推荐指数
2
解决办法
7125
查看次数

在 Jenkins 中使用声明式 linter

我一直在尝试使用Command-line Pipeline Linter

我可以在服务器本地使用这个声明式 linter 吗?

我尝试运行:

declarative-linter < Jenkinsfile
Run Code Online (Sandbox Code Playgroud)

并得到:

-bash: declarative-linter: command not found
Run Code Online (Sandbox Code Playgroud)

我需要安装此命令还是应该在安装管道插件后自动安装?

请指教。

jenkins jenkins-cli jenkins-pipeline

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

Gitlab 中用于合并请求的 Jenkins 管道

我最近开始使用 Jenkins,我需要一些帮助来创建管道。

我想创建以下管道:对于 Gitlab 中从 develop 到 master 的每个合并请求,触发运行端到端测试的 Jenkins 作业,并且仅当测试成功时才合并 Gitlab 中的分支。

我发现以下文章对我需要的大部分内容进行了解释:https : //vetlugin.wordpress.com/2017/01/31/guide-jenkins-pipeline-merge-requests/

我还在寻找一个问题的答案:Jenkins如何用端到端测试的结果(成功/失败)回应Gitlab,所以Gitlab会知道是否合并到分支?

请指教,谢谢!

jenkins gitlab jenkins-pipeline

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

Groovy 脚本中的错误:当前作用域已包含变量

我正在尝试为詹金斯管道编写一个常规方法。该方法获取两个变量,将它们放入一个字符串中,并将该字符串作为 shell 命令执行。

方法如下:

def method(A, B) {
        test = "cp app/scripts/" + A + "config." + B + "js app/scripts/config.js"

        def rc = sh(script: test, returnStatus: true)
        if (rc != 0) {
            error "Failed, exiting now..."
        }
}
Run Code Online (Sandbox Code Playgroud)

这是我执行此代码时收到的错误:

The current scope already contains a variable of the name rc
 @ line 148, column 13.
           def rc = sh(script: """
               ^
Run Code Online (Sandbox Code Playgroud)

有谁知道可能是什么问题?

groovy jenkins-groovy

5
推荐指数
0
解决办法
9120
查看次数

SQL中交集的补充

我正在使用Oracle SQL,我有一个关于join命令的基本问题.

我有5张桌子.它们中的每一个都与主键具有相同的列:ID (int).让我们看看以下查询:

select count(*) from table_a - 100 records
select count(*) from table_c - 200 records
select count(*) from table_c - 150 records
select count(*) from table_d - 100 records
select count(*) from table_e - 120 records
Run Code Online (Sandbox Code Playgroud)
select * -- 88 records
 from table_a a
  inner join table b
    on a.id = b.id
  inner join table c
    on a.id = c.id
  inner join table d
    on a.id = d.id
  inner join table e
    on …
Run Code Online (Sandbox Code Playgroud)

sql oracle join intersection

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

计算 Linux 中 CLI 输出的行数

你好,有以下命令:

lsscsi | grep HITACHI | awk '{print $6}'
Run Code Online (Sandbox Code Playgroud)

我希望输出是原始输出的行数。例如,如果原始输出是:

/dev/sda
/dev/sdb
/dev/sdc
Run Code Online (Sandbox Code Playgroud)

最终的输出将是3.

linux count command-line-interface

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

在ansible中检查shell命令的输出

我正在尝试编写一个运行shell管道的Ansible脚本,并根据该管道的输出确定是否终止playbook的执行.

这是有问题的代码:

  - name: Check if the number of HITACHI devices is equal to 1
    shell: lsscsi | grep HITACHI | awk '{print $6}' | wc -l
    register: numOfDevices
    when: numOfDevices|int  == 1
Run Code Online (Sandbox Code Playgroud)

这是错误:

{  
   "failed":true,
   "msg":"The conditional check 'numOfDevices|int  == 1' failed.  
The error was: error while evaluating conditional (numOfDevices|int  == 1): 'numOfDevices' is undefined\n\nThe error appears to have been in '/etc/ansible/config/test.yml': line 14, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending …
Run Code Online (Sandbox Code Playgroud)

bash shell ansible

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

Jenkinsfile:创建一个新文件(Groovy)

我正在尝试编写一个Jenkinsfile带有创建新文件并稍后使用的阶段。

无论我做什么,我都会收到以下错误:

java.io.FileNotFoundException: ./ci/new_file.txt (No such file or directory)
Run Code Online (Sandbox Code Playgroud)

这是相关的代码块:

pipeline {
    agent any
    stages {
        stage('Some Stage') {
            steps {
                script{
                    file = new File('./ci/new_file.txt').text
                    file.createNewFile()
                }
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我回顾了一些类似的问题,到目前为止没有任何帮助。请指教。

groovy jenkins jenkins-groovy jenkins-pipeline

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

更新值而不是NULL

我正在使用Oracle SQL.

我有下表:

Timestamp             | A   | B
13-11-14 06.49.54.004 | 50  | 70
13-11-14 06.49.54.005 | NULL| 80
13-11-14 06.49.54.006 | NULL| NULL
13-11-14 06.49.54.007 | 40  | 70
13-11-14 06.49.54.008 | 20  | 90
13-11-14 06.49.54.009 | 30  | NULL
Run Code Online (Sandbox Code Playgroud)

如何将NULL值替换为每列的最后一个值?这是预期的输出表:

Timestamp             | A   | B
13-11-14 06.49.54.004 | 50  | 70
13-11-14 06.49.54.005 | 50  | 80
13-11-14 06.49.54.006 | 50  | 80
13-11-14 06.49.54.007 | 40  | 70
13-11-14 06.49.54.008 | 20  | 90 …
Run Code Online (Sandbox Code Playgroud)

sql oracle null

0
推荐指数
1
解决办法
73
查看次数