Skip to content

Commit

Permalink
Merge pull request salesforce#22 from SearchRelevance/strata_ci
Browse files Browse the repository at this point in the history
@W-12436491 Add Strata CI configuration
  • Loading branch information
FranciscoBorges authored and GitHub Enterprise committed Jan 26, 2023
2 parents a6fba3e + 66d5b71 commit acc5f40
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .strata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# https://confluence.internal.salesforce.com/display/public/ZEN/SFCI+Managed+V2+Pipelines
global:
email-reply-to: [email protected]
production-branches:
- master
stages:
build:
- step:
name: mvn-build-install
image: dva-registry.internal.salesforce.com/sfci/docker-images/sfdc_centos7_java_build:latest
commands:
- rm -rf /root/.m2/repository/
- ln -s /cix/tmp/.strata/.m2/repository /root/.m2/repository
- cd jvm
- mvn --version
- bash ../scripts/determine-next-version.bash ml4ir
# set pom version to the latest released-version
# increase the version incrementally
- mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}
- mvn install
- step:
name: git-tags
image: dva-registry.internal.salesforce.com/sfci/docker-images/sfdc_centos7_java_build:latest
when:
- operator: EQ
value: $$IS_PRODUCTION_BRANCH
other: 'true'
commands:
- git config user.email "[email protected]"
- git config user.name "SFCI Team"
- pwd
# Sets a tag like "ml4ir-5.0.7". The command does not attempt to push the tag.
# Notice the '|| true' at the end!
- mvn build-helper:parse-version scm:tag -Dtag=ml4ir-\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion} -DpushChanges=false || true
publish:
- publish-jar:
artifacts:
- groupId: "com.salesforce.services.search"
artifactId: "ml4ir-parent"
- groupId: "com.salesforce.services.search"
artifactId: "ml4ir-inference"
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Comment line immediately above ownership line is reserved for related gus information. Please be careful while editing.
#ECCN:Open Source
#GUSINFO: Document Search Relevance,Default
*
3 changes: 2 additions & 1 deletion jvm/ml4ir-inference/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ml4ir</groupId>
<groupId>com.salesforce.services.search</groupId>
<artifactId>ml4ir-parent</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>
Expand Down Expand Up @@ -153,6 +153,7 @@
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
Expand Down
2 changes: 1 addition & 1 deletion jvm/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ml4ir</groupId>
<groupId>com.salesforce.services.search</groupId>
<artifactId>ml4ir-parent</artifactId>
<version>0.1-SNAPSHOT</version>
<name>ml4ir-parent</name>
Expand Down
16 changes: 16 additions & 0 deletions scripts/determine-next-version.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Determines the next version to use to publish to Nexus.

# Script is used by .strata.yml

set -x

GIT_TAG_PREFIX=$1
function determine_version_from_tags() {
git tag | grep $GIT_TAG_PREFIX | sort --version-sort | tail -1 | perl -pe "s;${GIT_TAG_PREFIX}-;;"
}

# mvn build-helper:released-version versions:set -DnewVersion=\${releasedVersion.version} || \
mvn versions:set -DnewVersion=$(determine_version_from_tags)

0 comments on commit acc5f40

Please sign in to comment.