我有这个查询,但我得到一个语法错误:意外的标识符
mongoexport --db ium --collection events \
--query 'db.events.find({'created_at' : {
$gte: ISODate("2016-03-01T00:00:00.001Z"),
$lte: ISODate("2016-03-29T23:59:59:59.000Z")
},
"name" : "UPDATE_SUCCESS"})' \
--out guille1_test.json
Run Code Online (Sandbox Code Playgroud)
这有什么不对?
这是事情。我有一些 jenkins 管道作业,用于部署一些 java 后端应用程序。管道由来自 SCM 的脚本运行。该脚本是获取开发团队代码的脚本,并且: 1- 签出该代码 2- 编译并创建 WAR 3- 将 war 复制到 Web 服务器。
现在,开发人员想要实现回滚,并且如果运行了一项作业,并且新的部署已完成但失败了,他们希望返回到上一个运行良好的部署。
有没有办法在 jenkins 中做到这一点,例如使用 Jfrog artifactory?我们已经配置了 artifactory,我们可以将 WARS(或其他文件)上传到该仓库,但没有被使用。我不知道如何实现这一点。我在想对不同的 WAR 文件使用标签,如果部署失败,从工作正常的最新 WAR 中获取?这可能吗?如何使用 artifactory 在 jenkins 中完成这种方法。我可以在创建 WAR 之后实施一个新步骤,然后将该 WAA 上传到 artifactory,但是我如何将其与 jenkins 连接以使用我想要的 WAR?关于如何做到这一点的任何建议?谢谢你!
我在 Jenkins 配置文件中有一些 files.properties,我需要在 jenkins 管道期间将其复制到服务器。
管道代码或多或少如图所示,只是为了得到一个想法。如何添加一个步骤,在管道中的最后一步将 WAR 部署到服务器之后,从目标服务器上的 jenkins 复制此配置文件,例如:“sh Scp file.properties jenkins@destinationserver:/destination/path/file.properties ”
code {
stage ('Code Checkout') {
git branch: 'master',
credentialsId: 'b346fbxxxxxxxxxxxxxxxxxxx',
url: 'https://xxxxxxx@bitbucket.org/gr/code.git'
}
stage ('Check Branch') {
sh 'git branch'
}
stage('Compile and Build WAR') {
sh 'mvn clean compile war:war'
stage ('Deploy WAR to server') {
sh "scp .war jenkins@serverIp:/var/lib/tomcat/.war"
}
Run Code Online (Sandbox Code Playgroud)
我想创建多个存储帐户,并在每个存储帐户内创建一些容器。如果我想要 3 个存储帐户,我总是想在这 3 个存储帐户中创建容器 a 和容器 b
例如就是这样。存储帐户列表[“sa1”,“sa2”,“sa3”]。
resource "azurerm_storage_account" "storage_account" {
count = length(var.list)
name = var.name
resource_group_name = module.storage-account-resource-group.resource_group_name[0]
location = var.location
account_tier = var.account_tier
account_kind = var.account_kind
Run Code Online (Sandbox Code Playgroud)
然后是容器块
resource "azurerm_storage_container" "container" {
depends_on = [azurerm_storage_account.storage_account]
count = length(var.containers)
name = var.containers[count.index].name
container_access_type = var.containers[count.index].access_type
storage_account_name = azurerm_storage_account.storage_account[0].name
Run Code Online (Sandbox Code Playgroud)
容器变量:
variable "containers" {
type = list(object({
name = string
access_type = string
}))
default = []
description = "List of storage account containers."
}
Run Code Online (Sandbox Code Playgroud)
列表变量
variable "list" { …
Run Code Online (Sandbox Code Playgroud) 我在 groovy 中有一个 jenkins 管道。其中一项工作是将工件上传到工件。我使用变量来使用如图所示的 curl 并且它工作正常,但我不知道如何隐藏用户并传递 jenkins 输出作业。我对 groovy 不太了解,这可能吗?
在此处输入图片说明
我正在使用此规范文件删除超过 3 个月的旧工件。
{
"files": [{
"aql": {
"items.find": {
"$or": [{
"$and": [{
"repo": "repo1",
"created": {
"$before": "3mo"
}
}],
"$and": [{
"repo": "repo2",
"created": {
"$before": "3mo"
}
}],
"$and": [{
"repo": "repo3",
"created": {
"$before": "3mo"
}
}]
}]
}
}
}]
}
Run Code Online (Sandbox Code Playgroud)
但我想删除以“2019*”开头的孔文件夹,如包含工件的图片中所示,而不仅仅是文件夹中的工件。
我尝试了以下但我没有工作:
"items.find": {
"repo": "repo1",
"path": "com/domain/name",
"name": {"$match":"20*"},
"type": "folder",
Run Code Online (Sandbox Code Playgroud)
说没有神器建立。
Jfrog 有没有办法删除除最后 2 个之外的所有工件?只想保留最后 2 个而不是全部,并且必须每隔一段时间用这个脚本删除它们
谢谢!!
对于不止一个回购?
{
"files": [{
"aql": {
"items.find": {
"$or": [{
"$and": [{
"repo": …
Run Code Online (Sandbox Code Playgroud) 有没有办法做到这一点?。想在 Artifactory 中发布 gradle .jar。我能够在 jenkins 中使用已安装的 maven 版本进行 maven 构建,并成功发布了 artifactory 中的战争,但现在开发人员希望使用 gradle 包装器而不是 maven 进行 gradle 构建。使用此代码正常 Gradle 构建工作得很好。
stage('Clean Build') {
withGradle { // using gradle wrapper
sh './gradlew clean build'
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试使用 Artifactory 插件来实现它时,我不能。我越来越。
[Pipeline] ArtifactoryGradleBuild
[api-build] $ /var/lib/jenkins/workspace/api-build/gradlew --init-script /var/lib/jenkins/workspace/api-build@tmp/artifactory/init-artifactory11329321758849387716gradle clean artifactoryPublish -b ./build.gradle
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
Failed to create Jar file /var/lib/jenkins/.gradle/caches/jars-8/8535adf040d7c5fdb7fd6bc28bb0ef3f/ok.
> Prefix string "ok" too …
Run Code Online (Sandbox Code Playgroud)