The Unified and Autonomous Development Platform
versioning server docker image
Robin Shenacb629295a67
diff --git a/docker/build.sh b/docker/build.shdeleted file mode 100755index af8d54bedb..0000000000--- a/docker/build.sh+++ /dev/null@@ -1,9 +0,0 @@-#!/bin/sh-mvn clean package -f ../pom.xml-rm -rf build onedev-*-unzip ../server-product/target/onedev-*.zip-mv onedev-* build-cp ../server-product/target/sandbox/site/lib/mysql* ../server-product/target/sandbox/site/lib/postgresql* build/site/lib-docker build -t 1dev/server:latest .-docker push 1dev/server:latest-rm -rf builddiff --git a/docker/run.sh b/docker/run.shdeleted file mode 100755index 80de008b22..0000000000--- a/docker/run.sh+++ /dev/null@@ -1,2 +0,0 @@-#!/bin/sh-docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker -v /opt/onedev:/opt/onedev -p 6610:6610 1dev/serverdiff --git a/k8s/mini/disk-settings.yaml b/k8s/mini/disk-settings.yamldeleted file mode 100644index ca6c26e339..0000000000--- a/k8s/mini/disk-settings.yaml+++ /dev/null@@ -1,17 +0,0 @@-apiVersion: v1-kind: PersistentVolumeClaim-metadata:- name: onedev-spec:- resources:- requests:- storage: 1Gi-----apiVersion: v1-kind: PersistentVolumeClaim-metadata:- name: mysql-spec:- resources:- requests:- storage: 1Gidiff --git a/k8s/production/disk-settings.yaml b/k8s/production/disk-settings.yamldeleted file mode 100644index b2d9b4cabc..0000000000--- a/k8s/production/disk-settings.yaml+++ /dev/null@@ -1,17 +0,0 @@-apiVersion: v1-kind: PersistentVolumeClaim-metadata:- name: onedev-spec:- resources:- requests:- storage: 100Gi-----apiVersion: v1-kind: PersistentVolumeClaim-metadata:- name: mysql-spec:- resources:- requests:- storage: 10Gidiff --git a/pom.xml b/pom.xmlindex 5941e12d13..872eafeaa5 100644--- a/pom.xml+++ b/pom.xml@@ -7,7 +7,7 @@<version>1.0.3</version></parent><artifactId>server</artifactId>- <version>3.0.1</version>+ <version>3.0.2</version><packaging>pom</packaging><build><finalName>${project.groupId}.${project.artifactId}-${project.version}</finalName>diff --git a/server-core/pom.xml b/server-core/pom.xmlindex d046166d9b..0bca126493 100644--- a/server-core/pom.xml+++ b/server-core/pom.xml@@ -7,7 +7,7 @@<parent><groupId>io.onedev</groupId><artifactId>server</artifactId>- <version>3.0.1</version>+ <version>3.0.2</version></parent><build><plugins>diff --git a/server-plugin/pom.xml b/server-plugin/pom.xmlindex cc169a7ad1..1c4642a288 100644--- a/server-plugin/pom.xml+++ b/server-plugin/pom.xml@@ -6,7 +6,7 @@<parent><groupId>io.onedev</groupId><artifactId>server</artifactId>- <version>3.0.1</version>+ <version>3.0.2</version></parent><dependencies><dependency>diff --git a/server-plugin/server-plugin-archetype/pom.xml b/server-plugin/server-plugin-archetype/pom.xmlindex f2de6d1755..9ea00613db 100644--- a/server-plugin/server-plugin-archetype/pom.xml+++ b/server-plugin/server-plugin-archetype/pom.xml@@ -6,7 +6,7 @@<parent><groupId>io.onedev</groupId><artifactId>server-plugin</artifactId>- <version>3.0.1</version>+ <version>3.0.2</version></parent><build><resources>diff --git a/server-plugin/server-plugin-cispec-gradle/pom.xml b/server-plugin/server-plugin-cispec-gradle/pom.xmlindex 8bd1a4f989..66823d1226 100644--- a/server-plugin/server-plugin-cispec-gradle/pom.xml+++ b/server-plugin/server-plugin-cispec-gradle/pom.xml@@ -5,7 +5,7 @@<parent><groupId>io.onedev</groupId><artifactId>server-plugin</artifactId>- <version>3.0.1</version>+ <version>3.0.2</version></parent><dependencies><dependency>diff --git a/server-plugin/server-plugin-cispec-maven/pom.xml b/server-plugin/server-plugin-cispec-maven/pom.xmlindex a155ed7138..11c1a21d9b 100644--- a/server-plugin/server-plugin-cispec-maven/pom.xml+++ b/server-plugin/server-plugin-cispec-maven/pom.xml@@ -5,7 +5,7 @@<parent><groupId>io.onedev</groupId><artifactId>server-plugin</artifactId>- <version>3.0.1</version>+ <version>3.0.2</version></parent><properties><moduleClass>io.onedev.server.plugin.cispec.maven.MavenModule</moduleClass>diff --git a/server-plugin/server-plugin-cispec-node/pom.xml b/server-plugin/server-plugin-cispec-node/pom.xmlindex 2cb09030e8..7dff091ca3 100644--- a/server-plugin/server-plugin-cispec-node/pom.xml+++ b/server-plugin/server-plugin-cispec-node/pom.xml@@ -5,7 +5,7 @@<parent><groupId>io.onedev</groupId><artifactId>server-plugin</artifactId>- <version>3.0.1</version>+ <version>3.0.2</version></parent><properties><moduleClass>io.onedev.server.plugin.cispec.node.NodePluginModule</moduleClass>diff --git a/server-plugin/server-plugin-executor-docker/pom.xml b/server-plugin/server-plugin-executor-docker/pom.xmlindex 4289fe6a78..f7b88790e6 100644--- a/server-plugin/server-plugin-executor-docker/pom.xml+++ b/server-plugin/server-plugin-executor-docker/pom.xml@@ -5,7 +5,7 @@<parent><groupId>io.onedev</groupId><artifactId>server-plugin</artifactId>- <version>3.0.1</version>+ <version>3.0.2</version></parent><properties><moduleClass>io.onedev.server.plugin.docker.DockerModule</moduleClass>diff --git a/server-plugin/server-plugin-executor-kubernetes/pom.xml b/server-plugin/server-plugin-executor-kubernetes/pom.xmlindex 77291cd360..c9b3e71be9 100644--- a/server-plugin/server-plugin-executor-kubernetes/pom.xml+++ b/server-plugin/server-plugin-executor-kubernetes/pom.xml@@ -6,7 +6,7 @@<parent><groupId>io.onedev</groupId><artifactId>server-plugin</artifactId>- <version>3.0.1</version>+ <version>3.0.2</version></parent><properties><moduleClass>io.onedev.server.plugin.executor.kubernetes.KubernetesModule</moduleClass>diff --git a/server-plugin/server-plugin-report-html/pom.xml b/server-plugin/server-plugin-report-html/pom.xmlindex 0cd023cc79..7d6f7dd480 100644--- a/server-plugin/server-plugin-report-html/pom.xml+++ b/server-plugin/server-plugin-report-html/pom.xml@@ -6,7 +6,7 @@<parent><groupId>io.onedev</groupId><artifactId>server-plugin</artifactId>- <version>3.0.1</version>+ <version>3.0.2</version></parent><properties><moduleClass>io.onedev.server.plugin.report.html.HtmlReportModule</moduleClass>diff --git a/server-product/build/build.sh b/server-product/build/build.shnew file mode 100755index 0000000000..9aea277568--- /dev/null+++ b/server-product/build/build.sh@@ -0,0 +1,14 @@+#!/bin/sh+buildVersion=$(mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout -f ../../pom.xml)+mvn clean package -f ../../pom.xml++mkdir ../target/docker+cp docker/* ../target/docker+unzip ../target/onedev-${buildVersion}.zip -d ../target/docker+mv ../target/docker/onedev-${buildVersion} ../target/docker/onedev+cp ../target/sandbox/site/lib/mysql* ../target/sandbox/site/lib/postgresql* ../target/docker/onedev/site/lib+docker build -t 1dev/server:${buildVersion} ../target/docker+docker push 1dev/server:${buildVersion}++cp -r k8s ../target/k8s+find ../target/k8s -name "*.yaml" | xargs sed -i -e "s/\${buildVersion}/${buildVersion}/g"diff --git a/docker/Dockerfile b/server-product/build/docker/Dockerfilesimilarity index 92%rename from docker/Dockerfilerename to server-product/build/docker/Dockerfileindex 27808e28f3..b6de1dc0f8 100644--- a/docker/Dockerfile+++ b/server-product/build/docker/Dockerfile@@ -1,5 +1,5 @@FROM ubuntu:18.04-COPY build /app+COPY onedev /appCOPY entrypoint.sh idle.sh /root/bin/COPY kubectl /usr/local/bin/RUN apt-get update && apt-get install -y curl git openjdk-8-jre-headlessdiff --git a/docker/entrypoint.sh b/server-product/build/docker/entrypoint.shsimilarity index 100%rename from docker/entrypoint.shrename to server-product/build/docker/entrypoint.shdiff --git a/docker/idle.sh b/server-product/build/docker/idle.shsimilarity index 100%rename from docker/idle.shrename to server-product/build/docker/idle.shdiff --git a/docker/kubectl b/server-product/build/docker/kubectlsimilarity index 100%rename from docker/kubectlrename to server-product/build/docker/kubectldiff --git a/server-product/build/docker/run.sh b/server-product/build/docker/run.shnew file mode 100755index 0000000000..b5083449eb--- /dev/null+++ b/server-product/build/docker/run.sh@@ -0,0 +1,3 @@+#!/bin/sh+buildVersion=$(mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout -f ../pom.xml)+docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker -v /opt/onedev:/opt/onedev -p 6610:6610 1dev/server:${buildVersion}diff --git a/k8s/base/cluster-role-bindings.yaml b/server-product/build/k8s/base/cluster-role-bindings.yamlsimilarity index 100%rename from k8s/base/cluster-role-bindings.yamlrename to server-product/build/k8s/base/cluster-role-bindings.yamldiff --git a/k8s/base/cluster-roles.yaml b/server-product/build/k8s/base/cluster-roles.yamlsimilarity index 100%rename from k8s/base/cluster-roles.yamlrename to server-product/build/k8s/base/cluster-roles.yamldiff --git a/server-product/build/k8s/base/deployments.yaml b/server-product/build/k8s/base/deployments.yamlnew file mode 100644index 0000000000..549a37bf36--- /dev/null+++ b/server-product/build/k8s/base/deployments.yaml@@ -0,0 +1,96 @@+apiVersion: apps/v1+kind: Deployment+metadata:+ name: onedev+ labels:+ tier: server+spec:+ selector:+ matchLabels:+ tier: server+ strategy:+ type: Recreate+ template:+ metadata:+ name: onedev+ labels:+ tier: server+ spec:+ containers:+ - name: onedev+ image: 1dev/server+ volumeMounts:+ - mountPath: "/opt/onedev"+ name: onedev+ ports:+ - containerPort: 6610+ env:+ - name: hibernate_dialect+ value: org.hibernate.dialect.MySQL5InnoDBDialect+ - name: hibernate_connection_driver_class+ value: com.mysql.cj.jdbc.Driver+ - name: hibernate_connection_url+ value: jdbc:mysql://mysql:3306/onedev?serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false+ - name: hibernate_connection_username+ value: onedev+ - name: hibernate_connection_password+ valueFrom:+ secretKeyRef:+ name: mysql+ key: password+ initContainers:+ - name: init+ image: busybox+ command: ["sh", "-c", "until nslookup mysql.onedev.svc.cluster.local; do echo waiting for mysql; sleep 2; done;"]+ serviceAccountName: onedev+---+apiVersion: apps/v1+kind: Deployment+metadata:+ name: mysql+ labels:+ tier: database+spec:+ selector:+ matchLabels:+ tier: database+ strategy:+ type: Recreate+ template:+ metadata:+ name: mysql+ labels:+ tier: database+ spec:+ containers:+ - name: mysql+ image: mysql:5.7+ args:+ - "--ignore-db-dir=lost+found"+ env:+ - name: MYSQL_RANDOM_ROOT_PASSWORD+ value: "yes"+ - name: MYSQL_DATABASE+ value: onedev+ - name: MYSQL_USER+ value: onedev+ - name: MYSQL_PASSWORD+ valueFrom:+ secretKeyRef:+ name: mysql+ key: password+ ports:+ - containerPort: 3306+ volumeMounts:+ - name: mysql+ mountPath: /var/lib/mysql+ readinessProbe:+ exec:+ command:+ - bash+ - "-c"+ - |+ mysql -uonedev -p$MYSQL_PASSWORD -e 'SELECT 1'+ initialDelaySeconds: 5+ periodSeconds: 2+ timeoutSeconds: 1diff --git a/k8s/base/kustomization.yaml b/server-product/build/k8s/base/kustomization.yamlsimilarity index 100%rename from k8s/base/kustomization.yamlrename to server-product/build/k8s/base/kustomization.yamldiff --git a/k8s/base/namespaces.yaml b/server-product/build/k8s/base/namespaces.yamlsimilarity index 100%rename from k8s/base/namespaces.yamlrename to server-product/build/k8s/base/namespaces.yamldiff --git a/k8s/base/persistent-volume-claims.yaml b/server-product/build/k8s/base/persistent-volume-claims.yamlsimilarity index 100%rename from k8s/base/persistent-volume-claims.yamlrename to server-product/build/k8s/base/persistent-volume-claims.yamldiff --git a/k8s/base/service-accounts.yaml b/server-product/build/k8s/base/service-accounts.yamlsimilarity index 100%rename from k8s/base/service-accounts.yamlrename to server-product/build/k8s/base/service-accounts.yamldiff --git a/k8s/base/services.yaml b/server-product/build/k8s/base/services.yamlsimilarity index 100%rename from k8s/base/services.yamlrename to server-product/build/k8s/base/services.yamldiff --git a/k8s/maintenance/deployments.yaml b/server-product/build/k8s/maintenance/deployments.yamlsimilarity index 100%rename from k8s/maintenance/deployments.yamlrename to server-product/build/k8s/maintenance/deployments.yamldiff --git a/k8s/maintenance/kustomization.yaml b/server-product/build/k8s/maintenance/kustomization.yamlsimilarity index 100%rename from k8s/maintenance/kustomization.yamlrename to server-product/build/k8s/maintenance/kustomization.yamldiff --git a/k8s/mini/README.md b/server-product/build/k8s/mini/README.mdsimilarity index 100%rename from k8s/mini/README.mdrename to server-product/build/k8s/mini/README.mddiff --git a/server-product/build/k8s/mini/disk-settings.yaml b/server-product/build/k8s/mini/disk-settings.yamlnew file mode 100644index 0000000000..b396214af4--- /dev/null+++ b/server-product/build/k8s/mini/disk-settings.yaml@@ -0,0 +1,45 @@+apiVersion: apps/v1+kind: Deployment+metadata:+ name: onedev+spec:+ template:+ spec:+ containers:+ - name: onedev+ volumes:+ - name: onedev+ persistentVolumeClaim:+ claimName: onedev+---+apiVersion: apps/v1+kind: Deployment+metadata:+ name: mysql+spec:+ template:+ spec:+ containers:+ - name: mysql+ volumes:+ - name: mysql+ persistentVolumeClaim:+ claimName: mysql+---+apiVersion: v1+kind: PersistentVolumeClaim+metadata:+ name: onedev+spec:+ resources:+ requests:+ storage: 1Gi+---+apiVersion: v1+kind: PersistentVolumeClaim+metadata:+ name: mysql+spec:+ resources:+ requests:+ storage: 500Midiff --git a/k8s/mini/kustomization.yaml b/server-product/build/k8s/mini/kustomization.yamlsimilarity index 59%rename from k8s/mini/kustomization.yamlrename to server-product/build/k8s/mini/kustomization.yamlindex a16b850657..285b137210 100644--- a/k8s/mini/kustomization.yaml+++ b/server-product/build/k8s/mini/kustomization.yaml@@ -1,4 +1,7 @@namespace: onedev+images:+- name: 1dev/server+ newTag: ${buildVersion}bases:- ../basepatchesStrategicMerge:diff --git a/k8s/base/deployments.yaml b/server-product/build/k8s/production/deployments.yamlsimilarity index 100%rename from k8s/base/deployments.yamlrename to server-product/build/k8s/production/deployments.yamldiff --git a/server-product/build/k8s/production/disk-settings.yaml b/server-product/build/k8s/production/disk-settings.yamlnew file mode 100644index 0000000000..850f0bfca5--- /dev/null+++ b/server-product/build/k8s/production/disk-settings.yaml@@ -0,0 +1,45 @@+apiVersion: apps/v1+kind: Deployment+metadata:+ name: onedev+spec:+ template:+ spec:+ containers:+ - name: onedev+ volumes:+ - name: onedev+ persistentVolumeClaim:+ claimName: onedev+---+apiVersion: apps/v1+kind: Deployment+metadata:+ name: mysql+spec:+ template:+ spec:+ containers:+ - name: mysql+ volumes:+ - name: mysql+ persistentVolumeClaim:+ claimName: mysql+---+apiVersion: v1+kind: PersistentVolumeClaim+metadata:+ name: onedev+spec:+ resources:+ requests:+ storage: 100Gi+---+apiVersion: v1+kind: PersistentVolumeClaim+metadata:+ name: mysql+spec:+ resources:+ requests:+ storage: 10Gidiff --git a/k8s/production/kustomization.yaml b/server-product/build/k8s/production/kustomization.yamlsimilarity index 73%rename from k8s/production/kustomization.yamlrename to server-product/build/k8s/production/kustomization.yamlindex 2f09f28afc..a88a03c067 100644--- a/k8s/production/kustomization.yaml+++ b/server-product/build/k8s/production/kustomization.yaml@@ -3,6 +3,9 @@ bases:- ../basecommonLabels:app: onedev+images:+- name: 1dev/server+ newTag: ${buildVersion}patchesStrategicMerge:- node-selectors.yaml- memory-settings.yamldiff --git a/k8s/production/memory-settings.yaml b/server-product/build/k8s/production/memory-settings.yamlsimilarity index 100%rename from k8s/production/memory-settings.yamlrename to server-product/build/k8s/production/memory-settings.yamldiff --git a/k8s/production/node-selectors.yaml b/server-product/build/k8s/production/node-selectors.yamlsimilarity index 100%rename from k8s/production/node-selectors.yamlrename to server-product/build/k8s/production/node-selectors.yamldiff --git a/k8s/ssl/README.md b/server-product/build/k8s/ssl/README.mdsimilarity index 100%rename from k8s/ssl/README.mdrename to server-product/build/k8s/ssl/README.mddiff --git a/k8s/ssl/deployments.yaml b/server-product/build/k8s/ssl/deployments.yamlsimilarity index 100%rename from k8s/ssl/deployments.yamlrename to server-product/build/k8s/ssl/deployments.yamldiff --git a/k8s/ssl/kustomization.yaml b/server-product/build/k8s/ssl/kustomization.yamlsimilarity index 100%rename from k8s/ssl/kustomization.yamlrename to server-product/build/k8s/ssl/kustomization.yamldiff --git a/k8s/ssl/services.yaml b/server-product/build/k8s/ssl/services.yamlsimilarity index 100%rename from k8s/ssl/services.yamlrename to server-product/build/k8s/ssl/services.yamldiff --git a/k8s/trust-certs/README.md b/server-product/build/k8s/trust-certs/README.mdsimilarity index 100%rename from k8s/trust-certs/README.mdrename to server-product/build/k8s/trust-certs/README.mddiff --git a/k8s/trust-certs/deployments.yaml b/server-product/build/k8s/trust-certs/deployments.yamlsimilarity index 100%rename from k8s/trust-certs/deployments.yamlrename to server-product/build/k8s/trust-certs/deployments.yamldiff --git a/k8s/trust-certs/kustomization.yaml b/server-product/build/k8s/trust-certs/kustomization.yamlsimilarity index 100%rename from k8s/trust-certs/kustomization.yamlrename to server-product/build/k8s/trust-certs/kustomization.yamldiff --git a/server-product/pom.xml b/server-product/pom.xmlindex ffe7f71e01..58c4ef5a3f 100644--- a/server-product/pom.xml+++ b/server-product/pom.xml@@ -7,7 +7,7 @@<parent><groupId>io.onedev</groupId><artifactId>server</artifactId>- <version>3.0.1</version>+ <version>3.0.2</version></parent><dependencies><dependency>