[Operator] Allow to set the version of the Gerrit Operator

This change allows to set the version of the Gerrit Operator in
the jar file and as the tag of the container image.

Change-Id: I941b52dc390022ed1766229c6cc9276bbc2882bb
diff --git a/Documentation/operator.md b/Documentation/operator.md
index e6acf21..55eed96 100644
--- a/Documentation/operator.md
+++ b/Documentation/operator.md
@@ -37,6 +37,12 @@
 locally. Moreover, the CRD helm chart is updated with the latest CRDs as part of
 this build step.
 
+The jar-version and container image tag can be set using the `revision` property:
+
+```sh
+mvn clean install -Drevision=$(git describe --always --dirty)
+```
+
 ## Versioning
 
 The Gerrit Operator is still in an early state of development. The operator is
diff --git a/operator/pom.xml b/operator/pom.xml
index d8d01c9..ce7a44c 100644
--- a/operator/pom.xml
+++ b/operator/pom.xml
@@ -6,13 +6,15 @@
 
 	<groupId>com.google.gerrit.operator</groupId>
 	<artifactId>operator</artifactId>
-	<version>0.1-SNAPSHOT</version>
+	<version>${revision}</version>
 
 	<name>Gerrit Kubernetes Operator</name>
 	<description>Provisions and operates Gerrit instances in Kubernetes</description>
 	<packaging>jar</packaging>
 
 	<properties>
+		<revision>1.0.0-SNAPSHOT</revision>
+
 		<fabric8.version>6.6.2</fabric8.version>
 		<flogger.version>0.7.4</flogger.version>
 		<javaoperatorsdk.version>4.3.3</javaoperatorsdk.version>
@@ -289,6 +291,7 @@
 							</from>
 							<to>
 								<image>gerrit-operator</image>
+								<tags>${revision}</tags>
 							</to>
 						</configuration>
 					</execution>