mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-22 17:10:26 +03:00
Added scripts to pass version when building docker image
This commit is contained in:
parent
8e1c6908c6
commit
4a6dd66ecd
3 changed files with 15 additions and 2 deletions
|
@ -1,6 +1,8 @@
|
|||
FROM node:12.14.1-alpine as node
|
||||
COPY . /shlink-web-client
|
||||
RUN cd /shlink-web-client && npm install && npm run build
|
||||
ARG VERSION="latest"
|
||||
ENV VERSION ${VERSION}
|
||||
RUN cd /shlink-web-client && npm install && npm run build -- ${VERSION} --no-dist
|
||||
|
||||
FROM nginx:1.17.7-alpine
|
||||
LABEL maintainer="Alejandro Celaya <alejandro@alejandrocelaya.com>"
|
||||
|
|
10
hooks/build
Executable file
10
hooks/build
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
if [[ ${SOURCE_BRANCH} == 'master' ]]; then
|
||||
SHLINK_WEB_CLIENT_RELEASE='latest'
|
||||
else
|
||||
SHLINK_WEB_CLIENT_RELEASE=${SOURCE_BRANCH#?}
|
||||
fi
|
||||
|
||||
docker build --build-arg VERSION=${SHLINK_WEB_CLIENT_RELEASE} -t ${IMAGE_NAME} .
|
|
@ -44,6 +44,7 @@ if (!checkRequiredFiles([ paths.appHtml, paths.appIndexJs ])) {
|
|||
const argvSliceStart = 2;
|
||||
const argv = process.argv.slice(argvSliceStart);
|
||||
const writeStatsJson = argv.indexOf('--stats') !== -1;
|
||||
const withoutDist = argv.indexOf('--no-dist') !== -1;
|
||||
const { version, hasVersion } = getVersionFromArgs(argv);
|
||||
|
||||
// Generate configuration
|
||||
|
@ -102,7 +103,7 @@ checkBrowsers(paths.appPath, isInteractive)
|
|||
process.exit(1);
|
||||
}
|
||||
)
|
||||
.then(() => hasVersion && zipDist(version))
|
||||
.then(() => hasVersion && !withoutDist && zipDist(version))
|
||||
.catch((err) => {
|
||||
if (err && err.message) {
|
||||
console.log(err.message);
|
||||
|
|
Loading…
Reference in a new issue