symfony-4-docker-env icon indicating copy to clipboard operation
symfony-4-docker-env copied to clipboard

More explanation about Travis and GCE configuration.

Open woprrr opened this issue 6 years ago • 10 comments

Hi tulik,

I continue to use this part of helm/ and .travis files in my own project for API rest with DDD layers. But I really not understand how I do configure travis file and what variables we need to add ?

@see https://travis-ci.org/woprrr/SF4-Rest-API/jobs/396913196 an example of openssl error.

to generate my own client_secrets.json I have dowloaded from GCE project and encoded with travis encrypt-file client_secrets.json --add command. The .travis file was updated with correct values (I think :D) but IV error ...

Can you add some docs or explain me how that works ?

I purpose to add anything like 👍 `

  1. Install and login to the Travis CLI: $ gem install travis $ travis login
  2. Move your json private key to client_secrets.json
  3. Run: $ travis encrypt-file client_secrets.json --add
  4. Commit changes: $ git add client_secrets.json.enc $ git commit client_secrets.json.enc .travis.yml `

But this seems not suffisent ... Thank a lot for your work !

woprrr avatar Jun 26 '18 15:06 woprrr

@woprrr Have you manage to solve your issue already? Currently, I have little time to create a step by step instruction, but it's definitely in my todos.

If you already found a solution could you please contribute it? Both main and helm README files need an update.

tulik avatar Jul 18 '18 21:07 tulik

@tulik Unfortunately, I tried many things without having a satisfactory result and that's why I came here to find more resources and explanation on how to do it?

I have for the moment let down and I deploy by hand but it is definitely in my todos to try to propose a doc on this subject too. If it is possible I want you to provide me with a resource to see how to proceed and I formalize it here for you with great pleasure !!

woprrr avatar Jul 19 '18 08:07 woprrr

Do you have encrypted_xxxxxxxxxxxx_iv and encrypted_xxxxxxxxxxxx_key set? You need to set them and GCLOUD_PROJECT in

Travis > Settings > Environment Variables

tulik avatar Jul 19 '18 09:07 tulik

No, I do follow this to generate it? https://github.com/alrra/travis-scripts/blob/master/docs/github-deploy-keys.md#26-set-up-ssh-connection-for-travis-ci

the GCLOUD_PROJECT that the name of GCE side right?

woprrr avatar Jul 19 '18 15:07 woprrr

Go to the Google Cloud Console Dashboard:

  1. Enable Google App Engine Admin API,
  2. Go to Credentials, click Add Credential and Service account key, click JSON.
  3. Save your JSON file into your GitHub project directory as client_secrets.json

Install Travis and encrypt JSON file:

  1. gem install travis
  2. travis login
  3. travis encrypt-file client_secrets.json --add

Then go to Travis website, select your project and:

  1. Click More options and look for Environment Variables,
  2. Add GCLOUD_PROJECT variable - it is your GCE project ID,
  3. Grab your variables names like - encrypted_xxxxxxxxxxx_key and encrypted_xxxxxxxxxxx_iv,
  4. In .travis.yml replace in $encrypted_6797df738197_key and $encrypted_6797df738197_iv with your variables names.

Remove or move your client_secrets.json (to be sure won't add to the git repository)

Hope it will help.

tulik avatar Jul 19 '18 22:07 tulik

@tulik Oh wonderfull !!!! That works now !

will purpose the PR to add more doc in readme of how configure travis and GCE :) Thanks !! I'm a little curious about same thing on AWS now :D ?

In my test Fork for my projects (https://travis-ci.org/woprrr/symfony-4-skeleton-docker/jobs/406286386#L3165) the Travis failed in varnish step have you an idea of problems by the way :) ?

Thank you a lot !!!

woprrr avatar Jul 20 '18 15:07 woprrr

Following command is failing: The commnd "linux-amd64/helm del --purge $GCLOUD_PROJECT" exited with 1.

It errors because build script is missing check if release exists To make it work you can to create release manually or remove this line on a very first build.

It needs improvement. Sorry about that.

tulik avatar Jul 20 '18 16:07 tulik

Oh ! I add this in my PR too.

Now it's equal as my local tests ...

https://travis-ci.org/woprrr/symfony-4-skeleton-docker/jobs/406336336#L3165

what's get pods errors during helm install

woprrr avatar Jul 20 '18 17:07 woprrr

@woprrr It's not super straightforward but you can see it works with your changes :)

tulik avatar Jul 28 '18 18:07 tulik

Ping @woprrr

tulik avatar Aug 17 '18 19:08 tulik