Speed up WunderPreview integration with local debugging

Integrating WunderPreview in your development process is a little like implementing a CI/CD pipeline. But compared to typical CI/CD setup, you do not need to create YAML files for WunderPreview, so it is way easier.

Everyone that has set up a CI/CD pipeline knows that this is a really time consuming and boring endeavor. Typically it works like this:

  • You change something in your YAML configuration file (or your Dockerfile) and commit and push your changes.
  • You wait until your CI/CD service picks up the new changes and runs the pipeline until it eventually breaks.
  • You again change something in your configuration or Dockerfile and the loop starts anew.
  • One loop can take from a minute to half an hour (or even more?) depending on your setup. Basically it is 5 seconds changing configuration and then waiting minutes until you see the result.

    This is really wasting a lot of the developers will to live.

    If you setup WunderPreview for the first time you have to make sure, that you set the right configuration parameters or your existing Dockerfile will not build and start in WunderPreview.
    Depending on your project you need to set database connection parameters, access keys to third party APIs or set the right parameters for your Javascript package manager.

    In a way it is the same loop:

  • First: Change a parameter in the WunderPreview settings of your project (or change something in your Dockerfile)
  • Then: Wait until WunderPreview has built and deployed your project
  • To speed things up and make integration easier, we implemented a really easy (and we think nice) solution to this problem:

  • You set your configuration parameters as always in WunderPreview.
  • You can copy docker build and docker run commands that build/run your project exactly like it is built/run in WunderPreview.
  • Run these commands in the project directory on your local machine and build/run your project locally as WunderPreview would do.
  • In the log viewer of your preview, we added a button called "Troubleshoot":

    Troubleshoot button in WunderPreview log viewer.
    Troubleshoot button in WunderPreview log viewer.

    It opens a modal window showing you the commands to build and run your container on your local machine just like WunderPreview builds and runs it:

    Build Commands in WunderPreview
    Build Commands in WunderPreview for local troubleshooting.

    It is easy like that. This really speeds up the integration because of the following:

  • It shows you what parameters WunderPreview uses to build and run your project and what values those parameters have.
  • Just by seeing the build command you will spot some obvious errors you would not have seen otherwise.
  • Having the docker image locally lets you "log into" the container to investigate problems inside the docker container right on your local machine.
  • Debugging problems this way makes the integration process way faster and not so soul crushing.

    IMPORTANT: When you use a WunderPreview database, you can not test the connection to this database from your local machine. We take security very seriously and therefore only allow the previews running in your WunderPreview account to connect to your database. (But you can swap out the database connection parameters on your local machine with connection parameters to a local database)


    Do you have any questions or remarks? Just send us an email to hi@wunderstack.io. We are happy to hear from you!

    Keep things moving with automated previews.

    Screenshot of WunderPreview Dashboard