Skip to content
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

Add support other node images #49

Open
reklatsmasters opened this issue Feb 19, 2017 · 8 comments
Open

Add support other node images #49

reklatsmasters opened this issue Feb 19, 2017 · 8 comments

Comments

@reklatsmasters
Copy link

I like mhart/alpine-node. It's extremely small image ~50mb. Would be better to have option to use this image.

@sanex3339
Copy link

sanex3339 commented Feb 19, 2017

+++, but here probably will be problems in rare situations when travis-ci tests are passed, but trevor tests doesn't, because of different environments.

@vadimdemedes
Copy link
Owner

Will this image work as expected when there are native dependencies (need compilation)?

Would be better to have option to use this image.

Aside from smaller size, how is it better than the official image?

@SamVerschueren
Copy link
Collaborator

SamVerschueren commented Feb 21, 2017

I'm wondering for a while now, can we just use the same image as Travis does? Is it publicly available for us to use and just use whatever they use?

@vadimdemedes
Copy link
Owner

Yeah, I was thinking about it too. Would solve pretty much all user requests and issues.

@SamVerschueren
Copy link
Collaborator

@vadimdemedes It looks like the images can be found here. This should be some docs, although not sure if we can do anything with it. Have to take a closer look.

@tunnckoCore
Copy link

tunnckoCore commented Aug 8, 2017

just drop the suffix -onbuild, that's enough. All of the images will be supported - it won't be "breaking" change.

btw, was just curious about docker and implemented it for the sake of training, of course dont have pretty UI

const readFile = util.promisify(fs.readFile)

function getVersions () {
  return readFile('./.travis.yml', 'utf8').then(
    (str) => yaml.safeLoad(str).node_js
  )
}

const opts = { stdio: 'inherit' }

const pass = (version) => () => console.log('Build', version, 'passed')
const fail = (version) => (er) =>
  console.log('Build', version, 'failed', er.message)

const npmTest = (version) =>
  execa('npm', ['test'], opts).then(pass(version), fail(version))

const npmInstall = (version) =>
  execa('npm', ['install'], opts).then(() => npmTest(version))

const nodeInstall = (v) =>
  execa('docker', ['pull', `node:${v}`], opts).then(() => npmInstall(v))

getVersions().then((versions) => pMap(versions, nodeInstall)).catch((er) => {
  console.log('commit failed', er.stderr)
})

that's the whole CI core in reality :D from there on, only features can be added (like why not implement the hooks) and UI

@tunnckoCore
Copy link

tunnckoCore commented Aug 8, 2017

btw, when i tried trevor few times i thought that it's damn slow (so slow that my archlinux is lagging a bit) because the -onbuild, but it seems that's not the reason, because with above implementation it's fast as other images.

The most slow step using Trevor is "building environment", don't know why. Takes 5+ minutes.

@vadimdemedes
Copy link
Owner

I think npm install takes the majority of that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants