diff --git a/.github/workflows/dockerpush.yml b/.github/workflows/dockerpush.yml index 61be3f8a..be968fe2 100644 --- a/.github/workflows/dockerpush.yml +++ b/.github/workflows/dockerpush.yml @@ -6,6 +6,7 @@ on: branches: - master - release + - develop # Publish `v1.2.3` tags as releases. tags: @@ -60,3 +61,6 @@ jobs: if [ "$VERSION" == "release" ]; then curl ${{ secrets.JENKINS_RELEASE_URL }} fi + if [ "$VERSION" == "develop" ]; then + curl ${{ secrets.JENKINS_DEVELOP_URL }} + fi diff --git a/devops/develop/crawlab-master.yaml b/devops/develop/crawlab-master.yaml new file mode 100644 index 00000000..68015e30 --- /dev/null +++ b/devops/develop/crawlab-master.yaml @@ -0,0 +1,49 @@ +apiVersion: v1 +kind: Service +metadata: + name: crawlab + namespace: crawlab-develop +spec: + ports: + - port: 8080 + targetPort: 8080 + nodePort: 30108 + selector: + app: crawlab-master + type: NodePort +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: crawlab-master + namespace: crawlab-develop +spec: + strategy: + type: Recreate + selector: + matchLabels: + app: crawlab-master + template: + metadata: + labels: + app: crawlab-master + spec: + containers: + - image: tikazyq/crawlab:develop + name: crawlab + env: + - name: CRAWLAB_SERVER_MASTER + value: "Y" + - name: CRAWLAB_MONGO_HOST + value: "mongo" + - name: CRAWLAB_REDIS_ADDRESS + value: "redis" + - name: CRAWLAB_SETTING_ALLOWREGISTER + value: "Y" + - name: CRAWLAB_SERVER_LANG_NODE + value: "Y" + - name: CRAWLAB_SERVER_LANG_JAVA + value: "Y" + ports: + - containerPort: 8080 + name: crawlab \ No newline at end of file diff --git a/devops/develop/crawlab-worker.yaml b/devops/develop/crawlab-worker.yaml new file mode 100644 index 00000000..7522a581 --- /dev/null +++ b/devops/develop/crawlab-worker.yaml @@ -0,0 +1,32 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: crawlab-worker + namespace: crawlab-develop +spec: + replicas: 2 + strategy: + type: Recreate + selector: + matchLabels: + app: crawlab-worker + template: + metadata: + labels: + app: crawlab-worker + spec: + containers: + - image: tikazyq/crawlab:develop + name: crawlab + env: + - name: CRAWLAB_SERVER_MASTER + value: "N" + - name: CRAWLAB_MONGO_HOST + value: "mongo" + - name: CRAWLAB_REDIS_ADDRESS + value: "redis" + - name: CRAWLAB_SERVER_LANG_NODE + value: "Y" + - name: CRAWLAB_SERVER_LANG_JAVA + value: "Y" + \ No newline at end of file diff --git a/devops/develop/mongo-pv.yaml b/devops/develop/mongo-pv.yaml new file mode 100644 index 00000000..e47a0ed9 --- /dev/null +++ b/devops/develop/mongo-pv.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: mongo-pv-volume-develop + namespace: crawlab-develop + labels: + type: local +spec: + storageClassName: manual + capacity: + storage: 2Gi + accessModes: + - ReadWriteOnce + hostPath: + path: "/data/crawlab-develop/mongodb/data" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mongo-pv-claim-develop + namespace: crawlab-develop +spec: + storageClassName: manual + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi \ No newline at end of file diff --git a/devops/develop/mongo.yaml b/devops/develop/mongo.yaml new file mode 100644 index 00000000..21a685bb --- /dev/null +++ b/devops/develop/mongo.yaml @@ -0,0 +1,41 @@ +apiVersion: v1 +kind: Service +metadata: + name: mongo + namespace: crawlab-develop +spec: + ports: + - port: 27017 + selector: + app: mongo + clusterIP: None +--- +apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 +kind: Deployment +metadata: + name: mongo + namespace: crawlab-develop +spec: + selector: + matchLabels: + app: mongo + strategy: + type: Recreate + template: + metadata: + labels: + app: mongo + spec: + containers: + - image: mongo:4 + name: mongo + ports: + - containerPort: 27017 + name: mongo + volumeMounts: + - name: mongo-persistent-storage + mountPath: /data/db + volumes: + - name: mongo-persistent-storage + persistentVolumeClaim: + claimName: mongo-pv-claim-develop \ No newline at end of file diff --git a/devops/develop/ns.yaml b/devops/develop/ns.yaml new file mode 100644 index 00000000..bef4391e --- /dev/null +++ b/devops/develop/ns.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: crawlab-develop \ No newline at end of file diff --git a/devops/develop/redis.yaml b/devops/develop/redis.yaml new file mode 100644 index 00000000..204e3242 --- /dev/null +++ b/devops/develop/redis.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis + namespace: crawlab-develop +spec: + ports: + - port: 6379 + selector: + app: redis + clusterIP: None +--- +apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 +kind: Deployment +metadata: + name: redis + namespace: crawlab-develop +spec: + selector: + matchLabels: + app: redis + strategy: + type: Recreate + template: + metadata: + labels: + app: redis + spec: + containers: + - image: redis + name: redis + ports: + - containerPort: 6379 + name: redis \ No newline at end of file diff --git a/devops/release/crawlab-master.yaml b/devops/release/crawlab-master.yaml index e886fdd3..759ef6b4 100644 --- a/devops/release/crawlab-master.yaml +++ b/devops/release/crawlab-master.yaml @@ -40,6 +40,10 @@ spec: value: "redis" - name: CRAWLAB_SETTING_ALLOWREGISTER value: "Y" + - name: CRAWLAB_SERVER_LANG_NODE + value: "Y" + - name: CRAWLAB_SERVER_LANG_JAVA + value: "Y" ports: - containerPort: 8080 name: crawlab \ No newline at end of file diff --git a/devops/release/crawlab-worker.yaml b/devops/release/crawlab-worker.yaml index 5bc2f396..986ee0c0 100644 --- a/devops/release/crawlab-worker.yaml +++ b/devops/release/crawlab-worker.yaml @@ -24,4 +24,8 @@ spec: - name: CRAWLAB_MONGO_HOST value: "mongo" - name: CRAWLAB_REDIS_ADDRESS - value: "redis" \ No newline at end of file + value: "redis" + - name: CRAWLAB_SERVER_LANG_NODE + value: "Y" + - name: CRAWLAB_SERVER_LANG_JAVA + value: "Y" diff --git a/k8s/crawlab-master.yaml b/k8s/crawlab-master.yaml index b87f6881..62ac6bca 100644 --- a/k8s/crawlab-master.yaml +++ b/k8s/crawlab-master.yaml @@ -38,6 +38,10 @@ spec: value: "mongo" - name: CRAWLAB_REDIS_ADDRESS value: "redis" + # - name: CRAWLAB_SERVER_LANG_NODE + # value: "Y" + # - name: CRAWLAB_SERVER_LANG_JAVA + # value: "Y" ports: - containerPort: 8080 name: crawlab diff --git a/k8s/crawlab-worker.yaml b/k8s/crawlab-worker.yaml index b54a7796..35ae200a 100644 --- a/k8s/crawlab-worker.yaml +++ b/k8s/crawlab-worker.yaml @@ -25,3 +25,7 @@ spec: value: "mongo" - name: CRAWLAB_REDIS_ADDRESS value: "redis" + # - name: CRAWLAB_SERVER_LANG_NODE + # value: "Y" + # - name: CRAWLAB_SERVER_LANG_JAVA + # value: "Y"