diff --git a/docs/cluster-management/running-locally.md b/docs/cluster-management/running-locally.md index a7542a62..aabc4039 100644 --- a/docs/cluster-management/running-locally.md +++ b/docs/cluster-management/running-locally.md @@ -86,7 +86,7 @@ services: To set your update, you'll need to rebuild the docker-compose services first. ```bash -$ docker-compose build +$ docker-compose build --no-cache ``` Restart the local cluster to have your changes take effect. @@ -116,33 +116,63 @@ One important thing to note is that your `docker-compose.yml` will have all the You can choose to use a local development instance of the UI. -In development mode, the UI hosts itself on port `4200` and assumes the API is served locally on `8080` by default. You would need to modify the UI's `config/environment.js` file to point to your local Screwdriver cluster, specifcally the API. This can be done by modifying the value right before the `return ENV;` statement. +In development mode, the UI hosts itself on port `4200` and assumes the API is served locally on `8080` by default. You would need to modify the UI's `config/environment.js` file to point to your local Screwdriver cluster, specifically the API. This can be done by modifying `SDAPI_HOSTNAME` and `SDSTORE_HOSTNAME` values to match the services -> api -> environment -> `URI` and `ECOSYSTEM_STORE` in your `docker-compose.yml`. The following is a snippet that highlights the change you would make in the `config/environment.js` ```js - . . . - ENV.APP.SDAPI_HOSTNAME = 'http://11.22.33.44:8080'; // 8080 is the default. You can also change this - return ENV; + ... + APP: { + // Here you can pass flags/options to your application instance + // when it is created + SDAPI_HOSTNAME: 'http://172.142.26.99:9001', + SDAPI_NAMESPACE: 'v4', + SDSTORE_HOSTNAME: 'http://172.142.26.99:9002', + ... + }, ``` -The following snippet highlights the `docker-compose.yml` values that need to be modified to use your local UI instance along with the SD-in-a-box cluster. +The following snippet highlights the `docker-compose.yml` values that need to be modified to use your local UI instance along with the SD-in-a-box cluster. You will also need to delete the `ui` section under `services`. ```yaml version: '2' services: - api: - . . . - ports: - - 8080:80 # UI default port for API is 8080. This can be changed according to the value you set in config/environment.js - environment: - URI: http://11.22.33.44:8080 # Tells the launcher where to communicate build updates to the API. - ECOSYSTEM_UI: http://11.22.33.44:4200 # Tells the API where the UI is hosted. Related to OAuth mismatching-hostname issues + api: + image: screwdrivercd/screwdriver:stable + ports: + - 9001:80 + volumes: + - /var/run/docker.sock:/var/run/docker.sock:rw + - ./data/:/tmp/sd-data/:rw + environment: + PORT: 80 + URI: http://172.142.26.99:9001 # API + ECOSYSTEM_UI: http://localhost:4200 # need to change to this value here + ECOSYSTEM_STORE: http://172.142.26.99:9002 # Store . . . + store: + image: screwdrivercd/store:stable + ports: + - 9002:80 + environment: + ECOSYSTEM_UI: http://localhost:4200 + URI: http://172.142.26.99:9002 ``` Please note that you cannot use `localhost` for the `ECOSYSTEM_UI` value if the `URI` value is set to an I.P. address. You will receive an invalid token after log-in. +Once you've made these changes, follow instructions in the UI [README.md](https://github.com/screwdriver-cd/ui/#screwdriver-ui) to get it running on http://localhost:4200. + +Rerun the commands to restart SD-in-a-box with the new changes: + +```bash +$ docker-compose -p screwdriver up +$ docker-compose build --no-cache +$ docker-compose -p screwdriver up +``` + +_Note: Using Chrome will cause login issues. Please use a different browser._ + #### Configuring the API You can choose to use a local development instance of the API.