-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Adding FE dev instructions #46
base: master
Are you sure you want to change the base?
Conversation
Keep in mind that you need to continue running `npm run watch` to have static files be served continuously. Once stopped, static files won't be found anymore until you restart the `npm watch` or rebuild the container using | ||
|
||
``` | ||
$kobo-install> python run.py --build-kpi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add two other lines:
$kobo-install> python run.py --build-kpi
$kobo-install> python run.py -cf restart kpi
Be aware that `kpi` takes few minutes to restart and to be up&running
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noliveleger, restarting isn't sufficient to use a newly-built image.
host:~/Documents/kobo/dockdev/kobo-install$ docker ps | sed -n '1p;/kpi/p'
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f79d983dccab 50948607b605 "/bin/bash -c 'exec …" 30 minutes ago Up About a minute 8000/tcp kobo-docker_kpi_1
host:~/Documents/kobo/dockdev/kobo-install$ python run.py -cf restart kpi
Restarting kobo-docker_kpi_1 ... done
host:~/Documents/kobo/dockdev/kobo-install$ docker ps | sed -n '1p;/kpi/p'
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f79d983dccab 50948607b605 "/bin/bash -c 'exec …" 30 minutes ago Up 2 seconds 8000/tcp kobo-docker_kpi_1
Instead, I'd suggest ./run.py -cf up -d kpi
, which should notice that the container is using an out-of-date image and recreate the container:
host:~/Documents/kobo/dockdev/kobo-install$ ./run.py -cf up -d kpi
WARNING: Found orphan containers (kobo-docker_redis_cache_1, kobo-docker_postgres_1, kobo-docker_mongo_1, kobo-docker_redis_main_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Recreating kobo-docker_kpi_1 ... done
host:~/Documents/kobo/dockdev/kobo-install$ docker ps | sed -n '1p;/kpi/p'
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
65dbfcc2891f kpi:dev.1573945934 "/bin/bash -c 'exec …" 5 seconds ago Up 4 seconds 8000/tcp kobo-docker_kpi_1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
To immediately see your changes (in the `kpi` repository) live you need to run `npm run watch` to rebuild static files on the fly: | ||
|
||
``` | ||
$kodo-docker> docker-compose -f docker-compose.frontend.yml -f docker-compose.frontend.override.yml run -p 3000:3000 --rm kpi npm run watch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to @jnm work, this could be simplified to:
$kobo-install> ./run.py -cf run -p 3000:3000 --rm kpi npm run watch
To use this new option, two-databases
is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably need some docs related to https://www.flowdock.com/app/kobotoolbox/kobo/threads/oHknJLFhaDrfnSUtNXY2QNoxhCK (maybe applies only to old installs?)
Let's also add a message to the https://www.flowdock.com/app/kobotoolbox/support/threads/L98VRtgJ23hevNvov8mBrBqtWJk |
how see kobotoolbox URL and used URL in Mobile kobo app |
This adds short instructions on using
npm run watch
to rebuild static files during FE development in kpi.