bugfix:TSG-12433:修改helm chart的version同步os version
This commit is contained in:
17
Makefile
17
Makefile
@@ -65,6 +65,21 @@ else
|
|||||||
OS_RELEASE_VER = $(OS_BUILD_TAG)-$(OS_BUILD_HASH)
|
OS_RELEASE_VER = $(OS_BUILD_TAG)-$(OS_BUILD_HASH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(DALIY_BUILD_VERSION),1)
|
||||||
|
RESULT_BRANCH_MATCH = $(shell echo $(OS_BUILD_BRANCH) | sed -n "/\(dev\|rel\)-[0-9][0-9].[0-9][0-9]/p")
|
||||||
|
ifeq ($(OS_BUILD_BRANCH),$(RESULT_BRANCH_MATCH))
|
||||||
|
BRANCH_VER = $(shell echo $(OS_BUILD_BRANCH) | sed 's/\(dev\|rel\)-//g')
|
||||||
|
BRANCH_PREFIX = $(shell echo $(OS_BUILD_BRANCH) | sed 's/-[0-9][0-9].[0-1][0-9]//g')
|
||||||
|
HELM_CHART_VER = $(BRANCH_VER)-$(BRANCH_PREFIX)-$(OS_BUILD_TIME)+$(OS_BUILD_HASH)
|
||||||
|
else
|
||||||
|
BRANCH_NAME_VER = $(shell echo $(OS_BUILD_BRANCH) | sed 's/[^A-Za-z0-9-]\+/-/g')
|
||||||
|
HELM_CHART_VER = 0.1.0-$(BRANCH_NAME_VER)-$(OS_BUILD_TIME)+$(OS_BUILD_HASH)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
TAG_VER = $(shell echo $(OS_BUILD_TAG) | sed 's/^\(v\|V\)//g')
|
||||||
|
HELM_CHART_VER = $(TAG_VER)+$(OS_BUILD_HASH)
|
||||||
|
endif
|
||||||
|
|
||||||
ifndef PROFILE_LIST
|
ifndef PROFILE_LIST
|
||||||
PROFILE_LIST := 7400MCN0P01R01
|
PROFILE_LIST := 7400MCN0P01R01
|
||||||
endif
|
endif
|
||||||
@@ -81,6 +96,7 @@ export BUILDDIR_BASE
|
|||||||
export IMAGEDIR_BASE
|
export IMAGEDIR_BASE
|
||||||
export OS_RELEASE_VER
|
export OS_RELEASE_VER
|
||||||
export LOCK_STATE
|
export LOCK_STATE
|
||||||
|
export HELM_CHART_VER
|
||||||
|
|
||||||
.PHONY: all clean $(PROFILE_LIST)
|
.PHONY: all clean $(PROFILE_LIST)
|
||||||
|
|
||||||
@@ -91,6 +107,7 @@ all: $(PROFILE_LIST)
|
|||||||
$(Q) sed -i -e 's/PULP_REPO_USERNAME/$(PULP_REPO_USERNAME)/g' $(CONFDIR)/yum-CentOS-7.conf
|
$(Q) sed -i -e 's/PULP_REPO_USERNAME/$(PULP_REPO_USERNAME)/g' $(CONFDIR)/yum-CentOS-7.conf
|
||||||
$(Q) sed -i -e 's/PULP_REPO_PASSWORD/$(PULP_REPO_PASSWORD)/g' $(CONFDIR)/yum-CentOS-7.conf
|
$(Q) sed -i -e 's/PULP_REPO_PASSWORD/$(PULP_REPO_PASSWORD)/g' $(CONFDIR)/yum-CentOS-7.conf
|
||||||
$(Q) echo "=== Building $< $(OS_RELEASE_VER) ==="
|
$(Q) echo "=== Building $< $(OS_RELEASE_VER) ==="
|
||||||
|
$(Q) echo "=== Building chart version $< $(HELM_CHART_VER) ==="
|
||||||
$(Q) $(MAKE) -f make/Makefile.$< all
|
$(Q) $(MAKE) -f make/Makefile.$< all
|
||||||
|
|
||||||
clean: $(PROFILE_LIST)
|
clean: $(PROFILE_LIST)
|
||||||
|
|||||||
@@ -26,3 +26,9 @@
|
|||||||
systemd:
|
systemd:
|
||||||
name: tsg-clixon-restconf
|
name: tsg-clixon-restconf
|
||||||
enabled: yes
|
enabled: yes
|
||||||
|
|
||||||
|
- name: "Template the /opt/tsg/clixon/etc/mgnt-srv.conf"
|
||||||
|
template:
|
||||||
|
src: "{{ role_path }}/templates/mgnt-srv.conf.j2"
|
||||||
|
dest: /opt/tsg/clixon/etc/mgnt-srv.conf
|
||||||
|
tags: template
|
||||||
|
|||||||
11
ansible/roles/clixon/templates/mgnt-srv.conf.j2
Normal file
11
ansible/roles/clixon/templates/mgnt-srv.conf.j2
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[rpc]
|
||||||
|
addr=127.0.0.1
|
||||||
|
port=56789
|
||||||
|
|
||||||
|
[cpu_quotas]
|
||||||
|
cpu_range=9
|
||||||
|
|
||||||
|
[global]
|
||||||
|
chart_name=traffic-engine-{{os_release_ver}}.tgz
|
||||||
|
|
||||||
|
#chart verison example: traffic-engine-22.10.1+ba84cfe.tgz
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
remote_src: yes
|
remote_src: yes
|
||||||
|
|
||||||
- name: "create charts packages"
|
- name: "create charts packages"
|
||||||
shell: helm package --app-version {{os_release_ver}} -d /var/lib/rancher/k3s/server/static/charts/ /tmp/traffic-engine/helm
|
shell: helm package --app-version {{os_release_ver}} --version {{helm_chart_ver}} -d /var/lib/rancher/k3s/server/static/charts/ /tmp/traffic-engine/helm
|
||||||
|
|
||||||
- name: "copy kubeconfig.sh to destination"
|
- name: "copy kubeconfig.sh to destination"
|
||||||
copy:
|
copy:
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ sysroot-ansible: sysroot-verfile sysroot-base
|
|||||||
cp $(CONFDIR)/resolv.conf $(TARGET_SYSROOT_DIR)/etc/ -r
|
cp $(CONFDIR)/resolv.conf $(TARGET_SYSROOT_DIR)/etc/ -r
|
||||||
cp $(TARGET_SYSROOT_DIR)/etc/hosts $(TARGET_SYSROOT_DIR)/tmp/ -r
|
cp $(TARGET_SYSROOT_DIR)/etc/hosts $(TARGET_SYSROOT_DIR)/tmp/ -r
|
||||||
cp /etc/hosts $(TARGET_SYSROOT_DIR)/etc/ -r
|
cp /etc/hosts $(TARGET_SYSROOT_DIR)/etc/ -r
|
||||||
$(TOOLSDIR)/ansible-HAL $(PROFILE_ID) $(PROJECTDIR) $(TARGET_SYSROOT_DIR) /tmp/yum-RockyLinux-8.conf $(OS_RELEASE_VER)
|
$(TOOLSDIR)/ansible-HAL $(PROFILE_ID) $(PROJECTDIR) $(TARGET_SYSROOT_DIR) /tmp/yum-RockyLinux-8.conf $(OS_RELEASE_VER) $(HELM_CHART_VER)
|
||||||
cp $(TARGET_SYSROOT_DIR)/tmp/hosts $(TARGET_SYSROOT_DIR)/etc/ -r
|
cp $(TARGET_SYSROOT_DIR)/tmp/hosts $(TARGET_SYSROOT_DIR)/etc/ -r
|
||||||
|
|
||||||
container-sysroot-ansible: container-sysroot-base
|
container-sysroot-ansible: container-sysroot-base
|
||||||
|
|||||||
@@ -5,11 +5,19 @@ PROJECTDIR=$2
|
|||||||
TARGET_SYSROOT_DIR=$3
|
TARGET_SYSROOT_DIR=$3
|
||||||
YUM_CONF_PATH=$4
|
YUM_CONF_PATH=$4
|
||||||
OS_RELEASE_VER=$5
|
OS_RELEASE_VER=$5
|
||||||
|
HELM_CHART_VER=$6
|
||||||
|
|
||||||
echo "----------------------------- Ansible Stage 1 ----------------------------"
|
echo "----------------------------- Ansible Stage 1 ----------------------------"
|
||||||
echo "$PROFILE_ID"
|
echo "$PROFILE_ID"
|
||||||
|
|
||||||
|
|
||||||
|
if [ ! $HELM_CHART_VER ]; then
|
||||||
|
echo "HELM_CHART_VER is NULL,set HELM_CHART_VER to 0.1.0, profile_id:$PROFILE_ID,os_release_ver:$OS_RELEASE_VER"
|
||||||
|
HELM_CHART_VER="0.1.0"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "[$PROFILE_ID]" > $PROJECTDIR/ansible/install_config/hosts
|
echo "[$PROFILE_ID]" > $PROJECTDIR/ansible/install_config/hosts
|
||||||
echo "$TARGET_SYSROOT_DIR ansible_connection=chroot" >> $PROJECTDIR/ansible/install_config/hosts
|
echo "$TARGET_SYSROOT_DIR ansible_connection=chroot" >> $PROJECTDIR/ansible/install_config/hosts
|
||||||
|
|
||||||
ansible-playbook -i $PROJECTDIR/ansible/install_config/hosts $PROJECTDIR/ansible/HAL_deploy.yml -e "rpm_repo_config_path=$YUM_CONF_PATH PROFILE_ID=$PROFILE_ID path_download=/tmp/rpm_download os_release_ver=$OS_RELEASE_VER"
|
ansible-playbook -i $PROJECTDIR/ansible/install_config/hosts $PROJECTDIR/ansible/HAL_deploy.yml -e "rpm_repo_config_path=$YUM_CONF_PATH PROFILE_ID=$PROFILE_ID path_download=/tmp/rpm_download os_release_ver=$OS_RELEASE_VER helm_chart_ver=$HELM_CHART_VER"
|
||||||
|
|||||||
Reference in New Issue
Block a user