This repository hosts a GitHub Action workflow for
- downloading the current WinCC OA version from winccoa.com and
- generating and uploading Docker images of WinCC OA.
The workflow is defined in .github\workflows\generate-winccoa-image.yml
.
By default, for all workflow runs, an environment with the name staging
is used.
Create all required environments and adapt the logic in the workflow (get_environment -> env_check
) if you want to use multiple environments.
ETM_USERNAME
: Username for winccoa.comETM_PASSWORD
: Password for winccoa.comDOCKER_USER
: DockerHub usernameDOCKER_PASSWORD
: DockerHub password
DOCKER_IMAGE
: Name of the Docker image, e.g.mydockerhubuser/winccoa
The workflow is triggered on:
- Push to
main
,release/*
,develop
, anddevelop/*
branches. - Published releases.
- Environment Setup: Gets the desired environment
- Download Current WinCC OA Version: Requires ETM_USERNAME and ETM_PASSWORD secrets for authentication
- Extract Version Information: Processes a ZIP filename to determine the WinCC OA version
- Prepare Data for Docker Image Build: Involves unzipping data and preparing it for Docker build.
- Docker Setup: Sets up Docker and builds a temporary image
- Docker Build and Push Images: Builds and pushes Docker images for different targets
- Docker Build Teardown: Tears down the Docker setup post-build
The build-docker/Dockerfile_install
includes targets like api
, server
, and uiserver
with the prefix winccoa
. Each target corresponds to a possible tag of the resulting Docker image.
The really built targets are defined in the step Docker build and push images
.
- Adapt Dockerfile: Define a new target in
build-docker/Dockerfile_install
in the form ofFROM <base> as winccoa<targetname>
or modify an existing one - Edit Workflow File: In the
.github/workflows
directory, open the workflow filegenerate-winccoa-image.yml
- Add/Modify Steps:
- Under the
Docker build and push images
step, modify the list of targets in the for loop include your new target or modify the existing one. - The default list defines the targets:
api server uiserver
- Under the
- It is highly recommended testing changes locally if possible, all docker commands can be run locally as well
- Once changes are verified locally, test the changes by triggering the workflow
- Monitor the build process to ensure your changes are correctly built and pushed
Given:
- Docker image base name:
mydockerhubuser/winccoa
- Downloaded WinCC OA filename
WinCC_OA_3.19_linux_debian_x86_64_P007.zip
- Extracted version:
3.19.7
- List of targets:
api server uiserver
Resulting Docker image names:
mydockerhubuser/winccoa:v3.19.7-api
from targetwinccoaapi
mydockerhubuser/winccoa:v3.19.7-server
from targetwinccoaserver
mydockerhubuser/winccoa:v3.19.7-uiserver
from targetwinccoauiserver
These images are built and pushed to DockerHub using the provided credentials.
Your contributions play a pivotal role in enhancing the open-source community, making it a hub for learning, inspiration, and innovation. Every contribution, big or small, is deeply appreciated.
Steps to Contribute:
- Fork the Project.
- Create your Feature Branch:
git checkout -b feature/YourFeatureName
. - Commit your Changes:
git commit -m 'Describe your change'
. - Push to the Branch:
git push origin feature/YourFeatureName
. - Open a Pull Request.
For suggestions or enhancements, either submit a pull request or open an issue with the "enhancement" tag. If you find value in this project, kindly star it. Your support means a lot to me!