Skip to content

Commit

Permalink
changing dockerfile and script
Browse files Browse the repository at this point in the history
  • Loading branch information
RCMast3r committed Dec 28, 2023
1 parent d898261 commit 9f08cb4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 36 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/create_releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,6 @@ env:
IMAGE_NAME: ${{ github.actor }}/ccoderdbc

jobs:
# build-release-win:
# runs-on: windows-latest # Choose the appropriate OS for your project

# steps:
# - uses: actions/checkout@v2 # Check out your repository

# - name: Configure Project
# uses: threeal/cmake-action@v1.3.0
# with:
# source-dir: third-party
# - name: Build and Package for windows
# run: |
# cd third-party
# cd build
# cmake ..
# cmake --build . --target package # Generate installer
# cp Project-0.1.0-win64.exe ../Project-0.1.0-win64.exe # Replace with your actual installer name
# cd ..

# - name: Get current date and time
# id: date
# run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H_%M_%S')"

# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# tag_name: ${{ steps.date.outputs.date }}
# files: Project-0.1.0-win64.exe


build-and-push-image:
runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion example/test_dbc_pio/platformio.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[env:dbc_test]
platform = native
; lib_deps = https://github.com/RCMast3r/pio_dbc_to_cpp.git
lib_deps = ../pio_dbc_to_cpp
lib_deps = ../../../pio_dbc_to_cpp/
; All path are relative to the `$PROJECT_DIR`
user_dbc =
+<dbcs/hytech.dbc>
Expand Down
19 changes: 14 additions & 5 deletions generator/pio_lib_gen.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
# TODO get and build dbcppp if needed
# TODO get dbc file from url or local file
# TODO run dbcppp on supplied dbc file

Import("env")
import os
import hashlib
import pathlib

import subprocess

import docker

try:
import docker
except ImportError:
env.Execute("$PYTHONEXE -m pip install docker")
import docker
import SCons.Action

import tarfile
from platformio import fs

# based on https://github.com/nanopb/nanopb/blob/master/generator/platformio_generator.py

Import("env")


python_exe = env.subst("$PYTHONEXE")
project_dir = env.subst("$PROJECT_DIR")
Expand Down Expand Up @@ -51,7 +56,7 @@ def copy_to(src, dst):


if not len(dbc_file):
print("[nanopb] ERROR: No file matched pattern:")
print("[dbcpio] ERROR: No file matched pattern:")
print(f"user_dbcs: {user_dbc_file}")
exit(1)

Expand All @@ -62,7 +67,11 @@ def copy_to(src, dst):

print(abs_path_to_dbc)
print(generated_src_dir)
print(docker)
client = docker.from_env()

client.containers.run('asdf:asdf', './scr.sh '+drvname+' '+,volumes=[abs_path_to_dbc+":/data"], working_dir='/app')
print(client.api)
print(client.containers)
client.containers.run('ghcr.io/rcmast3r/ccoderdbc:main', './build/coderdbc -rw -noconfig -dbc /data/hytech.dbc -out /out -drvname '+drvname, environment=["PUID=1000", "GUID=1000"],volumes=[abs_path_to_dbc+":/data", generated_src_dir+":/out"], working_dir='/app')

print("hello from lib2")
1 change: 1 addition & 0 deletions third-party/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RUN apt-get autoremove -y \

# Set an entrypoint if needed
# ENTRYPOINT ["executable"]
VOLUME /out

# Set default command if needed
# CMD ["command"]

0 comments on commit 9f08cb4

Please sign in to comment.