These are chat archives for alariva/timegridDevelopment

17th
Nov 2016
swbittib
@swbittib
Nov 17 2016 12:11

You can create an availability sheet that get's published each Sunday with cron (you need to configure a line in cron).

which command in cron? Thanks

Ariel Vallese
@alariva
Nov 17 2016 12:32
Hi @swbittib , I've updated the installation instructions with this cron line: https://github.com/timegridio/timegrid/blob/master/INSTALLING.md#step6
You will also find info about scheduled tasks on Laravel on https://laravel.com/docs/5.3/scheduling
swbittib
@swbittib
Nov 17 2016 13:24
@alariva thanks!
Ariel Vallese
@alariva
Nov 17 2016 13:26
:sparkles: :+1:
Kashyap Sharma
@Kashyap12
Nov 17 2016 13:43
hi @alariva
Ariel Vallese
@alariva
Nov 17 2016 14:11
hi @Kashyap12 !
Kashyap Sharma
@Kashyap12
Nov 17 2016 14:20
will connect in a couple of hours, leaving for home now :)
Ariel Vallese
@alariva
Nov 17 2016 14:35
sure! :)
Kashyap Sharma
@Kashyap12
Nov 17 2016 19:09
Hi @alariva
Ariel Vallese
@alariva
Nov 17 2016 19:25
Hi Kashyap
Kashyap Sharma
@Kashyap12
Nov 17 2016 19:25
hi
can we proceed? from where we left yesterday
*shall we
Ariel Vallese
@alariva
Nov 17 2016 19:27
Yes. Im from mobile without my laptop, so Ill try to help with my best
Kashyap Sharma
@Kashyap12
Nov 17 2016 19:27

u had asked to :

@alariva
So my suggestion is
Delete timegrid and clone again
Delete dockefile and clone again

shall i delete both of the folders from my host machine
?
Ariel Vallese
@alariva
Nov 17 2016 19:28
Yes, lets start over so we get a clean idea of how everything works
Kashyap Sharma
@Kashyap12
Nov 17 2016 19:28
ok
Ariel Vallese
@alariva
Nov 17 2016 19:28
Yes, delete both and also the images of your docker
Kashyap Sharma
@Kashyap12
Nov 17 2016 19:28
ok
Ariel Vallese
@alariva
Nov 17 2016 19:29
That is sudo docker images get the images ids
And then sudo docker rmi IMAGEID --force
One by one
And there you start from scratch
Kashyap Sharma
@Kashyap12
Nov 17 2016 19:30
ok
done
Ariel Vallese
@alariva
Nov 17 2016 19:35
Cool
What do you have then?
Kashyap Sharma
@Kashyap12
Nov 17 2016 19:36
i guess i need to clone both of the repos again
Ariel Vallese
@alariva
Nov 17 2016 19:36
Yes
Kashyap Sharma
@Kashyap12
Nov 17 2016 19:36
ok
on it
Ariel Vallese
@alariva
Nov 17 2016 19:36
So to have /home/username/timegrid
And /home/user/dockerfiles (or any name you prefer)
Kashyap Sharma
@Kashyap12
Nov 17 2016 19:37
yes
doing it right away
done, forked and cloned both of them
Ariel Vallese
@alariva
Nov 17 2016 19:42
Great
Now we will build the docker image
And run the container to test that timegrid is installed
Note that still, we wont be using the cloned codebase of timegrid, just the dockerfile
Kashyap Sharma
@Kashyap12
Nov 17 2016 19:43
ok
ok
Ariel Vallese
@alariva
Nov 17 2016 19:43
cd dockerfiles
And now run the build
It will take about 10 minutes... More or less
Kashyap Sharma
@Kashyap12
Nov 17 2016 19:44
yes
started
Ariel Vallese
@alariva
Nov 17 2016 19:45
Cool
Meanwhile
Remember that it will clone and install timegrid inside the container
Later we will do some black magic to be able to edit the files and so on. Actually im working on enhancing these steps as its still a bit confusing even for me
But you will be able to have a local install and run the tests
Let me know when build is done, dont run the container just yet
Kashyap Sharma
@Kashyap12
Nov 17 2016 19:48
sure
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:02
build successful
Ariel Vallese
@alariva
Nov 17 2016 20:04
sudo docker run -p8000:8000 timegrid:latest
Note that its different than the one on readme
We are not sharing the directory of codebase just yet
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:04
ok
the cursor is blinking , it is in a waiting state

the o/p is :

Starting MySQL database server: mysqld ..
Checking for tables which need an upgrade, are corrupt or were
not closed cleanly..
Laravel development server started on http://0.0.0.0:8000/

and then the cursor in is blinking on the next line

Ariel Vallese
@alariva
Nov 17 2016 20:08
Now from your host machine
Browse localhost at port 8000
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:08
done
timegrid.io opened on browser
Ariel Vallese
@alariva
Nov 17 2016 20:14
Ok
Now this is the base install
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:14
ok
Ariel Vallese
@alariva
Nov 17 2016 20:14
Try running the tests
Check the readme
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:14
ok
readme of docker , right
Ariel Vallese
@alariva
Nov 17 2016 20:14
Yes
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:15
ok
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:20

o/p :

PHPUnit 5.6.3 by Sebastian Bergmann and contributors.

............................................................... 63 / 189 ( 33%)
............................................................... 126 / 189 ( 66%)
............................................................... 189 / 189 (100%)

Time: 2.8 minutes, Memory: 165.00MB

OK (189 tests, 800 assertions)

Ariel Vallese
@alariva
Nov 17 2016 20:21
Cool
Now thats how to run tests
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:21
ok
got it
Ariel Vallese
@alariva
Nov 17 2016 20:22
Now lets switch to use the external codebase
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:22
so after every change i make, i need to run the test
ok
Ariel Vallese
@alariva
Nov 17 2016 20:22
Yes
Now, from this point we will experiment a bit
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:22
ok
Ariel Vallese
@alariva
Nov 17 2016 20:23
Since im without my machine and im still working on this
Get a copy of your .env file in the container
And bring it to your host codebase
Inside timegrid dir
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:24
ok
Get a copy of your .env file in the container
not sure how to do this step?
please help
Ariel Vallese
@alariva
Nov 17 2016 20:27
Inside container
cat .env
Copy output and take it to your hosts .env
Dirty step, yes, we are experimenting now
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:29
sorry but I am unable to find the .env file, fisrtly how to go inside the container>?
Ariel Vallese
@alariva
Nov 17 2016 20:29
You have been inside the container
When you did the exec to run the phpunit
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:30
ok
yeah
i ve to copy it to /home/kashyaps/timegrid/ path
right?
Ariel Vallese
@alariva
Nov 17 2016 20:32
Yes
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:32
ok
Ariel Vallese
@alariva
Nov 17 2016 20:32
Copy paste the contents
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:35
ok
created a file in /home/kashyaps/timegrid with the name .env and pasted the contents from the containers .env file,
now?
Ariel Vallese
@alariva
Nov 17 2016 20:41
Good
So, this is trying to replicate the " installed" codebase
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:41
ok
Ariel Vallese
@alariva
Nov 17 2016 20:42
So when we share the directory it is still configured for the container
Im willing not to forget anything
Stop your current container
Now we will run it but sharing the dir, as it is documented on the readme
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:43
i did ctrl+d to come out of the container
is it fine?
Ariel Vallese
@alariva
Nov 17 2016 20:44
Yes
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:44
ok
Ariel Vallese
@alariva
Nov 17 2016 20:44
Remember to stop it
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:47
it is stopped right, after ctrl+D, i came out of the container
Ariel Vallese
@alariva
Nov 17 2016 20:48
Ok
Now run it but shating the dir
Sharing*
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:48
or should i use sudo docker stop <IMAGEID >
Ariel Vallese
@alariva
Nov 17 2016 20:48
yes
If you do sudo docker ps nothing should be there
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:49
ok
done
Ariel Vallese
@alariva
Nov 17 2016 20:50
Ok
Ran the container again?
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:51
running
Ariel Vallese
@alariva
Nov 17 2016 20:51
Now enter to it
In another console
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:51
sudo docker run -p8000:8000 timegrid:latest
Ariel Vallese
@alariva
Nov 17 2016 20:51
And try to run tests
Nope
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:51
this command right?

docker run -p8000:8000 -v ~/timegrid/:/var/www/timegrid timegrid:latest

this?
Ariel Vallese
@alariva
Nov 17 2016 20:52
Yes
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:52
ok
from which directory should i run this command>
Ariel Vallese
@alariva
Nov 17 2016 20:52
Because this time we want to share the codebase with host machine
Any, no matter
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:52
ok
ok
error
Starting MySQL database server: mysqld ..
Checking for tables which need an upgrade, are corrupt or were
not closed cleanly..
PHP Warning: require(/var/www/timegrid/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/timegrid/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required '/var/www/timegrid/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/timegrid/bootstrap/autoload.php on line 17
Ariel Vallese
@alariva
Nov 17 2016 20:53
Right
Is it still running?
Check with ps
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:54
sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
kashyaps@PRINHYLTPHP1034:~/timegrid$
nothing came
Ariel Vallese
@alariva
Nov 17 2016 20:54
Ok, so it stopped
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:54
no container is running
Ariel Vallese
@alariva
Nov 17 2016 20:55
Ok
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:55
we stopped it right
Ariel Vallese
@alariva
Nov 17 2016 20:55
It actually stopped because it tries to serve but the timegrid install is incomplete
Can you guess what is missing?
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:57
something from the env file we copied
?
Ariel Vallese
@alariva
Nov 17 2016 20:58
Could be, but esencially from the error o/p, this is because we never ran composer install
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:58
oh
ok
Ariel Vallese
@alariva
Nov 17 2016 20:58
And the vendor directory is empty
So basically, the application crashes
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:59
ok
Ariel Vallese
@alariva
Nov 17 2016 20:59
Now, i think this can be twisted to fix now. I dont want to confuse you with complex stuff
Kashyap Sharma
@Kashyap12
Nov 17 2016 20:59
ok
Ariel Vallese
@alariva
Nov 17 2016 20:59
If you dare
You can run the container without sharing, and login to the container to edit the code and see changes
You can use vim or nano as editor
Until we release a new dockerfile to happily share the codebase with host, so you can use sublime or whatever gui editor you like
Kashyap Sharma
@Kashyap12
Nov 17 2016 21:01
surely, but my eyes are not opening anymore , can we continue from here tomorrow?
Ariel Vallese
@alariva
Nov 17 2016 21:01
This will probably be solved this week
Sure
Kashyap Sharma
@Kashyap12
Nov 17 2016 21:01
great
Ariel Vallese
@alariva
Nov 17 2016 21:01
This was a big step
Kashyap Sharma
@Kashyap12
Nov 17 2016 21:01
thanks
:)
Ariel Vallese
@alariva
Nov 17 2016 21:01
Call it a day
Congrats!
Kashyap Sharma
@Kashyap12
Nov 17 2016 21:02
good night @alariva
:)
Ariel Vallese
@alariva
Nov 17 2016 21:02
Good night!