Hi,
I'm trying to build Kibana into an RPM. I keep getting an error from FPM, saying the 'target' directory doesn't exist. Trying to get around this, I manually create the 'target' before doing the build. Unfortunately, it seems that part of the build process involves deleting the 'target' directory as part of a cleanup step. See below for excerpts from my build log (all in docker).
Step 51/58 : RUN mkdir /opt/kibana/target
Step 58/58 : RUN node scripts/build --oss --release --rpm --skip-archives --debug
---> Running in dbba4716ad7b
info [ global ] Verifying environment meets requirements
│ succ Node.js version verified
│ succ ✓ 0 sec
info [ global ] Cleaning artifacts from previous builds
│ debg Deleting patterns: [ '/opt/kibana/build', '/opt/kibana/target' ]
│ debg Deleted 1 files/directories
│ succ ✓ 0 sec
info $ fpm --force -t rpm --package /opt/kibana/target/NAME-6.4.2-ARCH.TYPE -s dir
--name kibana-oss --description Explore and visualize your Elasticsearch data --version 6.4.2
--iteration 18021 --url [https://www.elastic.co](https://www.elastic.co/) --vendor Elasticsearch, Inc.
--maintainer Kibana Team <info@elastic.co> --license ASL 2.0 --conflicts kibana --after-install
/opt/kibana/src/dev/build/tasks/os_packages/package_scripts/post_install.sh --before-install
/opt/kibana/src/dev/build/tasks/os_packages/package_scripts/pre_install.sh --before-remove
/opt/kibana/src/dev/build/tasks/os_packages/package_scripts/pre_remove.sh --after-remove
/opt/kibana/src/dev/build/tasks/os_packages/package_scripts/post_remove.sh --config-files
/etc/kibana/kibana.yml --template-value user=kibana --template-value group=kibana --template-value
optimizeDir=/usr/share/kibana/optimize --template-value configDir=/etc/kibana --template-value
pluginsDir=/usr/share/kibana/plugins --template-value dataDir=/var/lib/kibana --exclude
usr/share/kibana/config --exclude usr/share/kibana/data --architecture x86_64
--rpm-os linux /opt/kibana/build/oss/kibana-6.4.2-linux-x86_64/=/usr/share/kibana/
/opt/kibana/build/oss/kibana-6.4.2-linux-x86_64/config/=/etc/kibana/ /opt/kibana/build/oss/kibana-6.4.2-linux-x86_64/data/=/var/lib/kibana/
/opt/kibana/src/dev/build/tasks/os_packages/service_templates/sysv/etc/=/etc/
/opt/kibana/src/dev/build/tasks/os_packages/service_templates/systemd/etc/=/etc/ │ info
{:timestamp=>"2018-10-14T05:24:34.577506+0000", :message=>"Parent directory does not exist:
/opt/kibana/target - cannot write to /opt/kibana/target/kibana-oss-6.4.2-x86_64.rpm", :level=>:fatal} │ERROR failure │ERROR Error:
{:timestamp=>"2018-10-14T05:24:34.577506+0000", :message=>"Parent directory does not exist: /opt/kibana/target - cannot write to /opt/kibana/target/kibana-oss-6.4.2-x86_64.rpm",
:level=>:fatal} │ │
at makeError (/opt/kibana/node_modules/execa/index.js:172:9) │
at Promise.all.then.arr (/opt/kibana/node_modules/execa/index.js:277:16) │ at <anonymous>
Any suggestions for what I might be doing wrong? Should I be running the build from a different location?
Many thanks,
Nick