Project:Deployment: Difference between revisions

From MaRDI portal
Created page with "The [https://github.com/MaRDI4NFDI/portal-compose portal-compose] repository can be deployed to staging and to production. In both cases the docker images that are pulled for each service are defined at the top of the [https://github.com/MaRDI4NFDI/portal-compose/blob/main/docker-compose.yml docker-compose.yml] and [https://github.com/MaRDI4NFDI/portal-compose/blob/main/docker-compose-extra.yml docker-compose-extra.yml] files. == Deployment to staging == The [https://..."
 
No edit summary
 
Line 9: Line 9:
== Deployment to production ==
== Deployment to production ==


Only tagged versions of the portal-compose repository can be deployed to staging. This way we can more easily roll back to a previous version if necessary.
Only tagged versions of the portal-compose repository can be deployed to production. This way we can more easily roll back to a previous version if necessary.


To deploy a new version of portal-compose to the production server:
To deploy a new version of portal-compose to the production server:
# After merging the latest pull request, create a tag and push it to the repository. Make sure that the tag_version is in conjunction with the latest released version.
# After merging the latest pull request, create a tag and push it to the repository. Make sure that the tag_version is in conjunction with the latest released version. <syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
git tag -s <tag_version>
git tag -s <tag_version>
git push origin <tag_version>
git push origin <tag_version>
Line 23: Line 22:
## Click 'Generate release notes'
## Click 'Generate release notes'
## Click 'Publish release'
## Click 'Publish release'
# Update the [https://github.com/MaRDI4NFDI/srv-mardi02/blob/main/deploy deploy script] in the production server to make sure that it deploys the corresponding tag.
# Update the [https://github.com/MaRDI4NFDI/srv-mardi02/blob/main/deploy deploy script] in the production server to make sure that it deploys the corresponding tag.
## Change the line
## Change the line <syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
git checkout <latest_tag>
git checkout <latest_tag>
</syntaxhighlight>
</syntaxhighlight>
Line 33: Line 30:
== Deploy changes from the wikibase repository ==
== Deploy changes from the wikibase repository ==


To make sure that changes from [https://github.com/MaRDI4NFDI/docker-wikibase docker-wikibase] make sure that the correct tag for the docker-wikibase image is indicated at the top of the [https://github.com/MaRDI4NFDI/portal-compose/blob/main/docker-compose.yml docker-compose.yml] file.
To make sure that changes from [https://github.com/MaRDI4NFDI/docker-wikibase docker-wikibase] are deployed just double-check that the correct tag for the docker-wikibase image is indicated at the top of the [https://github.com/MaRDI4NFDI/portal-compose/blob/main/docker-compose.yml docker-compose.yml] file.

Latest revision as of 16:27, 21 March 2024

The portal-compose repository can be deployed to staging and to production.

In both cases the docker images that are pulled for each service are defined at the top of the docker-compose.yml and docker-compose-extra.yml files.

Deployment to staging

The deployment script in staging is configured to pull the main branch in portal-compose. The deployment can be triggered by just executing the corresponding Github action as shown in the staging server repository.

Deployment to production

Only tagged versions of the portal-compose repository can be deployed to production. This way we can more easily roll back to a previous version if necessary.

To deploy a new version of portal-compose to the production server:

  1. After merging the latest pull request, create a tag and push it to the repository. Make sure that the tag_version is in conjunction with the latest released version.
    git tag -s <tag_version>
    git push origin <tag_version>
    
  2. Create a new release.
    1. Go to the releases section in Github.
    2. Click 'Draft a new release'
    3. Select your latest tag in the dropdown menu
    4. Click 'Generate release notes'
    5. Click 'Publish release'
  3. Update the deploy script in the production server to make sure that it deploys the corresponding tag.
    1. Change the line
      git checkout <latest_tag>
      
    2. Push the changes. Deployment follows automatically.

Deploy changes from the wikibase repository

To make sure that changes from docker-wikibase are deployed just double-check that the correct tag for the docker-wikibase image is indicated at the top of the docker-compose.yml file.