Skip to content
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

Make two deployments #12

Closed
blcham opened this issue Feb 22, 2022 · 7 comments
Closed

Make two deployments #12

blcham opened this issue Feb 22, 2022 · 7 comments
Assignees

Comments

@blcham
Copy link
Contributor

blcham commented Feb 22, 2022

You can copy configuration in jenkins, don't forget to configure to different repository (i believe that they are created already).

see also /etc/apache2/sites-enabled/000-kbss.felk.cvut.cz.conf that maps the url.

Afterwards notify @kostobog to update its git repo.

A/C:

  • We have two separate builds:
    • branch avic deploys to kbss.felk.cvut.cz/fta-fmea-avic
    • branch main deploys to kbss.felk.cvut.cz/fta-fmea (note main instead of master)
  • both of the deployments works and have different data obviously
  • the server for new deployment (fta-fmea) should be configured to access the triple store repository https://graphdb.onto.fel.cvut.cz/users/repositories/fta-fmea-2021-case-study-v02. The username and password for the repository are the same as for the avic deployment no need to change it in the application.yml.
@kostobog
Copy link
Collaborator

To create a new deployment follow these steps:

KBSS

Prepare deployment configuration in KBSS
Deployment configurations are located in - /opt/projects/19msmt/tool-deployment/deployments
copy one of the configurations folders (those that end with -config) and make the following changes in the :

  • rename the copied config folder. The folder name should end with -config. The part of the name without -config is used in the Jenkins deployment.
  • in ./.env.prod set BASE_API_URL to the URL where the new deployment will be accessible.
  • in ./WEB-INF/classes/application.yml configure the triple store repository

Configure Apache 2
Check the apache2 configuration file /etc/apache2/sites-enabled/000-kbss.felk.cvut.cz.conf
Find the existing element of fta-fmea server
Copy the element and updated the properties:

  • the new location accessible, e.g. /fta-fmea-server
  • the ProxyPass properties. Change the name to the new context of the deployment. The host and port are the same (unless the local tomcat/appserver has changed)

Context of the deployment is constructed from the

Jenkins

Create deployment configurations in jenkins
Copy the configurations for the backend and the server. Name the new deployment scripts fta-fmea and fta-fmea-ui for the backend and ui respectively.

To copy a configuration:

  1. go to https://kbss.felk.cvut.cz/jenkins/view/19MSMT/ and click New Item link in the menu on the left.
  2. specify the name of the new deployment
  3. scroll down to the Copy from field and type the name of the deployment to copy, e.g. fta-fmea-avic

To open the configuration of a particular project go to the project page and click on the configure link in the menu on the left.

Update Backend Deployment
In the copied backend deployment configuration update the following fields:

  • change description to specify that this is a deployment for the faculty of transportation.
  • in the Source Code Management section set branches to build to main
  • in the Build section in the second Execute shell block in the Command field change the deployment name parameter (the second from the right)

Update Client Deployment
In the copied client deployment configuration update the following fields:

  • change description to specify that this is a deployment for the faculty of transportation.
  • in the Source Code Management section set branches to build to main
  • in the Build section in the Command field change the profile command update the last parameter which refers to the deployment configuration without the trailing "-config".

NOTE

The deployment name parameter is used to

  • construct the location of the deployment configuration on KBSS.
  • construct the context of the client application
  • construct the context of the server application

For example, if the deployment name is fta-fmea

  • the deployment configuration should be located in the folder the fta-fmea-config
  • the client will be deployed at /fta-fmea
  • the server will be deployed at /fta-fmea-server

@Matthew-Kulich
Copy link
Contributor

Thanks for detailed instructions.
Unfortunately i don't have permissions to change default branch to main but everything else is done.

@blcham
Copy link
Contributor Author

blcham commented Feb 24, 2022

@Matthew-Kulich you should have it now.

@Matthew-Kulich
Copy link
Contributor

@blcham Thanks, can you also give me acces to ui repository, please

@blcham
Copy link
Contributor Author

blcham commented Feb 24, 2022

@Matthew-Kulich done

@blcham
Copy link
Contributor Author

blcham commented Feb 25, 2022

Thanks, seems to work correctly, closing the issue.

@blcham blcham closed this as completed Feb 25, 2022
@blcham
Copy link
Contributor Author

blcham commented Feb 25, 2022

@kostobog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants