Skip to content

A set of development container images that can be used for SAP BTP development with Cloud Application Programming Model projects in Visual Studio Code

License

Notifications You must be signed in to change notification settings

The-Nefarious-Developer/devcontainer-images

Repository files navigation

Nefarious Development Container Images

Build, Test and Deploy semantic-release: angular

A set of development container images that can be used for SAP BTP development with Cloud Application Programming Model projects in Visual Studio Code.

These images were created to provide a consistent set of dependencies to the development container templates provided through this repository.

If you have any question, suggestion or request regarding what this repository can offer, you can use this discussion area.

Content

  • scripts - Contains a set of scripts to build the project.
  • src - Contains reusable dev container images.
  • test - Contains the test suite for each provided image.

Available Images

Ths repository generates the following docker/devcontainer images using GHCR:

Image Base Image Variants
sap-cap-javascript-node mcr.microsoft.com/devcontainers/javascript-node Versions Available
sap-cap-typescript-node mcr.microsoft.com/devcontainers/typescript-node Versions Available

How it works

The directories inside the src folder will contain the files that will compose the images to be created.

Each image folder will have the following structure:

  • .devcontainer which is going to contain the Dockerfile and the devcontainer.json with properties and dependencies for the container image creation.
  • variants.json with versions that will be set to the upstream image of that devcontainer.

Here is an example of variants.json file:

{
    "variants": [
        "version1",
        "version2"
    ]
}

The usage of this file is is directly tied to the variant argument provided to the devcontainer.json and its values will be related to the image directories to generate a variants-matrix.json file during the build process.

This procedure will enable a GitHub Actions pipeline automation to read all images that needs to be deployed through a matrix strategy configured in the setup job.

Testing

Each image needs to have a test implementation. The GitHub Actions pipeline will search for those images based on the variant-matrix.json created through the build script.

Note: The lack of test implementation might cause the CI/CD pipeline to fail.

The test implementation is using functions available through the usage of the harness.sh file.
Each image should call the setup function to properly configure the test environment. This process will generate a temporary docker image to be executed at the evaluation process.

Template for test implementation:

#!/usr/bin/env bash
set -euo pipefail
source "$(dirname "$0")/../test-utils/harness.sh"

setup "<image>" "$VARIANT"

run_test "<test description>" "<evaluation command>" "<expected value>"
...

Testing locally

To test the images locally, the environment variable VARIANT need to be set prior to the bash file execution.

Template for command to run the test locally:

VARIANT=<upstream version> test/<image>/test.sh

The package.json file contains an example of local testing through the script test:local.

How can I contribute?

Contributions are welcome! Here's how you can get involved:

  1. Report Issues: Found a bug or have a feature request? Open an issue.
  2. Submit Pull Requests: Fork the repository, create a new branch, make your changes, and submit a PR.
  3. Improve Documentation: Help us improve the README or add examples to make setup easier.
  4. Test & Feedback: Try the devcontainer images and give us feedback to improve them.

Please follow the contribution guidelines for more details.

References

These images were created following the guidelines provided through the devcontainers/template-starter and devcontainers/images.

Acknowledgments

Special thanks to Christian Sutter who came up with the harness test strategy used in this project.

License

Copyright (c) 2024 The Nefarious Developer
Licensed under the MIT License. See LICENSE.

About

A set of development container images that can be used for SAP BTP development with Cloud Application Programming Model projects in Visual Studio Code

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages