Skip to content

The Unified and Autonomous Development Platform

Refactoring build process

robin shen3f72f23be6f4
diff --git a/server-product/build/build.sh b/server-product/build/build.sh
deleted file mode 100755
index ad27bb3757..0000000000
--- a/server-product/build/build.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-set -e
-docker login -u robinshen -p $@
-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
-
-cat << EOF > ../target/docker/run.sh
-docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v \$(which docker):/usr/bin/docker -v \$(pwd)/onedev:/opt/onedev -p 6610:6610 1dev/server:${buildVersion}
-EOF
-chmod +x ../target/docker/run.sh
-
-unzip ../target/onedev-${buildVersion}.zip -d ../target/docker
-mv ../target/docker/onedev-${buildVersion} ../target/docker/app
-cp ../target/sandbox/site/lib/mysql* ../target/sandbox/site/lib/postgresql* ../target/docker/app/site/lib
-docker build -t 1dev/server:${buildVersion} ../target/docker
-docker push 1dev/server:${buildVersion}
-docker tag 1dev/server:${buildVersion} 1dev/server:latest
-docker push 1dev/server:latest
-
-cp -r k8s ../target/k8s
-find ../target/k8s -name "*.yaml" | xargs sed -i -e "s/\${buildVersion}/${buildVersion}/g"
diff --git a/server-product/build/docker/Dockerfile b/server-product/docker/Dockerfile
similarity index 100%
rename from server-product/build/docker/Dockerfile
rename to server-product/docker/Dockerfile
diff --git a/server-product/build/docker/entrypoint.sh b/server-product/docker/entrypoint.sh
similarity index 100%
rename from server-product/build/docker/entrypoint.sh
rename to server-product/docker/entrypoint.sh
diff --git a/server-product/build/docker/idle.sh b/server-product/docker/idle.sh
similarity index 100%
rename from server-product/build/docker/idle.sh
rename to server-product/docker/idle.sh
diff --git a/server-product/build/docker/kubectl b/server-product/docker/kubectl
similarity index 100%
rename from server-product/build/docker/kubectl
rename to server-product/docker/kubectl
diff --git a/server-product/build/k8s/base/README b/server-product/k8s/base/README
similarity index 100%
rename from server-product/build/k8s/base/README
rename to server-product/k8s/base/README
diff --git a/server-product/build/k8s/base/cluster-role-bindings.yaml b/server-product/k8s/base/cluster-role-bindings.yaml
similarity index 100%
rename from server-product/build/k8s/base/cluster-role-bindings.yaml
rename to server-product/k8s/base/cluster-role-bindings.yaml
diff --git a/server-product/build/k8s/base/cluster-roles.yaml b/server-product/k8s/base/cluster-roles.yaml
similarity index 100%
rename from server-product/build/k8s/base/cluster-roles.yaml
rename to server-product/k8s/base/cluster-roles.yaml
diff --git a/server-product/build/k8s/base/deployments.yaml b/server-product/k8s/base/deployments.yaml
similarity index 100%
rename from server-product/build/k8s/base/deployments.yaml
rename to server-product/k8s/base/deployments.yaml
diff --git a/server-product/build/k8s/base/kustomization.yaml b/server-product/k8s/base/kustomization.yaml
similarity index 100%
rename from server-product/build/k8s/base/kustomization.yaml
rename to server-product/k8s/base/kustomization.yaml
diff --git a/server-product/build/k8s/base/namespaces.yaml b/server-product/k8s/base/namespaces.yaml
similarity index 100%
rename from server-product/build/k8s/base/namespaces.yaml
rename to server-product/k8s/base/namespaces.yaml
diff --git a/server-product/build/k8s/base/persistent-volume-claims.yaml b/server-product/k8s/base/persistent-volume-claims.yaml
similarity index 100%
rename from server-product/build/k8s/base/persistent-volume-claims.yaml
rename to server-product/k8s/base/persistent-volume-claims.yaml
diff --git a/server-product/build/k8s/base/service-accounts.yaml b/server-product/k8s/base/service-accounts.yaml
similarity index 100%
rename from server-product/build/k8s/base/service-accounts.yaml
rename to server-product/k8s/base/service-accounts.yaml
diff --git a/server-product/build/k8s/base/services.yaml b/server-product/k8s/base/services.yaml
similarity index 100%
rename from server-product/build/k8s/base/services.yaml
rename to server-product/k8s/base/services.yaml
diff --git a/server-product/build/k8s/maintenance/README b/server-product/k8s/maintenance/README
similarity index 100%
rename from server-product/build/k8s/maintenance/README
rename to server-product/k8s/maintenance/README
diff --git a/server-product/build/k8s/maintenance/deployments.yaml b/server-product/k8s/maintenance/deployments.yaml
similarity index 100%
rename from server-product/build/k8s/maintenance/deployments.yaml
rename to server-product/k8s/maintenance/deployments.yaml
diff --git a/server-product/build/k8s/maintenance/kustomization.yaml b/server-product/k8s/maintenance/kustomization.yaml
similarity index 100%
rename from server-product/build/k8s/maintenance/kustomization.yaml
rename to server-product/k8s/maintenance/kustomization.yaml
diff --git a/server-product/build/k8s/mini/README b/server-product/k8s/mini/README
similarity index 100%
rename from server-product/build/k8s/mini/README
rename to server-product/k8s/mini/README
diff --git a/server-product/build/k8s/mini/disk-settings.yaml b/server-product/k8s/mini/disk-settings.yaml
similarity index 100%
rename from server-product/build/k8s/mini/disk-settings.yaml
rename to server-product/k8s/mini/disk-settings.yaml
diff --git a/server-product/build/k8s/mini/kustomization.yaml b/server-product/k8s/mini/kustomization.yaml
similarity index 100%
rename from server-product/build/k8s/mini/kustomization.yaml
rename to server-product/k8s/mini/kustomization.yaml
diff --git a/server-product/build/k8s/production/disk-settings.yaml b/server-product/k8s/production/disk-settings.yaml
similarity index 100%
rename from server-product/build/k8s/production/disk-settings.yaml
rename to server-product/k8s/production/disk-settings.yaml
diff --git a/server-product/build/k8s/production/kustomization.yaml b/server-product/k8s/production/kustomization.yaml
similarity index 100%
rename from server-product/build/k8s/production/kustomization.yaml
rename to server-product/k8s/production/kustomization.yaml
diff --git a/server-product/build/k8s/production/memory-settings.yaml b/server-product/k8s/production/memory-settings.yaml
similarity index 100%
rename from server-product/build/k8s/production/memory-settings.yaml
rename to server-product/k8s/production/memory-settings.yaml
diff --git a/server-product/build/k8s/production/node-selectors.yaml b/server-product/k8s/production/node-selectors.yaml
similarity index 100%
rename from server-product/build/k8s/production/node-selectors.yaml
rename to server-product/k8s/production/node-selectors.yaml
diff --git a/server-product/build/k8s/ssl/README b/server-product/k8s/ssl/README
similarity index 100%
rename from server-product/build/k8s/ssl/README
rename to server-product/k8s/ssl/README
diff --git a/server-product/build/k8s/ssl/deployments.yaml b/server-product/k8s/ssl/deployments.yaml
similarity index 100%
rename from server-product/build/k8s/ssl/deployments.yaml
rename to server-product/k8s/ssl/deployments.yaml
diff --git a/server-product/build/k8s/ssl/kustomization.yaml b/server-product/k8s/ssl/kustomization.yaml
similarity index 100%
rename from server-product/build/k8s/ssl/kustomization.yaml
rename to server-product/k8s/ssl/kustomization.yaml
diff --git a/server-product/build/k8s/ssl/services.yaml b/server-product/k8s/ssl/services.yaml
similarity index 100%
rename from server-product/build/k8s/ssl/services.yaml
rename to server-product/k8s/ssl/services.yaml
diff --git a/server-product/build/k8s/trust-certs/README b/server-product/k8s/trust-certs/README
similarity index 100%
rename from server-product/build/k8s/trust-certs/README
rename to server-product/k8s/trust-certs/README
diff --git a/server-product/build/k8s/trust-certs/deployments.yaml b/server-product/k8s/trust-certs/deployments.yaml
similarity index 100%
rename from server-product/build/k8s/trust-certs/deployments.yaml
rename to server-product/k8s/trust-certs/deployments.yaml
diff --git a/server-product/build/k8s/trust-certs/kustomization.yaml b/server-product/k8s/trust-certs/kustomization.yaml
similarity index 100%
rename from server-product/build/k8s/trust-certs/kustomization.yaml
rename to server-product/k8s/trust-certs/kustomization.yaml