##// END OF EJS Templates
docs(upgrade): explain how to avoid scale 2x on upgrade
docs(upgrade): explain how to avoid scale 2x on upgrade

File last commit:

r356:1268c91e
r365:24eb9af8
Show More
dev-setup.rst
179 lines | 4.0 KiB | text/x-rst | RstLexer
docs(develop): added dev docs to setup env for development
r355 .. _dev-setup:
========================
Setup of Development env
========================
To setup a development environment with all needed services for development follow the below actions:
get rcstack & docker
++++++++++++++++++++
To quickly get and install rcstack run this command
.. code-block:: bash
mkdir rhodecode-docker && cd rhodecode-docker
curl -L -s -o rcstack https://dls.rhodecode.com/get-rcstack && chmod +x rcstack
./rcstack init
Previously used `./rcstack init` command will setup docker, and bootstrap the env, but we still need to fetch dev-tools
.. code-block:: bash
# make sure we got the latest dev-tools installed
curl -L -s -o dev-tools https://code.rhodecode.com/rhodecode-enterprise-docker/raw/master/scripts/dev-tools/dev-tools && chmod +x dev-tools
# Please check available options using --help
./dev-tools --help
Obtain source code
++++++++++++++++++
Please clone the following repositories at the same level as :file:`rhodecode-docker` dir is created
.. code-block:: bash
hg clone https://code.rhodecode.com/internal/rhodecode-vcsserver
hg clone https://code.rhodecode.com/internal/rhodecode-enterprise-ce
hg clone https://code.rhodecode.com/internal/rhodecode-enterprise-ee
Setup env variable WORKSPACE_HOME to your absolute path where you repositories for dev are stored. e.g
example:
`WORKSPACE_HOME=/media/psf/Home/workspace`
Set this on bash:
.. code-block:: bash
export WORKSPACE_HOME=/media/psf/Home/workspace
Finally this is the structure you should get:
.. code-block:: bash
ls -la $WORKSPACE_HOME
drwxr-xr-x 1 docker docker 928 Dec 18 23:46 rhodecode-docker
drwxr-xr-x 1 docker docker 1504 Dec 18 23:46 rhodecode-enterprise-ce
drwxr-xr-x 1 docker docker 1280 Dec 18 23:46 rhodecode-enterprise-ee
drwxr-xr-x 1 docker docker 832 Dec 18 23:46 rhodecode-vcsserver
run dev-env
+++++++++++
First start with setting up a dev builds for dev images
.. code-block:: bash
# execute from cd $WORKSPACE_HOME/rhodecode-docker
./rcstack cli set-runtime-image beta
To start developing we need few services to run, we can run this using `dev-env`
.. code-block:: bash
# execute from cd $WORKSPACE_HOME/rhodecode-docker
./dev-tools dev-env
You can check the status of services by running
.. code-block:: bash
# execute from cd $WORKSPACE_HOME/rhodecode-docker
./rcstack status
Prepare services in develop mode
++++++++++++++++++++++++++++++++
copy the runtime.env as our dev.env:
.. code-block:: bash
cp .custom/.runtime.env .custom/.dev.env
go to rhodecode-vcsserver and run
.. code-block:: bash
# execute from cd $WORKSPACE_HOME/rhodecode-vcsserver
mkdir -p .dev/
echo "make sh" > .dev/dev-env.sh && chmod +x .dev/dev-env.sh
cp configs/development.ini .dev/dev.ini
go to rhodecode-enterprise-ce and run
.. code-block:: bash
# execute from cd $WORKSPACE_HOME/rhodecode-enterprise-ce
mkdir -p .dev/
echo "make sh" > .dev/dev-env.sh && chmod +x .dev/dev-env.sh
cp configs/development.ini .dev/dev.ini
run services (preferably in two separate shells)
++++++++++++++++++++++++++++++++++++++++++++++++
.. code-block:: bash
cd $WORKSPACE_HOME/rhodecode-docker
# shell 1
./dev-tools ce
rhodecode-enterprise-ce
# shell 2
./dev-tools vcs
rhodecode-vcsserver
Init DB
+++++++
.. code-block:: bash
fix(docs): fixed develop docs
r356
docs(develop): added dev docs to setup env for development
r355 # run from enterprise shell
rhodecode-enterprise-ce
/usr/local/bin/rhodecode_bin/bin/rc-setup-app \
/home/rhodecode/rhodecode-enterprise-ce/.dev/dev.ini \
--force-yes \
--skip-existing-db \
--user=admin \
--password=secret4 \
--email=admin@example.com \
--repos=/var/opt/rhodecode_repo_store
.. note::
--user=admin --password=secret4 used here can be used to log-in to first super-admin account in web UI
Manually Upgrade DB
+++++++++++++++++++
.. code-block:: bash
/usr/local/bin/rhodecode_bin/bin/rc-upgrade-db \
/home/rhodecode/rhodecode-enterprise-ce/.dev/dev.ini \
--force-yes