小编Man*_*eUK的帖子

使用Jenkins管道将多个git repos签出到同一个作业中

我正在使用Jenkins Multiple SCM插件在我的Jenkins作业中将三个git存储库检入三个子目录.然后,我执行一组命令来构建一组工件,其中包含从所有三个存储库中提取的信息和代码.

现在折旧了多个SCM,文本建议移动到管道.我试过了,但我无法弄清楚如何让它发挥作用.

这是我有兴趣从Jenkins作业目录的顶层看到的目录结构:

$ ls
Combination
CombinationBuilder
CombinationResults
Run Code Online (Sandbox Code Playgroud)

这三个子目录中的每一个都签出了一个git repo.使用多个SCM,我使用git,然后添加"checkout to a subdirectory"行为.这是我尝试使用管道脚本:

node('ATLAS && Linux') {
    sh('[ -e CalibrationResults ] || mkdir CalibrationResults')
    sh('cd CalibrationResults')
    git url: 'https://github.com/AtlasBID/CalibrationResults.git'
    sh('cd ..')
    sh('[ -e Combination ] || mkdir Combination')
    sh('cd Combination')
    git url: 'https://github.com/AtlasBID/Combination.git'
    sh('cd ..')
    sh('[ -e CombinationBuilder ] || mkdir CombinationBuilder')
    sh('cd CombinationBuilder')
    git url: 'https://github.com/AtlasBID/CombinationBuilder.git'
    sh 'cd ..'

    sh('ls')
    sh('. CombinationBuilder/build.sh')
}
Run Code Online (Sandbox Code Playgroud)

但是,git命令似乎在工作区的顶级目录中执行(这有一定意义),并且根据语法,似乎没有checkout-to-sub-directory行为.

git jenkins jenkins-pipeline

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

Jquery:隐藏所有子项,然后显示特定元素

我想隐藏div中的所有子元素.然后显示传递给函数的特定一个.

function subDisplay(name) {
   $("#navSub").each(function() {
      $(this).hide();
   });
   $(name).show();
}
Run Code Online (Sandbox Code Playgroud)

然后我从onmouse事件调用该函数,如:subDisplay(#DivIwantToShow); 但没有任何显示...

我究竟做错了什么?

javascript jquery show hide

35
推荐指数
2
解决办法
8万
查看次数

toggleClass上的jquery函数完成了吗?

一旦toggleClass完成,我怎么能做一个功能?我尝试过以下但没有运气:

$("#loader").toggleClass('fadeOut', function () {
    alert('a');
});
Run Code Online (Sandbox Code Playgroud)

jquery

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

如何更改DataTable的语言

我在会话变量中存储用户想要翻译的语言,但我不知道将其传递给DataTables

在datatables网站上找到了这个解释,但这并没有真正帮助,我在哪里设置语言参数?

jquery datatables

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

在相同的选项卡中启动下载,而无需在Javascript中打开新选项卡或窗口

我正在使用这个javascript函数来启动下载

function startDownload(url) {
   window.open(url, 'Download');
}
Run Code Online (Sandbox Code Playgroud)

它工作,但我想阻止任何新的选项卡或新窗口启动,谢谢.

javascript download

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

使用on()将事件处理程序添加到尚不存在的元素中?

我想为稍后在DOM中创建的元素添加事件句柄.

基本上,我想要做的是,当我点击时p#one,p#two将创建新元素,然后我点击p#two,告诉我"p#two"点击.但是,它不起作用,我console.log点击后没有得到'p#two clicked' 的结果p#two.

on()用来添加点击事件p#two.我做错了什么?

谢谢.

以下是我的示例代码:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>on() test</title>
  <link type="text/css" href="http://localhost/jquery-ui-1.8.20.custom/css/smoothness/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
  <script type="text/javascript" src="http://localhost/jquery-ui-1.8.20.custom/js/jquery-1.7.2.min.js"></script>
  <script type="text/javascript" src="http://localhost/jquery-ui-1.8.20.custom/js/jquery-ui-1.8.20.custom.min.js"></script>

  <script type="text/javascript">
    $(document).ready(function() {

        $('p#two').on('click', function() {
            console.log('p#two clicked');
        });


        $('p#one').click(function() {
            console.log('p#one clicked');
            $('<p id="two">two</p>').insertAfter('p#one');
        });

    }); // end doc ready
  </script>
</head>

<body>
    <p id="one">one</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

javascript jquery

18
推荐指数
2
解决办法
9329
查看次数

如何使用Join更新select

如何更新子查询中也存在的表?我需要分2个阶段吗?(创建一个临时表 - 将所选数据放入其中,然后更新最终表)

我正在尝试使用每个CTN的网络标签更新invoiceLine表.

最终结果将是:

我有以下表格:

我可以运行一个选择,但我不知道如何使用连接更新:

update invoiceLine 
inner join terminal on terminal.ctn = invoiceLine.ctn 
set invoiceLine.network = 
(
  select network.label 
  from invoiceLine 
  inner join terminal on terminal.ctn = invoiceLine.ctn 
  inner join network on network.id = terminal.network
) 
where invoiceLine.ctn = terminal.ctn
Run Code Online (Sandbox Code Playgroud)

但MySQL抛出一个

错误代码:1093.您无法在FROM子句中为更新指定目标表'invoiceLine'

mysql sql select join sql-update

16
推荐指数
2
解决办法
3万
查看次数

发布在DataTables中不可见的表单元素

我在表单中包含的表上使用名为Datatables的jQuery插件,该表将包含许多表单元素.

我在页面上有一个Save Changes按钮,它将根据用户输入的内容执行AJAX请求以更新数据库.

我遇到的问题是它只会发布当前在Datatable中可见的表单元素.在我的一个例子中,有74行(都包含几个字段).要显示的默认记录数为10.

因此,当提交表单时,只提交10行的表单元素.我要提交所有行的字段 - 在这种情况下,所有74行的字段.

有人有解决方案吗?谢谢.

jquery datatables

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

grunt服务器无法连接<gruntjs>

module.exports = function(grunt) {

  // Project configuration.
    grunt.initConfig({
      server: {
        port: 8888,
        base: '.'
      }
    });

};

C:\Program Files\nodejs\test\grunt>
C:\Program Files\nodejs\test\grunt>grunt server
Running "server" task
Starting static web server on port 8888.
Run Code Online (Sandbox Code Playgroud)

完成,没有错误.

但不能通过输入连接 [http://127.0.0.1:8888][1] in browsers ! jiong~

如何在windows或unix中修复此问题?

javascript linux html5 node.js gruntjs

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

日期选择器自动打开

我有一个javascript代码,我想用它完成以下操作.我希望当我点击按钮时出现一个表单,但是datepicker的日期选择选项不会自动出现(但在我的情况下会打开).所以换句话说,我的魔杖禁用了autoopen.这是脚本

<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.all.css"     type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"     type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"     type="text/javascript"></script>
</head>
<body>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#button").click(function () {
                var dates2 = $("#datePicker3,#datePicker4").datepicker({
                    autoOpen: false,
                    minDate: 0,
                    changeMonth: true,
                    numberOfMonths: 1,
                    onSelect: function (selectedDate) {
                        var option = this.id == "datePicker3" ? "minDate" : "maxDate",
                            instance = $(this).data("datepicker"),
                            date = $.datepicker.parseDate(
                            instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
                        dates2.not(this).datepicker("option", option, date);
                        calculate_total_price();
                    }

                }); ///
                $("#order-popup").dialog();
                $("#order-popup").show();
            });
        });
    </script>
    <input type="button" value="addclass" id="button">
    <div id="order-popup" style="display:none;" class="popup-content already-ordered">
        <input …
Run Code Online (Sandbox Code Playgroud)

jquery

12
推荐指数
2
解决办法
4万
查看次数