Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Generate a default .gitlab-ci.yml file for new projects #181

Closed
stanislas-m opened this issue Jan 26, 2017 · 9 comments
Closed

Generate a default .gitlab-ci.yml file for new projects #181

stanislas-m opened this issue Jan 26, 2017 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@stanislas-m
Copy link
Member

See #36. This is the same case, but with a different provider.

@bscott bscott added the enhancement New feature or request label Jan 27, 2017
@bscott bscott self-assigned this Jan 27, 2017
@bscott
Copy link

bscott commented Jan 31, 2017

@apaganobeleno I was going to work on this but wondering if I should wait for #184 to be merged??

@paganotoni
Copy link
Member

@bscott i think waiting for #184 makes sense, i'll keep you posted on its progress.

@paganotoni
Copy link
Member

@bscott #184 was merged, mentioning this in case you want to work on this one.

@stanislas-m
Copy link
Member Author

@bscott, do you want to work on this? I can take care of it otherwise.

@bscott
Copy link

bscott commented Mar 14, 2017

@stanislas-m By all means please, I'll assign to you

@stanislas-m
Copy link
Member Author

Here is my current work on this feature:
https://gist.github.com/stanislas-m/9e202a8881aab9932e41b9e4d8742931

This config will setup a runner to execute the tests for the created project, so I think the feature is at the same level as the Travis one.

I have a remaining problem to solve: the way Gitlab CI manages services (the links to the databases, in this case) force the db host in the databases config file to be changed (I can't use 127.0.0.1: for postgresql it will create a « postgres » host, and so on for mysql).

Do you have any idea on this?

@markbates
Copy link
Member

My first thought is you want to build this against the v0.8.0 branch, since the generators have been completely refactored.

As to the database settings, not sure I fully understand the problem, but might I recommend looking at the env and envOr helper methods that let you use env variables in the database.yml file.

@stanislas-m
Copy link
Member Author

My first thought is you want to build this against the v0.8.0 branch, since the generators have been completely refactored.

No problem, I've just done the new version.

As to the database settings, not sure I fully understand the problem, but might I recommend looking at the env and envOr helper methods that let you use env variables in the database.yml file.

My problem is the way the database.yml is generated:

test:
  dialect: postgres
  database: buffalo-test_test
  user: postgres
  password: postgres
  host: 127.0.0.1

Since the PostgreSQL server is not on 127.0.0.1 in this case (it will be on a dynamic host created by Gitlab), the test will fail. So, we can either:

  • ask the user to change the host by hand
  • let Buffalo customize it by tweaking Pop
  • change Pop template to use envOr helper on test case (so we can provide env in the ci script)
  • tweak it at build time, with a bash command like sed or awk

In my opinion, the third option is the best and would not break legacy setups.

@stanislas-m
Copy link
Member Author

Closed by #305.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants