diff --git a/.github/workflows/candide.yaml b/.github/workflows/candide.yaml index e0d83c47..ffebd463 100644 --- a/.github/workflows/candide.yaml +++ b/.github/workflows/candide.yaml @@ -80,7 +80,7 @@ jobs: - name: Deploy with restart if: steps.changed-non-plugin-files.outputs.any_changed == 'true' run: |- - sed -i -e "s/PROJECT_ID/$PROJECT_ID/g" -e "s/REPOSITORY/$REPOSITORY/g" -e "s/IMAGE/$IMAGE_PBOT/g" -e "s/GITHUB_SHA/$GITHUB_SHA/g" k8s/deployment.yaml + sed -i -e "s/PROJECT_ID/$PROJECT_ID/g" -e "s/REPOSITORY/$REPOSITORY/g" -e "s/IMAGE/$IMAGE_PBOT/g" -e "s/GITHUB_SHA/$GITHUB_SHA/g" k8s/candide-pbot.yaml kubectl apply -f k8s/candide-pbot.yaml vms: @@ -118,5 +118,5 @@ jobs: - name: Deploy run: |- - sed -i -e "s/PROJECT_ID/$PROJECT_ID/g" -e "s/REPOSITORY/$REPOSITORY/g" -e "s/IMAGE/$IMAGE_VM/g" -e "s/GITHUB_SHA/$GITHUB_SHA/g" k8s/deployment.yaml + sed -i -e "s/PROJECT_ID/$PROJECT_ID/g" -e "s/REPOSITORY/$REPOSITORY/g" -e "s/IMAGE/$IMAGE_VM/g" -e "s/GITHUB_SHA/$GITHUB_SHA/g" k8s/candide-vm.yaml kubectl apply -f k8s/candide-vm.yaml diff --git a/applets/pbot-vm/Dockerfile b/applets/pbot-vm/Dockerfile index d2d7be71..a8513883 100644 --- a/applets/pbot-vm/Dockerfile +++ b/applets/pbot-vm/Dockerfile @@ -1,7 +1,7 @@ FROM perl:5.34 # Install system dependencies. -RUN apt-get update && apt-get install -y clang gcc clang g++ tcl ghc git cpanminus +RUN apt-get update && apt-get install -y clang gcc clang g++ tcl ghc git cpanminus dos2unix # Need the sources. COPY . /opt/pbot @@ -12,8 +12,15 @@ RUN apt-get install -y socat RUN sed -i -e "s/\/dev\/ttyS2/\/tmp\/ttyS2/g" /opt/pbot/applets/pbot-vm/guest/bin/guest-server RUN sed -i -e "s/\/dev\/ttyS3/\/tmp\/ttyS3/g" /opt/pbot/applets/pbot-vm/guest/bin/guest-server -# Setup the guest server. -RUN cd /opt/pbot/applets/pbot-vm/guest/bin && ls -al +# Line endings on other platforms. +RUN find . -type f -print0 | xargs -0 dos2unix /opt/pbot/applets/pbot-vm/guest/bin/* +RUN find . -type f -print0 | xargs -0 dos2unix /opt/pbot/applets/pbot-vm/host/bin/* +RUN dos2unix /opt/pbot/applets/pbot-vm/entrypoint.sh +RUN chmod +x /opt/pbot/applets/pbot-vm/guest/bin/* +RUN chmod +x /opt/pbot/applets/pbot-vm/host/bin/* +RUN chmod +x /opt/pbot/applets/pbot-vm/entrypoint.sh + +# Setup the guest. RUN cd /opt/pbot/applets/pbot-vm && ./guest/bin/setup-guest # Prefer a non-root user.