-
Notifications
You must be signed in to change notification settings - Fork 36
RFC: use Nickel to generate Dockerfiles #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,39 +1,30 @@ | ||
| name: Dockerfile Generator | ||
| name: Dockerfile Validator | ||
| on: | ||
| push: | ||
| paths: | ||
| - generator | ||
| - '**/*.ncl' | ||
| - 'template/Dockerfile.ncl' | ||
| - 'generate.sh' | ||
| - '.github/workflows/generator.yml' | ||
| workflow_dispatch: | ||
| inputs: | ||
| debug_mode: | ||
| description: 'Enable debug mode' | ||
| type: boolean | ||
| default: false | ||
| required: false | ||
|
|
||
| jobs: | ||
| build: | ||
| generate: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v5.0.0 | ||
| - uses: ./.github/actions/build-generator | ||
| # with: | ||
| # debug_mode: ${{ github.event.inputs.debug_mode }} | ||
| - name: Run generator | ||
| working-directory: generator | ||
| run: stack exec generator -- --help | ||
| - uses: actions/checkout@v6.0.2 | ||
| - name: Install Nickel | ||
| uses: cachix/install-nix-action@v31.10.5 | ||
|
|
||
| - name: Copy generator binary to artifacts | ||
| working-directory: generator | ||
| - name: Install nickel binary | ||
| run: nix profile install nixpkgs#nickel | ||
|
|
||
| - name: Generate Dockerfiles | ||
| run: | | ||
| mkdir -p ../artifacts | ||
| stack --local-bin-path=../artifacts install | ||
| - name: Upload generated artifact to a release | ||
| uses: softprops/action-gh-release@v2.4.1 | ||
| with: | ||
| name: Generator | ||
| tag_name: generator-binary | ||
| prerelease: true | ||
| overwrite_files: 'true' | ||
| files: | | ||
| artifacts/generator | ||
| for f in $(find . -name '*.ncl' -not -name '_*'); do | ||
| echo "Generating Dockerfile for $basename" | ||
| ./generate.sh $f "$(basename $f .ncl)/Dockerfile" | ||
| done | ||
|
|
||
| - name: Verify no diff after generation | ||
| run: git diff --exit-code | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| generator/.stack-work | ||
| generator/dist-newstyle | ||
| /.idea | ||
|
|
||
| keys/* | ||
|
|
||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| stack = { | ||
| version = "3.3.1", | ||
| release_key = "C5705533DA4F78D8664B5DC0575159689BEFB442", | ||
| assets = { | ||
| aarch64 = { sha256sum = "bdd618ea5a9c921417727011f2ecd78987dffa5cee5e741108baf65a9b5b58ab" }, | ||
| x86_64 = { sha256sum = "88d7e517342c125b0a098d9d578fe53e590618ae4b2427283a27408a1ebd06d8" }, | ||
| }, | ||
| }, | ||
| cabal_install = { | ||
| version = "3.14.1.1", | ||
| release_key = "EAF2A9A722C0C96F2B431CA511AAD8CEDEE0CAEF", | ||
| }, | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| let globals = import "_globals.ncl" | ||
| in | ||
| globals | ||
| & { | ||
| distro = { | ||
| codename = "bookworm", | ||
| abbr = "deb12", | ||
| image = "debian:bookworm", | ||
| }, | ||
| ghc = { | ||
| version = "9.10.3", | ||
| release_key = "88B57FCF7DB53B4DB3BFA4B1588764FBE22D19C4", | ||
| assets = { | ||
| aarch64 = { | ||
| sha256sum = "052789dfe7f6fba6dc3822de0da272e8a5bd358c37adae17d8e82cff39bc1008", | ||
| url = "https://downloads.haskell.org/~ghc/9.10.3/ghc-9.10.3-aarch64-deb11-linux.tar.xz", | ||
| }, | ||
| x86_64 = { sha256sum = "1ac63f04eac0ad551d45cbde38f27e0e3f43ceefd98833fae1fa3f2dbd042367" }, | ||
| }, | ||
| }, | ||
| cabal_install = { | ||
| assets = { | ||
| aarch64 = { sha256sum = "f763fb2af2bc1ff174b7361a7d51109a585954f87a0e14f86d144f3bce28f7a9" }, | ||
| x86_64 = { sha256sum = "73a463306c771e18ca22c0a9469176ffab0138ec5925adb5364ef47174e1adc5" }, | ||
| }, | ||
| }, | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| let globals = import "_globals.ncl" | ||
| in | ||
| globals | ||
| & { | ||
| distro = { | ||
| codename = "bullseye", | ||
| abbr = "deb11", | ||
| image = "debian:bullseye", | ||
| }, | ||
| ghc = { | ||
| version = "9.10.3", | ||
| release_key = "88B57FCF7DB53B4DB3BFA4B1588764FBE22D19C4", | ||
| assets = { | ||
| aarch64 = { sha256sum = "052789dfe7f6fba6dc3822de0da272e8a5bd358c37adae17d8e82cff39bc1008" }, | ||
| x86_64 = { sha256sum = "b6bbd3514e0cdb9db350812a003bb7c670c58d99779086fbe41092b019548924" }, | ||
| }, | ||
| }, | ||
| cabal_install = { | ||
| assets = { | ||
| aarch64 = { sha256sum = "5e8c47a055d5b744741039a7061ee43ec7d080d1251784e7a4cd836403e42523" }, | ||
| x86_64 = { sha256sum = "41b85bb25fa654e4b79169014b9142fe696ff35e002e043caa0e52d65204ba8a" }, | ||
| }, | ||
| }, | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| let globals = import "_globals.ncl" | ||
| in | ||
| globals | ||
| & { | ||
| distro = { | ||
| codename = "bookworm", | ||
| abbr = "deb12", | ||
| image = "debian:bookworm-slim", | ||
| }, | ||
| ghc = { | ||
| version = "9.10.3", | ||
| release_key = "88B57FCF7DB53B4DB3BFA4B1588764FBE22D19C4", | ||
| assets = { | ||
| aarch64 = { | ||
| sha256sum = "052789dfe7f6fba6dc3822de0da272e8a5bd358c37adae17d8e82cff39bc1008", | ||
| url = "https://downloads.haskell.org/~ghc/9.10.3/ghc-9.10.3-aarch64-deb11-linux.tar.xz", | ||
| }, | ||
| x86_64 = { sha256sum = "1ac63f04eac0ad551d45cbde38f27e0e3f43ceefd98833fae1fa3f2dbd042367" }, | ||
| }, | ||
| }, | ||
| cabal_install = { | ||
| assets = { | ||
| aarch64 = { sha256sum = "f763fb2af2bc1ff174b7361a7d51109a585954f87a0e14f86d144f3bce28f7a9" }, | ||
| x86_64 = { sha256sum = "73a463306c771e18ca22c0a9469176ffab0138ec5925adb5364ef47174e1adc5" }, | ||
| }, | ||
| }, | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| let globals = import "_globals.ncl" | ||
| in | ||
| globals | ||
| & { | ||
| distro = { | ||
| codename = "bullseye", | ||
| abbr = "deb11", | ||
| image = "debian:bullseye-slim", | ||
| }, | ||
| ghc = { | ||
| version = "9.10.3", | ||
| release_key = "88B57FCF7DB53B4DB3BFA4B1588764FBE22D19C4", | ||
| assets = { | ||
| aarch64 = { sha256sum = "052789dfe7f6fba6dc3822de0da272e8a5bd358c37adae17d8e82cff39bc1008" }, | ||
| x86_64 = { sha256sum = "b6bbd3514e0cdb9db350812a003bb7c670c58d99779086fbe41092b019548924" }, | ||
| }, | ||
| }, | ||
| cabal_install = { | ||
| assets = { | ||
| aarch64 = { sha256sum = "5e8c47a055d5b744741039a7061ee43ec7d080d1251784e7a4cd836403e42523" }, | ||
| x86_64 = { sha256sum = "41b85bb25fa654e4b79169014b9142fe696ff35e002e043caa0e52d65204ba8a" }, | ||
| }, | ||
| }, | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| stack = { | ||
| version = "3.3.1", | ||
| release_key = "C5705533DA4F78D8664B5DC0575159689BEFB442", | ||
| assets = { | ||
| aarch64 = { sha256sum = "bdd618ea5a9c921417727011f2ecd78987dffa5cee5e741108baf65a9b5b58ab" }, | ||
| x86_64 = { sha256sum = "88d7e517342c125b0a098d9d578fe53e590618ae4b2427283a27408a1ebd06d8" }, | ||
| }, | ||
| }, | ||
| cabal_install = { | ||
| version = "3.14.1.1", | ||
| release_key = "EAF2A9A722C0C96F2B431CA511AAD8CEDEE0CAEF", | ||
| }, | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| let globals = import "_globals.ncl" | ||
| in | ||
| globals | ||
| & { | ||
| distro = { | ||
| codename = "bookworm", | ||
| abbr = "deb12", | ||
| image = "debian:bookworm", | ||
| }, | ||
| ghc = { | ||
| version = "9.12.4", | ||
| release_key = "88B57FCF7DB53B4DB3BFA4B1588764FBE22D19C4", | ||
| assets = { | ||
| aarch64 = { sha256sum = "8d093562f4d54b69fc57f94c021138d8595554407bc2828962cf6bdd394a6c97" }, | ||
| x86_64 = { sha256sum = "cdc60a66f1c89604975c896b3c7577b079b602d8fb093af0f4b2b0912fa47bd1" }, | ||
| }, | ||
| }, | ||
| cabal_install = { | ||
| assets = { | ||
| aarch64 = { sha256sum = "f763fb2af2bc1ff174b7361a7d51109a585954f87a0e14f86d144f3bce28f7a9" }, | ||
| x86_64 = { sha256sum = "73a463306c771e18ca22c0a9469176ffab0138ec5925adb5364ef47174e1adc5" }, | ||
| }, | ||
| }, | ||
| } |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't match the filename nor the job name...