adf-cli Provide a way to pass buildArgs to the docker build (#5507)

* Provide a way to pass buildArgs to the docker build

* Create folder in case does not exist
This commit is contained in:
Maurizio Vitale
2020-02-24 17:10:40 +00:00
committed by GitHub
parent fcda1e3c7e
commit 81efb07283
2 changed files with 12 additions and 3 deletions

View File

@@ -28,6 +28,7 @@ export interface PublishArgs {
loginPassword?: string;
loginRepo?: string;
dockerRepo?: string;
buildArgs?: string;
dockerTags?: string;
pathProject: string;
}
@@ -40,7 +41,7 @@ function loginPerform(args: PublishArgs) {
function buildImagePerform(args: PublishArgs, tag: string) {
logger.info(`Perform docker build...${args.dockerRepo}:${tag}`);
const response = exec('docker', ['build', `-t=${args.dockerRepo}:${tag}`, args.pathProject], {});
const response = exec('docker', ['build', `-t=${args.dockerRepo}:${tag}`, `--build-arg=${args.buildArgs}`, args.pathProject], {});
logger.info(response);
}

View File

@@ -11,9 +11,17 @@ echo "====== Build ======"
npm run dist
cd $DIR/../../
rm -rf ./lib/dist/cli/ && \
cp -R ./lib/cli/dist lib/dist/cli/
if [ -e "./lib/dist/cli" ];
then
rm -rf "./lib/dist/cli" ;
else if [ ! -d "./lib/dist" ];
then
mkdir ./lib/dist
fi
fi
cp -R ./lib/cli/dist lib/dist/cli/
exit 0
echo "====== Move to node_modules ======"
rm -rf ./node_modules/@alfresco/adf-cli/ && \
mkdir -p ./node_modules/@alfresco/adf-cli/ && \