- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 gulp 从使用 dockerfile 构建的镜像在 docker 容器上运行我的 js 应用程序。我是 Jenkins 的高级初学者:)。
docker 文件
FROM node:10.11.0-alpine
RUN apk update && apk add --no-cache git curl python py-pip bzip2 alpine-sdk && \
pip install --upgrade awscli && \
rm -rf /tmp/* /var/lib/apt/lists/* /var/cache/apk/*
WORKDIR /app
COPY . .
ADD . /usr/src/app/.
RUN chmod -R 777 /usr/src/app
WORKDIR /usr/src/app
jenkinsFile - 我正在使用顺序阶段。第一阶段是初始化,我在其中设置 docker 容器。 docker 镜像在内部托管,我将其拉下来并运行 shell 命令。为了简单起见,我在这里仅添加相关阶段。
pipeline {
agent none
options {
timeout(time: timeoutSeconds, unit: 'SECONDS')
disableConcurrentBuilds()
}
stage('Initialize') {
agent {
docker {
image 'js-docker-image'
registryUrl 'https://my-artifactory-url'
registryCredentialsId artifactoryCredentialsId
args '-u root -v /var/run/docker.sock:/var/run/docker.sock'
label 'docker'
}
}
stages {
stage('Install Dependencies') {
steps {
script {
def command = '''
npm install
'''
sh command
}
}
}
stage('Build') {
steps {
script {
def command = '''
./node_modules/.bin/gulp build_only
'''
sh command
}
}
}
...
以下是构建输出中的相关部分。我删除了一些敏感信息。
...
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Initialize)
[Pipeline] node
Running on slave06 in /opt/jenkins/slave06/workspace/ntegrate-playground-573
[Pipeline] {
[Pipeline] checkout
...
$ docker run -t -d -u 133733063:133693953 -u root -v /var/run/docker.sock:/var/run/docker.sock -w /opt/jenkins/slave06/workspace/ntegrate-playground-573 -v /opt/jenkins/slave06/workspace/ntegrate-playground-573:/opt/jenkins/slave06/workspace/ntegrate-playground-573:rw,z -v /opt/jenkins/slave06/workspace/ntegrate-playground-573@tmp:/opt/jenkins/slave06/workspace/ntegrate-playground-573@tmp:rw,z -e ******** docker-internal-registry/js-docker-image:latest cat
...
...
$ docker top f6cddf731de8cd63c37e12462f1041db2f4a14486ad98e00dbb81d210711bc63
+ npm install
npm WARN jsdom@15.2.1 requires a peer of canvas@^2.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
audited 901232 packages in 20.046s
found 16 vulnerabilities (4 low, 1 moderate, 11 high)
run `npm audit fix` to fix them, or `npm audit` for details
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] script
[Pipeline] {
[Pipeline] sh
+ ./node_modules/.bin/gulp build_only
/opt/jenkins/slave06/workspace/ntegrate-playground-573@tmp/durable-8c5396a6/script.sh: line 1: ./node_modules/.bin/gulp: not found
问题
为什么 Jenkins 尝试使用 @tmp 附加新卷?
什么是 Durable-8c5396a6?
最佳答案
1) 为什么 Jenkins 尝试使用 @tmp 附加新卷?
@tmp
用于放置临时工件,例如 sh
中的 Shell 脚本,jenkins 会创建一个包含sh
脚本的.sh
文件,然后执行该.sh
文件。
因为这个.sh
文件不是源代码的一部分,只是阶段运行期间生成的临时文件。
你可以认为@tmp
中的文件是由Jenkins管理的,而不是由用户管理的。用户无法控制它。它是 Jenkins 管道设计的一部分。
对于由使用管理的源代码、构建/打包工件,它们不会放置在 @tmp
中,而是放置在作业工作区文件夹中,在您的情况下是 /opt/jenkins/slave06/workspace/ntegrate-playground-573
,其中没有 @tmp
。
2) 耐用-8c5396a6 是什么?
Jenkins 为每个具有相同名称 script.sh
的 sh
文件生成了 .sh
文件。如果您的 Jenkinsfile 中有多个 sh
,jenkins 将 script.sh
放在不同的文件夹中,以避免前一个 sh
被下一个 sh
覆盖
要调试您的问题,请在 ./node_modules/.bin/gulp build_only
之前添加两个命令 pwd
和 ls -l
。用它来检查您当前的工作目录以及当前工作目录下的文件和文件夹。
最可能的失败原因是你工作目录错误,其次是gulp
没有添加到项目依赖项中。
关于node.js - 为什么 Jenkins 除了工作区之外还要挂载临时卷?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59220020/
我正在尝试创建1-click快捷方式,以便在上小学时玩一些90年代的旧游戏。 我正在尝试将ISO挂载到特定驱动器 运行程序 确保已卸载驱动器,以清除下一个要清除的游戏 我是脚本新手,所以我不确定从哪里
我正在运行 docker compose 命令以在 docker 中运行应用程序。但是,yml 中定义的卷是空的。如果我挂载一个文件,它就可以工作。但是,当我从 Windows 挂载目录时,我可以看到
我有一个双向滚动的无限滚动列表。该列表显示每行 5 个项目的网格,表示一周 7 天中的 5 个工作日。日子是按月剥离的斑马线(甚至月份的颜色略深)。我想将月份标题放在网格左侧的一列中,从该月的第一天或
我在按照 qemu/linaro 教程尝试执行 qemu, https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Vir
我正在尝试挂载 cephfs,密码没问题: mount -t ceph ceph-mon:6789:/docker/mnt/cephfs -o name=admin,secret=admin-pass
我可以将 HDFS 目录(在 Ubuntu 中配置)挂载到 Windows 服务器的驱动器吗? 映射后,例如 H:\--->\home\user1\HDFSCreatedDir ,想使用普通的 Jav
我有一个由 500 个 linux 机器组成的集群,现在需要使用带有绑定(bind)选项的挂载资源(参见 man 8 mount)来支持 chroot jail 。安装点需要在引导后强制执行和维护。我
我在一些代码片段和 Requests documentation 中看到过类似的事情。 : import requests sess = requests.Session() adapter = re
嗨,我正在编写一个安装cgroup的应用程序,如下所示 mount("cgroup", "/sys/fs/cgroup", "tmpfs",0,NULL); 我可以执行此操作,但是我想添加一个检查以了
我希望使用 Powershell 获取 VHD 安装的驱动器号。我可以使用以下 cmdlet 挂载 VHD: Mount-VHD -Path d:/tmp.vhdx 安装工作正常,但是当我尝试获取驱动
我正在编写一个脚本来创建坐骑。我使用的系统命令是: sudo /bin/mount -soft -t smbfs -o username='{username}',password='{passwor
我正在尝试在多个用户之间共享 NFS 安装。我无法让它工作,因为我总是被拒绝访问。我可以挂载共享,但看不到文件。 导出是通过Heartbeat+Pacemaker进行的。我认为这没有什么区别,但这是导
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 已关闭 9 年前。 此问题似乎与 a specific programming problem, a sof
我最近全新安装了elementary OS,与Windows 8.1双启动。安装完成后,我编辑了eOS的fstab文件,使其自动在/mnt/Windows地址挂载一个ntfs分区。后来我关闭了笔记本电
我正在尝试在装有 Android 2.1 的模拟器上分析 Android 恶意软件。我想在执行可疑应用程序后分析文件权限和指纹。我知道,我可以使用 adb shell 来获取此信息,但我认为在执行例如
在使用 Webpack 和 Vue 编译项目后,当我打开一个使用 Vue 组件的页面时,我得到: [Vue warn]: Failed to mount component: template or
我正在使用 Linux Inotify 来检测程序上的 FS 事件。 当设备挂载到监控目录时如何通知我? 最佳答案 我不认为你可以用 inotify 来做到这一点。这是方法: 阅读uevents fr
有几篇文章对理解 Docker 的卷和数据管理非常有帮助。这两个尤其出色: http://container-solutions.com/understanding-volumes-docker/ h
我正在使用 mount -o bind /some/directory/here /foo/bar 我想用 bash 脚本检查 /foo/bar,看看它是否已经挂载?如果不是,则调用上面的 mount
我是一名优秀的程序员,十分优秀!