From 6c6ebb3340e51ff4ffad0b899b94fd09e537ebbd Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 26 Mar 2024 11:34:12 +0100 Subject: [PATCH] Update --- .github/workflows/deploy.yaml | 92 +++++++++++++++++------------------ Dockerfile | 2 +- init => init-vscode | 2 +- scripts/install_sysdeps.sh | 11 ++++- 4 files changed, 58 insertions(+), 49 deletions(-) rename init => init-vscode (86%) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 2eb464a..408711a 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -227,49 +227,49 @@ jobs: run: | docker manifest inspect ${{ steps.build_vars.outputs.OUTPUT_IMAGE_NAME }} > manifest.json - # - name: Reclaim Disk Space for SBOM Generation 🚮 - # uses: insightsengineering/disk-space-reclaimer@v1 - # with: - # tools-cache: false - # android: true - # dotnet: true - # haskell: true - # large-packages: true - # swap-storage: false - # docker-images: true - - # - name: Generate SBOM 📃 - # uses: anchore/sbom-action@v0 - # with: - # image: "${{ steps.build_vars.outputs.OUTPUT_IMAGE_NAME }}" - # output-file: "${{ steps.build_vars.outputs.SBOM_OUTPUT_FILENAME }}" - # artifact-name: "sbom.spdx" - - # - name: Upload image manifest to release 🔼 - # uses: svenstaro/upload-release-action@v2 - # if: "${{ needs.normalize-inputs.outputs.release_tag }} != ''" - # with: - # repo_token: ${{ secrets.REPO_GITHUB_TOKEN }} - # file: "manifest.json" - # asset_name: "image.manifest.${{ steps.build_vars.outputs.OUTPUT_IMAGE_NAME }}.json" - # tag: "${{ needs.normalize-inputs.outputs.release_tag }}" - # overwrite: true - - # - name: Upload SBOM to release 🔼 - # uses: svenstaro/upload-release-action@v2 - # if: "${{ needs.normalize-inputs.outputs.release_tag }} != ''" - # with: - # repo_token: ${{ secrets.REPO_GITHUB_TOKEN }} - # file: "${{ steps.build_vars.outputs.SBOM_OUTPUT_FILENAME }}" - # asset_name: "SBOM for ${{ steps.build_vars.outputs.OUTPUT_IMAGE_NAME }}.spdx.json" - # tag: "${{ needs.normalize-inputs.outputs.release_tag }}" - # overwrite: true - - # - name: Move cache ♻️ - # run: | - # rm -rf /tmp/.buildx-cache - # if [ -f /tmp/.buildx-cache-new ] - # then { - # mv /tmp/.buildx-cache-new /tmp/.buildx-cache - # } - # fi + - name: Reclaim Disk Space for SBOM Generation 🚮 + uses: insightsengineering/disk-space-reclaimer@v1 + with: + tools-cache: false + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: false + docker-images: true + + - name: Generate SBOM 📃 + uses: anchore/sbom-action@v0 + with: + image: "${{ steps.build_vars.outputs.OUTPUT_IMAGE_NAME }}" + output-file: "${{ steps.build_vars.outputs.SBOM_OUTPUT_FILENAME }}" + artifact-name: "sbom.spdx" + + - name: Upload image manifest to release 🔼 + uses: svenstaro/upload-release-action@v2 + if: "${{ needs.normalize-inputs.outputs.release_tag }} != ''" + with: + repo_token: ${{ secrets.REPO_GITHUB_TOKEN }} + file: "manifest.json" + asset_name: "image.manifest.${{ steps.build_vars.outputs.OUTPUT_IMAGE_NAME }}.json" + tag: "${{ needs.normalize-inputs.outputs.release_tag }}" + overwrite: true + + - name: Upload SBOM to release 🔼 + uses: svenstaro/upload-release-action@v2 + if: "${{ needs.normalize-inputs.outputs.release_tag }} != ''" + with: + repo_token: ${{ secrets.REPO_GITHUB_TOKEN }} + file: "${{ steps.build_vars.outputs.SBOM_OUTPUT_FILENAME }}" + asset_name: "SBOM for ${{ steps.build_vars.outputs.OUTPUT_IMAGE_NAME }}.spdx.json" + tag: "${{ needs.normalize-inputs.outputs.release_tag }}" + overwrite: true + + - name: Move cache ♻️ + run: | + rm -rf /tmp/.buildx-cache + if [ -f /tmp/.buildx-cache-new ] + then { + mv /tmp/.buildx-cache-new /tmp/.buildx-cache + } + fi diff --git a/Dockerfile b/Dockerfile index 5731461..a14fcef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,7 @@ COPY --chmod=0755 [\ RUN ./install_sysdeps.sh ${DESTINATION_IMAGE_NAME} -COPY --chmod=0755 init /init +COPY --chmod=0755 init-vscode /init-vscode COPY config/vs-code-config.yaml /root/.config/code-server/config.yaml WORKDIR / diff --git a/init b/init-vscode similarity index 86% rename from init rename to init-vscode index ca14863..1670df0 100644 --- a/init +++ b/init-vscode @@ -1,6 +1,6 @@ #!/usr/bin/bash -echo "Start Visual Studio Code server" +echo "Starting Visual Studio Code server" code-server \ --bind-addr 0.0.0.0:8081 \ --auth none \ diff --git a/scripts/install_sysdeps.sh b/scripts/install_sysdeps.sh index 406028a..9f16cf2 100644 --- a/scripts/install_sysdeps.sh +++ b/scripts/install_sysdeps.sh @@ -40,9 +40,10 @@ wget -q "${QUARTO_DL_URL}" -O quarto-"${ARCH}".deb dpkg -i quarto-"${ARCH}".deb quarto check install -if [ "$distribution" == "julia-vscode" ]; then +if [ "$destination_image_name" == "julia-vscode" ]; then # Install VS Code server. wget --no-check-certificate https://code-server.dev/install.sh -O - | sh + cp /init-vscode /init fi # Install security patches @@ -55,3 +56,11 @@ rm -rf /var/lib/apt/lists/* quarto-"${ARCH}".deb echo "LC_ALL=$LC_ALL" >> /etc/profile echo "PATH=$PATH" >> /etc/profile + +# Set default initializer if unavailable +if [ ! -f /init ] +then { + echo "sh" > /init + chmod +x /init +} +fi