package main

import (
	"testing"
	image2 "wdd.io/agent-common/image"
	"wdd.io/agent-common/real_project/zhejianyidong_erjipingtai"
	"wdd.io/agent-deploy/z_dep"
)

func TestCmiiEnvDeploy(t *testing.T) {

	// dev
	// devflight
	// devoperation

	deployNamespace := devFlight

	//  deploy to cmii environment
	cmiiDeployCommonEnv := &z_dep.CommonEnvironmentConfig{
		WebIP:                       "lab.uavcmlc.com",
		WebPort:                     "",
		HarborIPOrCustomImagePrefix: image2.CmiiHarborPrefix,
		HarborPort:                  "",
		Namespace:                   deployNamespace,
		TagVersion:                  "5.6.0",
	}

	CmiiEnvDeploy(cmiiDeployCommonEnv, true, deployNamespace)

}

func TestCmiiEnvDeploy_ChongQingSanHua(t *testing.T) {

	// chongqing sanhua
	commonEnv := &z_dep.CommonEnvironmentConfig{
		WebIP:                       "36.133.115.164",
		WebPort:                     "58888",
		HarborIPOrCustomImagePrefix: "chongqingcis-9b4a3da9.ecis.chongqing-1.cmecloud.cn/cmii/",
		HarborPort:                  "",
		Namespace:                   "wrj",
		TagVersion:                  "5.6.0",
	}

	CmiiEnvDeploy(commonEnv, true, demo)

}

func TestCmiiEnvDeploy_LiuXiTongGan(t *testing.T) {

	// chongqing sanhua
	commonEnv := &z_dep.CommonEnvironmentConfig{
		WebIP:                       "10.250.0.200",
		WebPort:                     "8888",
		HarborIPOrCustomImagePrefix: "10.250.0.200",
		HarborPort:                  "8033",
		Namespace:                   "bjtg",
		TagVersion:                  "5.6.0",
		NFSServerIP:                 "10.250.0.200",
	}

	CmiiEnvDeploy(commonEnv, true, demo)

}

func TestCmiiEnvDeploy_ZheJiangYiDongErJiPingTai(t *testing.T) {

	// 浙江移动二级平台
	commonEnv := &z_dep.CommonEnvironmentConfig{
		WebIP:                       "111.2.224.59",
		WebPort:                     "8088",
		HarborIPOrCustomImagePrefix: "192.168.10.3",
		HarborPort:                  "8033",
		Namespace:                   "zjyd",
		TagVersion:                  "5.7.0",
		NFSServerIP:                 "192.168.10.3",
		MinioInnerIP:                "192.168.10.2",
	}

	CmiiEnvDeployOffline(commonEnv, true, zhejianyidong_erjipingtai.Cmii570ImageList)

}

func TestCmiiEnvDeploy_JiangSuNanTong(t *testing.T) {

	// 江苏南通
	commonEnv := &z_dep.CommonEnvironmentConfig{
		WebIP:                       "111.2.224.59",
		WebPort:                     "8088",
		HarborIPOrCustomImagePrefix: "192.168.10.3",
		HarborPort:                  "8033",
		Namespace:                   "zjyd",
		TagVersion:                  "5.7.0",
		NFSServerIP:                 "192.168.10.3",
		MinioInnerIP:                "192.168.10.2",
	}

	CmiiEnvDeployOffline(commonEnv, true, zhejianyidong_erjipingtai.Cmii570ImageList)

}

func TestCmiiNewAppDeploy(t *testing.T) {

	deployNamespace := devOperation

	//  deploy to cmii environment
	cmiiDeployCommonEnv := &z_dep.CommonEnvironmentConfig{
		WebIP:                       "lab.uavcmlc.com",
		WebPort:                     "",
		HarborIPOrCustomImagePrefix: image2.CmiiHarborPrefix,
		HarborPort:                  "",
		Namespace:                   deployNamespace,
		TagVersion:                  "5.6.0",
	}

	CmiiNewAppDeploy(cmiiDeployCommonEnv, deployNamespace)

}
