Skip to content

Commit

Permalink
Prepare version 4.5.0
Browse files Browse the repository at this point in the history
- Update Cassandra to 3.11.9 and Datastax driver to 4.10.0
- Add caching in build pipelines
- Create GitHub release from release pipeline
  • Loading branch information
maximevw committed Apr 13, 2021
1 parent e9a8a4b commit 3839a8f
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,13 @@ jobs:
with:
java-version: 8

- name: Cache Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: mvn-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
mvn-${{ runner.os }}-
- name: Build with Maven
run: mvn -B package verify
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Next release
## 4.5.0 - 2021-04-13
### Added
- Manage additional CQL types: `duration`, `smallint` and `tinyint`.
- Add support for SSL between the driver and the Cassandra cluster.
Expand All @@ -16,6 +16,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Add codecs for conversions between `Integer` and CQL types `varint`, `smallint` and `tinyint`. It also fixes the issue
[#33](https://github.com/adejanovski/cassandra-jdbc-wrapper/issues/33) of the [original project].
### Changed
- Update DataStax Java Driver for Apache Cassandra(R) to version 4.10.0.
- Update `cassandra-all` to version 3.11.9.
- Improve documentation and code quality (refactoring, removing dead code, adding tests, ...).
- Improve the implementation of the metadata precision/size for the columns.
### Fixed
Expand Down
14 changes: 14 additions & 0 deletions azure-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@ trigger:
pool:
vmImage: 'ubuntu-latest'

variables:
MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository
MAVEN_OPTS: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'

steps:
- task: Cache@2
displayName: 'Cache Maven repository'
inputs:
key: 'mvn | "$(Agent.OS)" | **/pom.xml'
restoreKeys: |
mvn | "$(Agent.OS)"
mvn
path: $(MAVEN_CACHE_FOLDER)

- task: Maven@3
displayName: 'Maven build'
inputs:
Expand All @@ -18,3 +31,4 @@ steps:
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'package verify'
mavenOptions: '$(MAVEN_OPTS)'
62 changes: 62 additions & 0 deletions azure-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ pool:
variables:
- group: SonatypeCredentials
- group: GPGKey
- name: MAVEN_CACHE_FOLDER
value: $(Pipeline.Workspace)/.m2/repository
- name: MAVEN_OPTS
value: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'

steps:
- task: DownloadSecureFile@1
Expand Down Expand Up @@ -42,6 +46,15 @@ steps:
# Needed for GPG to work on headless Azure agents
GPG_TTY: /dev/pts/0

- task: Cache@2
displayName: 'Cache Maven repository'
inputs:
key: 'mvn | "$(Agent.OS)" | **/pom.xml'
restoreKeys: |
mvn | "$(Agent.OS)"
mvn
path: $(MAVEN_CACHE_FOLDER)

- task: Maven@3
displayName: 'Maven package and publish'
inputs:
Expand All @@ -51,6 +64,7 @@ steps:
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'deploy'
mavenOptions: '$(MAVEN_OPTS)'
options: '-s $(System.DefaultWorkingDirectory)/release-settings.xml -Prelease -Dgpg.passphrase=$(GPG_PASSPHRASE)'
env:
# Secrets must be extracted explicitly
Expand All @@ -66,3 +80,51 @@ steps:
rm -rf $(pubring.secureFilePath)
rm -rf $(secring.secureFilePath)
rm -rf ~/.gnupg
- task: Maven@3
displayName: 'Retrieve artifact version'
inputs:
effectivePomSkip: true
mavenPomFile: 'pom.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'help:evaluate'
mavenOptions: '$(MAVEN_OPTS)'
options: '--log-file $(Pipeline.Workspace)/version.txt -Dexpression=project.version -q -DforceStdout'

- task: Bash@3
displayName: 'Store artifact version into a variable'
inputs:
targetType: 'inline'
workingDirectory: $(Pipeline.Workspace)
script: |
artifactVersion=$(cat version.txt)
echo "##vso[task.setvariable variable=artifactVersion]${artifactVersion}"
echo Built version: ${artifactVersion}
rm ./version.txt
- task: Maven@3
displayName: 'Maven build bundle'
inputs:
mavenPomFile: 'pom.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'clean package'
mavenOptions: '$(MAVEN_OPTS)'
options: '-Pbundle'

- task: GitHubRelease@0
displayName: 'Create GitHub release'
inputs:
gitHubConnection: 'ing-bank'
repositoryName: $(Build.Repository.Name)
action: create
target: $(Build.SourceVersion)
tagSource: manual
tag: 'v$(artifactVersion)'
assets: $(Build.ArtifactStagingDirectory)/*-bundle.jar
isDraft: true
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.ing.data</groupId>
<artifactId>cassandra-jdbc-wrapper</artifactId>
<version>4.4.0</version>
<version>4.5.0</version>
<packaging>jar</packaging>

<name>Cassandra JDBC Wrapper</name>
Expand Down Expand Up @@ -69,9 +69,9 @@
<java.version>1.8</java.version>

<!-- Versions for dependencies -->
<cassandra-all.version>3.11.8</cassandra-all.version>
<cassandra-all.version>3.11.9</cassandra-all.version>
<commons-lang3.version>3.11</commons-lang3.version>
<datastax.java.driver.version>4.9.0</datastax.java.driver.version>
<datastax.java.driver.version>4.10.0</datastax.java.driver.version>
<libthrift.version>0.13.0</libthrift.version>
<!-- Versions for test dependencies -->
<achilles-embedded.version>6.0.4</achilles-embedded.version>
Expand Down Expand Up @@ -111,7 +111,7 @@
</exclusion>
</exclusions>
</dependency>
<!-- Force the use of a more recent (and non-vulnerable) version of libthrift. -->
<!-- Force the use of a more recent version of libthrift. -->
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.datastax.oss.driver.api.core.metadata.Node;
import com.datastax.oss.driver.api.core.session.Request;
import com.datastax.oss.driver.api.core.session.Session;
import com.datastax.oss.driver.internal.core.util.collection.QueryPlan;
import com.datastax.oss.driver.internal.core.util.collection.SimpleQueryPlan;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;

Expand All @@ -43,7 +43,7 @@ public void init(@NonNull final Map<UUID, Node> nodes, @NonNull final DistanceRe
@Override
public Queue<Node> newQueryPlan(@Nullable final Request request, @Nullable final Session session) {
// Do nothing. For testing purpose only.
return new QueryPlan(mock(Node.class));
return new SimpleQueryPlan(mock(Node.class));
}

@Override
Expand Down

0 comments on commit 3839a8f

Please sign in to comment.