的 test/test-app 目录。 脚本 脚本 描述 描述 S2I 脚本示例 脚本示例 以下示例 S2I 脚本采用
Bash 编写。每个示例都假定其 tar 内容解包到 /tmp/s2i 目录中。 assemble 脚本: 脚本: #!/bin/
bash # restore build artifacts if [ "$(ls /tmp/s2i/artifacts/ 2>/dev/null)" Platform S2I 镜像构建程序调用,可以 是简单的
Bash 脚本,也可以是静态的 Go 二进制文件。 test/run 脚本会执行 S2I 构建,因此您的 $PATH 中必须有 S2I 二进制文件。必要情况下,请遵循 S2I # install the artifacts make install popd #!/bin/
bash # run the application /opt/application/run /opt/application/run.sh #!/bin/
bash pushd ${HOME} if [ -d deps ]; then # all deps contents to tar stream tar cf - deps fi popd #!/bin/
bash # inform the user how to use the image cat <
0 码力 |
118 页 |
1.13 MB
| 1 年前 3
test/test-app 目录。 脚本 脚本 描述 描述 S2I 脚本示例 以下示例 S2I 脚本采用 Bash 编写。每个示例都假定其 tar 内容解包到 /tmp/s2i 目录中。 assemble 脚本: 脚本: run 脚本: 脚本: save-artifacts 脚本: 脚本: #!/bin/bash # restore build artifacts if [ "$(ls /tmp/s2i/artifacts/ build application artifacts pushd ${HOME} make all # install the artifacts make install popd #!/bin/bash # run the application /opt/application/run.sh 第 第 4 章 章 创 创建 建镜 镜像 像 33 usage 脚本: 脚本: 其他资源 S2I 已更新也不受影响。 4.4.1. 了解测试要求 test 脚本的标准位置为 test/run。该脚本由 OpenShift Container Platform S2I 镜像构建程序调用,可以 是简单的 Bash 脚本,也可以是静态的 Go 二进制文件。 test/run 脚本会执行 S2I 构建,因此您的 $PATH 中必须有 S2I 二进制文件。必要情况下,请遵循 S2I README 中的安装说明。
0 码力 |
123 页 |
1.20 MB
| 1 年前 3
S2I 文档。 脚本 脚本 描述 描述 5.2.5.2.1. S2I 脚本示例 脚本示例 以下示例 S2I 脚本采用
Bash 编写。每个示例都假定其 tar 内容解压缩到 /tmp/s2i 目录中。 例 例 5.1. assemble 脚本: 脚本: #!/bin/
bash # restore build artifacts if [ "$(ls /tmp/s2i/artifacts/ 2>/dev/null)" install popd 例 例 5.2. run 脚本: 脚本: #!/bin/
bash # run the application /opt/application/run.sh 第 第 5 章 章 使用 使用构 构建策略 建策略 41 例 例 5.3. save-artifacts 脚本: 脚本: #!/bin/
bash pushd ${HOME} if [ -d deps ]; then then # all deps contents to tar stream tar cf - deps fi popd 例 例 5.4. usage 脚本: 脚本: #!/bin/
bash # inform the user how to use the image cat <
0 码力 |
101 页 |
1.12 MB
| 1 年前 3
defaultMode 必须能够使用 oc 命令或编辑部署配 置来运行。值通常为 0755、493(十进制): 注意 oc set env 命令对空格敏感。= 符号的两侧不能有空格。 提示 #!/bin/bash # Whatever tests are needed # E.g., send request and verify response exit 0 $ oc create configmap io/networks: tuningnad 1 spec: containers: - name: podexample image: centos command: ["/bin/bash", "-c", "sleep INF"] securityContext: runAsUser: 2000 2 runAsGroup: 3000 3 "/bin/socat" args: - TCP4-LISTEN:8080,reuseaddr,fork - EXEC:'/bin/bash -c \"printf \\\"HTTP/1.0 200 OK\r\n\r\n\\\"; sed -e \\\"/^\r/q\\\"\"' imagePullPolicy: Always
0 码力 |
697 页 |
7.55 MB
| 1 年前 3
脚本构建的测试应用程序放置到镜像存储库中 的 test/test-app 目录。 S2I 脚本示例 脚本示例 以下示例 S2I 脚本采用 Bash 编写。每个示例都假定其 tar 内容解包到 /tmp/s2i 目录中。 assemble 脚本: 脚本: #!/bin/bash OpenShift Container Platform 4.13 CI/CD 40 run 脚本: 脚本: save-artifacts popd #!/bin/bash # run the application /opt/application/run.sh #!/bin/bash pushd ${HOME} if [ -d deps ]; then # all deps contents to tar stream tar cf - deps fi popd #!/bin/bash # inform the 在构建配置中通过指定资源限值来限制资源使用。** 在以下示例中,每个 resources、cpu 和 memory 参数都是可选的: postCommit: command: ["/bin/bash", "-c", "bundle exec rake test --verbose"] postCommit: command: ["bundle", "exec", "rake", "test"]
0 码力 |
129 页 |
1.37 MB
| 1 年前 3
"default-route": ["192.0.2.1"] 2 }' spec: containers: - name: example-pod command: ["/bin/
bash", "-c", "sleep 2000000000000"] image: centos/tools $ oc exec -it
-- ip route $ oc cluster \ -o jsonpath='{.status.clusterNetwork[0].cidr}') $ oc exec msender -i -t -- \ /bin/bash -c "echo | socat STDIO UDP4- DATAGRAM:224.1.0.1:30102,range=$CIDR,ip-multicast-ttl=64" mlistener OVN-KUBERNETES 默 默认 认 CNI 网 网络 络供 供应 应商 商 173 输 输出示例 出示例 7. 要完成迁移,请重新引导集群中的每个节点。例如,您可以使用类似以下示例的 bash 脚本。这个 脚本假定您可以使用 ssh 连接到每个主机,并将 sudo 配置为不提示输入密码。 如果无法使用 ssh 访问,您可能无法通过基础架构供应商的管理门户重新引导每个节点。 8. 0 码力 |
256 页 |
2.78 MB
| 1 年前 3
必须能够使用 oc 命令或编辑部署配 置来运行。值通常为 0755、493(十进制): 注意 注意 oc set env 命令对空格敏感。= 符号的两侧不能有空格。 提示 提示 #!/bin/
bash # Whatever tests are needed # E.g., send request and verify response exit 0 $ oc create configmap "default-route": ["192.0.2.1"] 2 }' spec: containers: - name: example-pod command: ["/bin/
bash", "-c", "sleep 2000000000000"] image: centos/tools $ oc exec -it
-- ip route $ oc cluster \ -o jsonpath='{.status.clusterNetwork[0].cidr}') $ oc exec msender -i -t -- \ /bin/bash -c "echo | socat STDIO UDP4- DATAGRAM:224.1.0.1:30102,range=$CIDR,ip-multicast-ttl=64" mlistener 0 码力 |
388 页 |
4.04 MB
| 1 年前 3