version_number
This commit is contained in:
parent
49430d634c
commit
ddf88821e7
|
@ -14,6 +14,9 @@ RUN rm -fr /root/.cache/*
|
|||
COPY ./src ./src
|
||||
COPY ./public ./public
|
||||
|
||||
ARG version_info
|
||||
ENV REACT_APP_VERSION_INFO=${version_info}
|
||||
|
||||
RUN npm run build
|
||||
|
||||
COPY . .
|
||||
|
|
|
@ -18,7 +18,10 @@ pipeline {
|
|||
stage('Building image') {
|
||||
steps{
|
||||
script {
|
||||
dockerImage = docker.build imagename
|
||||
commit=$(git rev-parse --short HEAD)
|
||||
date=$(date '+%Y%m%d%H%M%S')
|
||||
version_info="$date-$commit"
|
||||
dockerImage = docker.build(imagename, "--build-arg version_info=$version_info")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,11 @@ const ChatPage = () => {
|
|||
const [stat, setStat] = useState("start");
|
||||
const [err, setErr] = useState("");
|
||||
|
||||
const version = process.env.REACT_APP_VERSION_INFO;
|
||||
if (!version) {
|
||||
console.info("No version information present at build time.");
|
||||
}else{console.info('version: ${version}');}
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (stat === "waiting"){
|
||||
|
|
Loading…
Reference in New Issue