New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev/ci_setup] generalize jenkins_setup script for other CI environments #15178

Merged
merged 4 commits into from Nov 30, 2017

Conversation

Projects
None yet
4 participants
@spalger
Member

spalger commented Nov 28, 2017

Part of #15170

In order to allow Kibana to control how node.js and npm are installed/used on Jenkins we created the test/scripts/_jenkins_setup.sh script. With this script jenkins is able to just call the other test scripts and they automatically setup node and install node modules.

We would like to do a similar thing when we build releases, but since builds aren't created on a jenkins-based system the script needed to be generalized. Also, since this system is also not for testing, I moved the script out of test/scripts/.

@spalger spalger added the WIP label Nov 28, 2017

@spalger spalger referenced this pull request Nov 28, 2017

Closed

Kibana dev and build process for the new platform #15170

10 of 14 tasks complete

@spalger spalger requested review from kimjoar, jbudz and tylersmalley Nov 29, 2017

###
nodeVersion="$(cat $dir/.node-version)"
nodeUrl="https://nodejs.org/download/release/v$nodeVersion/node-v$nodeVersion-linux-x64.tar.gz"
nodeDir="${NODE_DIR:-"$dir/.node"}/$nodeVersion"

This comment has been minimized.

@tylersmalley

tylersmalley Nov 29, 2017

Member

Can we use a more general cache directory? Possibly as an argument to this script.
This way we could also use it for yarn.

This comment has been minimized.

@tylersmalley

tylersmalley Nov 29, 2017

Member

If one is not provided, should we default to using /tmp?

This comment has been minimized.

@spalger

spalger Nov 29, 2017

Member

/tmp/kibana/node/v$nodeVersion?

This comment has been minimized.

@spalger

spalger Nov 29, 2017

Member

I kind of like how this isn't global, it doesn't make any changes to the system that might conflict with other installs, but maybe that's irrelevant

echo " -- reusing node.js install"
else
if [ -d "$nodeDir" ]; then
echo " -- clearing invalid node.js install"

This comment has been minimized.

@tylersmalley

tylersmalley Nov 29, 2017

Member

clearing previous node.js install

This comment has been minimized.

@spalger

spalger Nov 29, 2017

Member

The goal was to make this slightly more resilient to partial archive extractions by checking that node booted and reports the right version number, but previous isn't necessarily wrong. It will reuse previous installs though if they report compatibility

rm -rf "$nodeDir"
fi
echo " -- downloading node.js from $nodeUrl"

This comment has been minimized.

@jbudz

jbudz Nov 29, 2017

Contributor

thoughts on doing a checksum here? if it's making it all the way to releases IMO it's worth it, even if it's manual updates

This comment has been minimized.

@spalger

spalger Nov 29, 2017

Member

The node used here won't be used for releases, the build process downloads it's own version of node for each platform and verifies the checksums there. We're downloading over https, so I don't think it's worth the complexity. Maybe it's not that bad, but that's what I'm thinking

@jbudz

jbudz approved these changes Nov 29, 2017

For what we currently do LGTM. If this needs to do builds on fresh hosts we'll need to add more -
https://github.com/elastic/kibana/pull/13347/files can be used as a mostly up to dependency reference

@spalger spalger merged commit 9991263 into elastic:master Nov 30, 2017

2 checks passed

CLA Commit author has signed the CLA
Details
kibana-ci Build finished.
Details

spalger added a commit to spalger/kibana that referenced this pull request Nov 30, 2017

[dev/ci_setup] generalize jenkins_setup script for other CI environme…
…nts (elastic#15178)

* [dev/ci_setup] generalize jenkins_setup script for other CI environments

* [dev/ci_setup] accept more general `CACHE_DIR` env arg

* [dev/ci_setup] node.js install might not be invalid

spalger added a commit to spalger/kibana that referenced this pull request Nov 30, 2017

[dev/ci_setup] generalize jenkins_setup script for other CI environme…
…nts (elastic#15178)

* [dev/ci_setup] generalize jenkins_setup script for other CI environments

* [dev/ci_setup] accept more general `CACHE_DIR` env arg

* [dev/ci_setup] node.js install might not be invalid

spalger added a commit to spalger/kibana that referenced this pull request Nov 30, 2017

[dev/ci_setup] generalize jenkins_setup script for other CI environme…
…nts (elastic#15178)

* [dev/ci_setup] generalize jenkins_setup script for other CI environments

* [dev/ci_setup] accept more general `CACHE_DIR` env arg

* [dev/ci_setup] node.js install might not be invalid

spalger added a commit that referenced this pull request Nov 30, 2017

[6.x] [dev/ci_setup] generalize jenkins_setup script for other CI env…
…ironments (#15178) (#15303)

* [dev/ci_setup] generalize jenkins_setup script for other CI environments

* [dev/ci_setup] accept more general `CACHE_DIR` env arg

* [dev/ci_setup] node.js install might not be invalid

spalger added a commit that referenced this pull request Nov 30, 2017

[6.0] [dev/ci_setup] generalize jenkins_setup script for other CI env…
…ironments (#15178) (#15304)

* [dev/ci_setup] generalize jenkins_setup script for other CI environments

* [dev/ci_setup] accept more general `CACHE_DIR` env arg

* [dev/ci_setup] node.js install might not be invalid

spalger added a commit that referenced this pull request Nov 30, 2017

[5.6] [dev/ci_setup] generalize jenkins_setup script for other CI env…
…ironments (#15178) (#15305)

* [dev/ci_setup] generalize jenkins_setup script for other CI environments

* [dev/ci_setup] accept more general `CACHE_DIR` env arg

* [dev/ci_setup] node.js install might not be invalid
@spalger

This comment has been minimized.

Member

spalger commented Nov 30, 2017

5.6: 9641cc3
6.0: 28d8637
6.1: 1f99c04
6.x/6.2: dcf3738

@spalger spalger deleted the spalger:implement/dev-ci-setup branch Nov 30, 2017

@spalger spalger added the v6.2.0 label Nov 30, 2017

spalger added a commit to spalger/kibana that referenced this pull request Nov 30, 2017

[dev/ci_setup] generalize jenkins_setup script for other CI environme…
…nts (elastic#15178)

* [dev/ci_setup] generalize jenkins_setup script for other CI environments

* [dev/ci_setup] accept more general `CACHE_DIR` env arg

* [dev/ci_setup] node.js install might not be invalid

spalger added a commit that referenced this pull request Nov 30, 2017

[6.1] [dev/ci_setup] generalize jenkins_setup script for other CI env…
…ironments (#15178) (#15327)

* [dev/ci_setup] generalize jenkins_setup script for other CI environments

* [dev/ci_setup] accept more general `CACHE_DIR` env arg

* [dev/ci_setup] node.js install might not be invalid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment