fix: Docker打包脚本
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Check if Docker is installed
|
# Check if Docker is installed
|
||||||
if command -v docker &> /dev/null then
|
if command -v docker &> /dev/null; then
|
||||||
echo $(docker --version)
|
echo $(docker --version)
|
||||||
else
|
else
|
||||||
echo "Docker is not installed"
|
echo "Docker is not installed"
|
||||||
@@ -149,7 +149,7 @@ echo
|
|||||||
echo "building omc..."
|
echo "building omc..."
|
||||||
mkdir -p ${BuildDir}/${ReleaseFileName}
|
mkdir -p ${BuildDir}/${ReleaseFileName}
|
||||||
cp -rf ${BuildPackagelDir}/docker/Dockerfile.${SYSTEM}.${PLATFORM_ARCH} ${BuildDir}/Dockerfile
|
cp -rf ${BuildPackagelDir}/docker/Dockerfile.${SYSTEM}.${PLATFORM_ARCH} ${BuildDir}/Dockerfile
|
||||||
cp -rf ${BuildPackagelDir}/docker/script/* ${BuildDir}/${ReleaseFileName}
|
cp -rf ${BuildPackagelDir}/docker/release/* ${BuildDir}/${ReleaseFileName}
|
||||||
cp -rf ${BuildLinuxDir} ${BuildDir}
|
cp -rf ${BuildLinuxDir} ${BuildDir}
|
||||||
app
|
app
|
||||||
docker_build
|
docker_build
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ BuildWeb=""
|
|||||||
ApiBranch=main
|
ApiBranch=main
|
||||||
# Package Catalog
|
# Package Catalog
|
||||||
BuildDir=/root/omc.git/build.ems
|
BuildDir=/root/omc.git/build.ems
|
||||||
|
BuildBranch=main
|
||||||
# Default Version Value
|
# Default Version Value
|
||||||
VERSION="2.2503.2"
|
VERSION="2.2503.2"
|
||||||
|
|
||||||
@@ -47,6 +48,11 @@ fi
|
|||||||
|
|
||||||
# =================== deb/rpm
|
# =================== deb/rpm
|
||||||
echo
|
echo
|
||||||
|
cd $BuildDir
|
||||||
|
git checkout .
|
||||||
|
git pull
|
||||||
|
git checkout $BuildBranch
|
||||||
|
git pull
|
||||||
bash $BuildDir/pkg.sh --api -apiBranch $ApiBranch -v $VERSION
|
bash $BuildDir/pkg.sh --api -apiBranch $ApiBranch -v $VERSION
|
||||||
|
|
||||||
# bash pkg-front.sh --web -v 2.2503.2
|
# bash pkg-front.sh --web -v 2.2503.2
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ ApiDir=/root/omc.git/be.ems
|
|||||||
ApiBranch=main
|
ApiBranch=main
|
||||||
# Package Catalog
|
# Package Catalog
|
||||||
BuildDir=/root/omc.git/build.ems
|
BuildDir=/root/omc.git/build.ems
|
||||||
|
BuildBranch=main
|
||||||
BuildTmpDir=/root/omc.git/build.ems/tmp
|
BuildTmpDir=/root/omc.git/build.ems/tmp
|
||||||
# Default Version Value
|
# Default Version Value
|
||||||
VERSION="2.2503.2"
|
VERSION="2.2503.2"
|
||||||
@@ -50,7 +51,6 @@ cp -rf $WebDir/public $BuildTmpDir/omc_web
|
|||||||
cp -rf $WebDir/index.html $BuildTmpDir/omc_web
|
cp -rf $WebDir/index.html $BuildTmpDir/omc_web
|
||||||
cp -rf $WebDir/.env.production $BuildTmpDir/omc_web
|
cp -rf $WebDir/.env.production $BuildTmpDir/omc_web
|
||||||
cp -rf $WebDir/.env.development $BuildTmpDir/omc_web
|
cp -rf $WebDir/.env.development $BuildTmpDir/omc_web
|
||||||
cp -rf $WebDir/package-lock.json $BuildTmpDir/omc_web
|
|
||||||
cp -rf $WebDir/package.json $BuildTmpDir/omc_web
|
cp -rf $WebDir/package.json $BuildTmpDir/omc_web
|
||||||
cp -rf $WebDir/tsconfig.json $BuildTmpDir/omc_web
|
cp -rf $WebDir/tsconfig.json $BuildTmpDir/omc_web
|
||||||
cp -rf $WebDir/tsconfig.node.json $BuildTmpDir/omc_web
|
cp -rf $WebDir/tsconfig.node.json $BuildTmpDir/omc_web
|
||||||
@@ -90,11 +90,15 @@ echo "===> vendor data copy to $output"
|
|||||||
|
|
||||||
# =================== build docker image
|
# =================== build docker image
|
||||||
echo
|
echo
|
||||||
|
cd $BuildDir
|
||||||
|
git checkout .
|
||||||
|
git pull
|
||||||
|
git checkout $BuildBranch
|
||||||
|
git pull
|
||||||
bash $BuildDir/build-docker.sh --version $VERSION --platform linux/amd64 --system ubuntu22.04
|
bash $BuildDir/build-docker.sh --version $VERSION --platform linux/amd64 --system ubuntu22.04
|
||||||
|
|
||||||
# Compile the front-end and back-end and then package the version
|
# Compile the front-end and back-end and then package the version
|
||||||
# bash pkg.sh --web -webBranch main --api -apiBranch main -v 2.2503.2
|
# bash pkg-docker.sh -webBranch main -apiBranch main -v 2.2503.2
|
||||||
# bash pkg.sh --web --api -v 2.2503.2
|
# bash pkg-docker.sh -v 2.2503.2
|
||||||
# bash pkg.sh --api -apiBranch main -v 2.2503.2
|
|
||||||
# Packaged version of just the last compiled file/build directory
|
bash /root/omc.git/build.ems/build-docker.sh --version 2.2505.2 --platform linux/amd64 --system ubuntu22.04
|
||||||
# bash pkg.sh -v 2.2503.2
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ ApiBranch=lichang
|
|||||||
BuildApi=""
|
BuildApi=""
|
||||||
# Package Catalog
|
# Package Catalog
|
||||||
BuildDir=/root/omc.git/build.ems
|
BuildDir=/root/omc.git/build.ems
|
||||||
|
BuildBranch=main
|
||||||
# Default Version Value
|
# Default Version Value
|
||||||
VERSION="2.2503.2"
|
VERSION="2.2503.2"
|
||||||
|
|
||||||
@@ -106,6 +107,11 @@ fi
|
|||||||
|
|
||||||
# =================== deb/rpm
|
# =================== deb/rpm
|
||||||
echo
|
echo
|
||||||
|
cd $BuildDir
|
||||||
|
git checkout .
|
||||||
|
git pull
|
||||||
|
git checkout $BuildBranch
|
||||||
|
git pull
|
||||||
bash $BuildDir/build.sh -v $VERSION
|
bash $BuildDir/build.sh -v $VERSION
|
||||||
|
|
||||||
# Compile the front-end and back-end and then package the version
|
# Compile the front-end and back-end and then package the version
|
||||||
|
|||||||
6
pkg.sh
6
pkg.sh
@@ -10,6 +10,7 @@ ApiBranch=main
|
|||||||
BuildApi=""
|
BuildApi=""
|
||||||
# Package Catalog
|
# Package Catalog
|
||||||
BuildDir=/root/omc.git/build.ems
|
BuildDir=/root/omc.git/build.ems
|
||||||
|
BuildBranch=main
|
||||||
# Default Version Value
|
# Default Version Value
|
||||||
VERSION="2.2503.2"
|
VERSION="2.2503.2"
|
||||||
|
|
||||||
@@ -93,6 +94,11 @@ fi
|
|||||||
|
|
||||||
# =================== deb/rpm
|
# =================== deb/rpm
|
||||||
echo
|
echo
|
||||||
|
cd $BuildDir
|
||||||
|
git checkout .
|
||||||
|
git pull
|
||||||
|
git checkout $BuildBranch
|
||||||
|
git pull
|
||||||
bash $BuildDir/build.sh -v $VERSION
|
bash $BuildDir/build.sh -v $VERSION
|
||||||
|
|
||||||
# Compile the front-end and back-end and then package the version
|
# Compile the front-end and back-end and then package the version
|
||||||
|
|||||||
Reference in New Issue
Block a user