Skip to content

Commit

Permalink
Merge pull request #2 from rwth-acis/develop
Browse files Browse the repository at this point in the history
Use Requirements Bazaar project id given as docker env variable
  • Loading branch information
pdolif authored Oct 31, 2020
2 parents bc04b39 + b082c0f commit e24ed0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ docker build . -t cae-project-management-service
Then you can run the image like this:

```bash
docker run -e MYSQL_USER=myuser -e MYSQL_PASSWORD=mypasswd -e GITHUB_PERSONAL_ACCESS_TOKEN=personal_access_token -e GITHUB_ORGANIZATION=organization_name -e GITHUB_OAUTH_CLIENTID=client_id -e GITHUB_OAUTH_CLIENTSECRET=client_secret -p 8080:8080 -p 9011:9011 cae-project-management-service
docker run -e MYSQL_USER=myuser -e MYSQL_PASSWORD=mypasswd -e GITHUB_PERSONAL_ACCESS_TOKEN=personal_access_token -e GITHUB_ORGANIZATION=organization_name -e GITHUB_OAUTH_CLIENTID=client_id -e GITHUB_OAUTH_CLIENTSECRET=client_secret -e REQ_BAZ_PROJECT_ID=project_id -p 8080:8080 -p 9011:9011 cae-project-management-service
```

Replace *myuser* and *mypasswd* with the username and password of a MySQL user with access to a database named *commedit*.
Expand All @@ -31,6 +31,8 @@ For connecting the users CAE account with the GitHub account, an OAuth GitHub ap
Once you've created your OAuth app, you will receive a client id and a client secret. Replace the placeholders *client_id* and *client_secret* in the docker run command with these.
The OAuth app is also used to get access tokens for the GitHub API, which allow to query the GitHub projects API. In order to get access to the GitHub projects, the organization where you host the GitHub projects needs to be configured. In the organization on GitHub, go to Settings, then Third Party access and grant access for your OAuth app. Otherwise access tokens generated by using your OAuth app will not have access to the GitHub projects of your organization.

Set *project_id* to the id of a project in the Requirements Bazaar which should be used to create categories for CAE components.

In order to customize your setup you can set further environment variables.

### Node Launcher Variables
Expand All @@ -56,6 +58,7 @@ The las2peer port is fixed at *9011*.
| GITHUB_ORGANIZATION | *mandatory* |
| GITHUB_OAUTH_CLIENTID | *mandatory* |
| GITHUB_OAUTH_CLIENTSECRET | *mandatory* |
| REQ_BAZ_PROJECT_ID | *mandatory* |
| DISABLE_CATEGORY_CREATION | false |

### Web Connector Variables
Expand Down
3 changes: 3 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export MYSQL_DATABASE='commedit'
echo "Mandatory variable GITHUB_OAUTH_CLIENTID is not set. Add -e GITHUB_OAUTH_CLIENTID=client_id to your arguments." && exit 1
[[ -z "${GITHUB_OAUTH_CLIENTSECRET}" ]] && \
echo "Mandatory variable GITHUB_OAUTH_CLIENTSECRET is not set. Add -e GITHUB_OAUTH_CLIENTSECRET=client_secret to your arguments." && exit 1
[[ -z "${REQ_BAZ_PROJECT_ID}" ]] && \
echo "Mandatory variable REQ_BAZ_PROJECT_ID is not set. Add -e REQ_BAZ_PROJECT_ID=project_id to your arguments." && exit 1

# set defaults for optional service parameters
[[ -z "${SERVICE_PASSPHRASE}" ]] && export SERVICE_PASSPHRASE='Passphrase'
Expand Down Expand Up @@ -61,6 +63,7 @@ set_in_service_config gitHubOrganization ${GITHUB_ORGANIZATION}
set_in_service_config debugDisableCategoryCreation ${DISABLE_CATEGORY_CREATION}
set_in_service_config gitHubOAuthClientId ${GITHUB_OAUTH_CLIENTID}
set_in_service_config gitHubOAuthClientSecret ${GITHUB_OAUTH_CLIENTSECRET}
set_in_service_config reqBazProjectId ${REQ_BAZ_PROJECT_ID}

# configure web connector properties

Expand Down

0 comments on commit e24ed0d

Please sign in to comment.