Skip to content

Commit

Permalink
Merge pull request #42 from RaaLabs/dockerfile
Browse files Browse the repository at this point in the history
add docker build before release
  • Loading branch information
rafaelschlatter authored Oct 29, 2024
2 parents fdac852 + 41a1e77 commit 05021ff
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/release-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- 'MockServer/**'

env:
IMAGES: raaedge.azurecr.io/opcua-test-server
IMAGES: ${{ secrets.RAAEDGE_LOGIN_SERVER }}/opcua-test-server
COVERAGE_FOLDER: Coverage

jobs:
Expand All @@ -32,6 +32,22 @@ jobs:
fetch_all_tags: true
dry_run: ${{ env.RELEASE != 'true' }}
release_branches: ${{ inputs.branches }}

- name: Build Docker image
uses: docker/build-push-action@v6
with:
push: false
no-cache: true
context: .
file: 'MockServer/Dockerfile.Server'
secrets: |
NUGET_GITHUB_PACKAGES_USERNAME=${{ secrets.NUGET_GITHUB_PACKAGES_USERNAME }}
NUGET_GITHUB_PACKAGES_TOKEN=${{ secrets.NUGET_GITHUB_PACKAGES_TOKEN }}
load: true
platforms: linux/amd64
tags: image:local
build-args: |
BUILD_VERSION=${{ steps.tag.outputs.new_version }}
- name: Apply version tag to Docker images
id: references
Expand Down
4 changes: 2 additions & 2 deletions MockServer/Dockerfile.Client
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.12.0-slim

COPY client.py .
COPY MockServer/client.py .

RUN pip install asyncua

CMD [ "python", "./client.py" ]
CMD [ "python", "./client.py" ]
6 changes: 3 additions & 3 deletions MockServer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ docker run --name opcuaserver --network my-net -p 4840:4840 docker.io/library/op
docker run --network my-net docker.io/library/opcua-test-client
````

Config for OPCUA connector:
Config for OPCUA connector (the host used in the serverUrl must match the name given to the Docker container):
````json
{
"serverUrl": "opc.tcp://opcua-test-server:4840/freeopcua/server/",
"serverUrl": "opc.tcp://opcuaserver:4840/freeopcua/server/",
"publishingIntervalSeconds": 1.0,
"nodes": [
{
Expand All @@ -22,4 +22,4 @@ Config for OPCUA connector:
}
]
}
````
````

0 comments on commit 05021ff

Please sign in to comment.