From cc14969566c7bdc6b7fa9c2b957f33148edfb788 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Wed, 22 May 2024 11:10:45 +0100 Subject: [PATCH 1/5] chore: replace prettier with dockfmt and markdownfmt --- .github/workflows/build.yaml | 13 +- .husky/pre-commit | 21 -- .prettierignore | 2 - .prettierrc | 11 - go.mod | 22 ++ go.sum | 53 +++++ scripts/check_unstaged.sh | 28 +++ scripts/fmt.sh | 19 ++ scripts/lib.sh | 17 +- tools/tools.go | 6 + yarn.lock | 380 ----------------------------------- 11 files changed, 144 insertions(+), 428 deletions(-) delete mode 100755 .husky/pre-commit delete mode 100644 .prettierignore delete mode 100644 .prettierrc create mode 100644 go.mod create mode 100644 go.sum create mode 100755 scripts/check_unstaged.sh create mode 100755 scripts/fmt.sh create mode 100644 tools/tools.go delete mode 100644 yarn.lock diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fe05eef..5ed065b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -49,16 +49,11 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: 20.x - - - name: Install Node.js modules - run: yarn install - - name: Check formatting - run: yarn format:check + run: ./scripts/fmt.sh + + - name: Check for unstaged files + run: ./scripts/check_unstaged.sh images: runs-on: ubuntu-latest diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index d3ebcc4..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -# The ./_/husky.sh script always runs this script using "sh" in order -# to try to capture the exit code. This means that bash-isms can cause -# an error message. Some distros, such as Arch, use bash for /bin/sh, -# so do not experience this problem, but this is non-standard and -# Debian-based distributions (including Ubuntu) use dash for /bin/sh. -# -# We work around this by detecting whether we are running under Bash, -# by looking for the BASH environment variable, and replacing the -# current script with a version under Bash by using exec. For details, -# see https://github.com/typicode/husky/issues/971. -if [ -z "${BASH:-}" ]; then - exec bash "$0" "$@" -fi - -source "$(dirname "$0")/_/husky.sh" - -set -euo pipefail - -yarn lint-staged diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 438d234..0000000 --- a/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -LICENSE.md \ No newline at end of file diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 5ae4f03..0000000 --- a/.prettierrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "overrides": [ - { - "files": "*.md", - "options": { - "printWidth": 80, - "proseWrap": "always" - } - } - ] -} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..6bdcf03 --- /dev/null +++ b/go.mod @@ -0,0 +1,22 @@ +module github.com/coder/enterprise-images + +go 1.21.9 + +require ( + github.com/jessfraz/dockfmt v0.3.3 + github.com/shurcooL/markdownfmt v0.0.0-20231025213440-c8f16ef0855c +) + +require ( + github.com/genuinetools/pkg v0.0.0-20180717194616-e057fa50f234 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/moby/buildkit v0.0.0-20180717184648-628681f8e4aa // indirect + github.com/pkg/errors v0.8.0 // indirect + github.com/rivo/uniseg v0.2.0 // indirect + github.com/russross/blackfriday v1.6.0 // indirect + github.com/shurcooL/go v0.0.0-20230706063926-5fe729b41b3a // indirect + github.com/sirupsen/logrus v1.0.5 // indirect + golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/term v0.20.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..c11d746 --- /dev/null +++ b/go.sum @@ -0,0 +1,53 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/genuinetools/pkg v0.0.0-20180717194616-e057fa50f234 h1:L2iPmw7g5RrLTcQBCnPlcR8tH6011yzWJEo9Ul6jIiU= +github.com/genuinetools/pkg v0.0.0-20180717194616-e057fa50f234/go.mod h1:XTcrCYlXPxnxL2UpnwuRn7tcaTn9HAhxFoFJucootk8= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/jessfraz/dockfmt v0.3.3 h1:XzNCOm52iDL+XABarHfVZ1zuWZ4Z0F2ZlDVQnuEtNsI= +github.com/jessfraz/dockfmt v0.3.3/go.mod h1:GDuy5ygGs5T1f6CU8bhv3YpQOPFbeJIsOrMreYFiXqg= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/moby/buildkit v0.0.0-20180717184648-628681f8e4aa h1:Poc8CoewEI7RYtF2tIwUAZS6660JOhCG5FIe+D7V9aI= +github.com/moby/buildkit v0.0.0-20180717184648-628681f8e4aa/go.mod h1:nnELdKPRkUAQR6pAB3mRU3+IlbqL3SSaAWqQL8k/K+4= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= +github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= +github.com/shurcooL/go v0.0.0-20230706063926-5fe729b41b3a h1:ZHfoO7ZJhws9NU1kzZhStUnnVQiPtDe1PzpUnc6HirU= +github.com/shurcooL/go v0.0.0-20230706063926-5fe729b41b3a/go.mod h1:DNrlr0AR9NsHD/aoc2pPeu4uSBZ/71yCHkR42yrzW3M= +github.com/shurcooL/markdownfmt v0.0.0-20231025213440-c8f16ef0855c h1:KLm70ZxJF9Zmi4Mcn96Ni9yELJDiwOkDZK25YO6ZGlA= +github.com/shurcooL/markdownfmt v0.0.0-20231025213440-c8f16ef0855c/go.mod h1:Y3QM23ahLei1QaMBScz4YZbWktsBlf2A2DT2Yw2Ts68= +github.com/sirupsen/logrus v1.0.5 h1:8c8b5uO0zS4X6RPl/sd1ENwSkIc0/H2PaHxE3udaE8I= +github.com/sirupsen/logrus v1.0.5/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8 h1:h7zdf0RiEvWbYBKIx4b+q41xoUVnMmvsGZnIVE5syG8= +golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo= +gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 h1:OAj3g0cR6Dx/R07QgQe8wkA9RNjB2u4i700xBkIT4e0= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gotest.tools v2.1.0+incompatible h1:5USw7CrJBYKqjg9R7QlA6jzqZKEAtvW82aNmsxxGPxw= +gotest.tools v2.1.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= diff --git a/scripts/check_unstaged.sh b/scripts/check_unstaged.sh new file mode 100755 index 0000000..a6de5f0 --- /dev/null +++ b/scripts/check_unstaged.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -euo pipefail +# shellcheck source=scripts/lib.sh +source "$(dirname "${BASH_SOURCE[0]}")/lib.sh" +cdroot + +FILES="$(git ls-files --other --modified --exclude-standard)" +if [[ "$FILES" != "" ]]; then + mapfile -t files <<<"$FILES" + + log + log "The following files contain unstaged changes:" + log + for file in "${files[@]}"; do + log " - $file" + done + + log + log "These are the changes:" + log + for file in "${files[@]}"; do + git --no-pager diff "$file" 1>&2 + done + + log + error "Unstaged changes, see above for details." +fi diff --git a/scripts/fmt.sh b/scripts/fmt.sh new file mode 100755 index 0000000..76dc2b6 --- /dev/null +++ b/scripts/fmt.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -euo pipefail + +# shellcheck source=scripts/lib.sh +source "$(dirname "${BASH_SOURCE[0]}")/lib.sh" +cdroot + +log "Fetching Dependencies" +go mod download + +log "Formatting Markdown..." +go run github.com/shurcooL/markdownfmt@latest -w . + +log "Formatting Dockerfiles..." +for dockerfile in $(find ./images -iname 'Dockerfile.*'); do + log "${dockerfile}" + go run github.com/jessfraz/dockfmt@latest fmt -w "${dockerfile}" +done \ No newline at end of file diff --git a/scripts/lib.sh b/scripts/lib.sh index 7c4e2a0..1f8e26f 100644 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -2,6 +2,16 @@ set -euo pipefail +# cdroot changes directory to the root of the repository. +cdroot() { + cd $(git rev-parse --show-toplevel) +} + +# log prints a message to stderr. +log() { + echo "$*" 1>&2 +} + # Emit a message to stderr and exit. # # This prints the arguments to stderr before exiting. @@ -10,11 +20,8 @@ set -euo pipefail # error "Missing flag abc" # program-failure-info | error function error() { - set +x - echo - echo "$@" "$(cat)" >&2 - echo - exit 1 + log "ERROR: $*" + exit 1 } # Check if dependencies are available. diff --git a/tools/tools.go b/tools/tools.go new file mode 100644 index 0000000..dee0e1f --- /dev/null +++ b/tools/tools.go @@ -0,0 +1,6 @@ +package tools + +import ( + _ "github.com/jessfraz/dockfmt" + _ "github.com/shurcooL/markdownfmt" +) diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index 563fff3..0000000 --- a/yarn.lock +++ /dev/null @@ -1,380 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -ansi-escapes@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-6.2.0.tgz#8a13ce75286f417f1963487d86ba9f90dccf9947" - integrity sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw== - dependencies: - type-fest "^3.0.0" - -ansi-regex@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" - integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== - -ansi-styles@^6.0.0, ansi-styles@^6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" - integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== - -braces@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -chalk@5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" - integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== - -cli-cursor@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-4.0.0.tgz#3cecfe3734bf4fe02a8361cbdc0f6fe28c6a57ea" - integrity sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg== - dependencies: - restore-cursor "^4.0.0" - -cli-truncate@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-4.0.0.tgz#6cc28a2924fee9e25ce91e973db56c7066e6172a" - integrity sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA== - dependencies: - slice-ansi "^5.0.0" - string-width "^7.0.0" - -colorette@^2.0.20: - version "2.0.20" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" - integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== - -commander@11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906" - integrity sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ== - -cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -debug@4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -emoji-regex@^10.3.0: - version "10.3.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.3.0.tgz#76998b9268409eb3dae3de989254d456e70cfe23" - integrity sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw== - -eventemitter3@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" - integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== - -execa@8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-8.0.1.tgz#51f6a5943b580f963c3ca9c6321796db8cc39b8c" - integrity sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^8.0.1" - human-signals "^5.0.0" - is-stream "^3.0.0" - merge-stream "^2.0.0" - npm-run-path "^5.1.0" - onetime "^6.0.0" - signal-exit "^4.1.0" - strip-final-newline "^3.0.0" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -get-east-asian-width@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz#5e6ebd9baee6fb8b7b6bd505221065f0cd91f64e" - integrity sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA== - -get-stream@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-8.0.1.tgz#def9dfd71742cd7754a7761ed43749a27d02eca2" - integrity sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA== - -human-signals@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" - integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== - -husky@9.0.11: - version "9.0.11" - resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.11.tgz#fc91df4c756050de41b3e478b2158b87c1e79af9" - integrity sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw== - -is-fullwidth-code-point@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz#fae3167c729e7463f8461ce512b080a49268aa88" - integrity sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ== - -is-fullwidth-code-point@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz#9609efced7c2f97da7b60145ef481c787c7ba704" - integrity sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA== - dependencies: - get-east-asian-width "^1.0.0" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-3.0.0.tgz#e6bfd7aa6bef69f4f472ce9bb681e3e57b4319ac" - integrity sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -lilconfig@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.0.0.tgz#f8067feb033b5b74dab4602a5f5029420be749bc" - integrity sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g== - -lint-staged@15.2.2: - version "15.2.2" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.2.2.tgz#ad7cbb5b3ab70e043fa05bff82a09ed286bc4c5f" - integrity sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw== - dependencies: - chalk "5.3.0" - commander "11.1.0" - debug "4.3.4" - execa "8.0.1" - lilconfig "3.0.0" - listr2 "8.0.1" - micromatch "4.0.5" - pidtree "0.6.0" - string-argv "0.3.2" - yaml "2.3.4" - -listr2@8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-8.0.1.tgz#4d3f50ae6cec3c62bdf0e94f5c2c9edebd4b9c34" - integrity sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA== - dependencies: - cli-truncate "^4.0.0" - colorette "^2.0.20" - eventemitter3 "^5.0.1" - log-update "^6.0.0" - rfdc "^1.3.0" - wrap-ansi "^9.0.0" - -log-update@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-6.0.0.tgz#0ddeb7ac6ad658c944c1de902993fce7c33f5e59" - integrity sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw== - dependencies: - ansi-escapes "^6.2.0" - cli-cursor "^4.0.0" - slice-ansi "^7.0.0" - strip-ansi "^7.1.0" - wrap-ansi "^9.0.0" - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -micromatch@4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -mimic-fn@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" - integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -npm-run-path@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-5.1.0.tgz#bc62f7f3f6952d9894bd08944ba011a6ee7b7e00" - integrity sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q== - dependencies: - path-key "^4.0.0" - -onetime@^5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -onetime@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-6.0.0.tgz#7c24c18ed1fd2e9bca4bd26806a33613c77d34b4" - integrity sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ== - dependencies: - mimic-fn "^4.0.0" - -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-key@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-4.0.0.tgz#295588dc3aee64154f877adb9d780b81c554bf18" - integrity sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ== - -picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -pidtree@0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" - integrity sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g== - -prettier@3.2.5: - version "3.2.5" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" - integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== - -restore-cursor@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-4.0.0.tgz#519560a4318975096def6e609d44100edaa4ccb9" - integrity sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg== - dependencies: - onetime "^5.1.0" - signal-exit "^3.0.2" - -rfdc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" - integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -signal-exit@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== - -signal-exit@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" - integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== - -slice-ansi@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-5.0.0.tgz#b73063c57aa96f9cd881654b15294d95d285c42a" - integrity sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ== - dependencies: - ansi-styles "^6.0.0" - is-fullwidth-code-point "^4.0.0" - -slice-ansi@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-7.1.0.tgz#cd6b4655e298a8d1bdeb04250a433094b347b9a9" - integrity sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg== - dependencies: - ansi-styles "^6.2.1" - is-fullwidth-code-point "^5.0.0" - -string-argv@0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" - integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== - -string-width@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-7.0.0.tgz#14aa1b7aaa126d5b64fa79d3c894da8a9650ba06" - integrity sha512-GPQHj7row82Hjo9hKZieKcHIhaAIKOJvFSIZXuCU9OASVZrMNUaZuz++SPVrBjnLsnk4k+z9f2EIypgxf2vNFw== - dependencies: - emoji-regex "^10.3.0" - get-east-asian-width "^1.0.0" - strip-ansi "^7.1.0" - -strip-ansi@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" - integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== - dependencies: - ansi-regex "^6.0.1" - -strip-final-newline@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz#52894c313fbff318835280aed60ff71ebf12b8fd" - integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -type-fest@^3.0.0: - version "3.13.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-3.13.1.tgz#bb744c1f0678bea7543a2d1ec24e83e68e8c8706" - integrity sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g== - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wrap-ansi@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-9.0.0.tgz#1a3dc8b70d85eeb8398ddfb1e4a02cd186e58b3e" - integrity sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q== - dependencies: - ansi-styles "^6.2.1" - string-width "^7.0.0" - strip-ansi "^7.1.0" - -yaml@2.3.4: - version "2.3.4" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2" - integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA== From a4bb09e5d826a851f6193adb22245dc11f0a99d1 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Wed, 22 May 2024 20:56:12 +0100 Subject: [PATCH 2/5] replace dockfmt/markdowmfmt with dprint and shfmt --- .github/CONTRIBUTING.md | 2 +- .github/workflows/build.yaml | 5 +- README.md | 2 +- dprint.json | 13 +++++ go.mod | 22 -------- go.sum | 53 ------------------- .../{Dockerfile.ubuntu => ubuntu.Dockerfile} | 6 +-- .../{Dockerfile.ubuntu => ubuntu.Dockerfile} | 4 +- scripts/build_images.sh | 2 +- scripts/fmt.sh | 13 ++--- scripts/push_images.sh | 2 +- tools/tools.go | 6 --- 12 files changed, 26 insertions(+), 104 deletions(-) create mode 100644 dprint.json delete mode 100644 go.mod delete mode 100644 go.sum rename images/base/{Dockerfile.ubuntu => ubuntu.Dockerfile} (93%) rename images/minimal/{Dockerfile.ubuntu => ubuntu.Dockerfile} (87%) delete mode 100644 tools/tools.go diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 0b1a3b2..ddf2a1f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -2,7 +2,7 @@ To add a new image, create a new folder in `images/` with the name of the image, and create at least one `Dockerfile` for it, using an extension as the tag. For -instance, an Ubuntu-based version of your image would be in `Dockerfile.ubuntu`. +instance, an Ubuntu-based version of your image would be in `ubuntu.Dockerfile`. New images should extend from existing images whenever possible, e.g. diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5ed065b..70033b9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -50,10 +50,7 @@ jobs: uses: actions/checkout@v4 - name: Check formatting - run: ./scripts/fmt.sh - - - name: Check for unstaged files - run: ./scripts/check_unstaged.sh + uses: dprint/check@v2.2 images: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 45c0218..a9f31ea 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This repository contains example images for use with [Coder](https://coder.com/d Each of these images is also published to Docker Hub under the `codercom/enterprise-[name]` repository. For example, `base` is available at https://hub.docker.com/r/codercom/enterprise-base. The tag is taken from the -file extension of the Dockerfile. For example, `base/Dockerfile.ubuntu` is +filename of the Dockerfile. For example, `base/ubuntu.Dockerfile` is under the `ubuntu` tag. ## Contributing diff --git a/dprint.json b/dprint.json new file mode 100644 index 0000000..4ef57b3 --- /dev/null +++ b/dprint.json @@ -0,0 +1,13 @@ +{ + "markdown": { + }, + "dockerfile": { + }, + "excludes": [ + "deprecated/*" + ], + "plugins": [ + "https://plugins.dprint.dev/markdown-0.17.0.wasm", + "https://plugins.dprint.dev/dockerfile-0.3.0.wasm" + ] +} diff --git a/go.mod b/go.mod deleted file mode 100644 index 6bdcf03..0000000 --- a/go.mod +++ /dev/null @@ -1,22 +0,0 @@ -module github.com/coder/enterprise-images - -go 1.21.9 - -require ( - github.com/jessfraz/dockfmt v0.3.3 - github.com/shurcooL/markdownfmt v0.0.0-20231025213440-c8f16ef0855c -) - -require ( - github.com/genuinetools/pkg v0.0.0-20180717194616-e057fa50f234 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/moby/buildkit v0.0.0-20180717184648-628681f8e4aa // indirect - github.com/pkg/errors v0.8.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect - github.com/russross/blackfriday v1.6.0 // indirect - github.com/shurcooL/go v0.0.0-20230706063926-5fe729b41b3a // indirect - github.com/sirupsen/logrus v1.0.5 // indirect - golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/term v0.20.0 // indirect -) diff --git a/go.sum b/go.sum deleted file mode 100644 index c11d746..0000000 --- a/go.sum +++ /dev/null @@ -1,53 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/genuinetools/pkg v0.0.0-20180717194616-e057fa50f234 h1:L2iPmw7g5RrLTcQBCnPlcR8tH6011yzWJEo9Ul6jIiU= -github.com/genuinetools/pkg v0.0.0-20180717194616-e057fa50f234/go.mod h1:XTcrCYlXPxnxL2UpnwuRn7tcaTn9HAhxFoFJucootk8= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/jessfraz/dockfmt v0.3.3 h1:XzNCOm52iDL+XABarHfVZ1zuWZ4Z0F2ZlDVQnuEtNsI= -github.com/jessfraz/dockfmt v0.3.3/go.mod h1:GDuy5ygGs5T1f6CU8bhv3YpQOPFbeJIsOrMreYFiXqg= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/moby/buildkit v0.0.0-20180717184648-628681f8e4aa h1:Poc8CoewEI7RYtF2tIwUAZS6660JOhCG5FIe+D7V9aI= -github.com/moby/buildkit v0.0.0-20180717184648-628681f8e4aa/go.mod h1:nnELdKPRkUAQR6pAB3mRU3+IlbqL3SSaAWqQL8k/K+4= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= -github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= -github.com/shurcooL/go v0.0.0-20230706063926-5fe729b41b3a h1:ZHfoO7ZJhws9NU1kzZhStUnnVQiPtDe1PzpUnc6HirU= -github.com/shurcooL/go v0.0.0-20230706063926-5fe729b41b3a/go.mod h1:DNrlr0AR9NsHD/aoc2pPeu4uSBZ/71yCHkR42yrzW3M= -github.com/shurcooL/markdownfmt v0.0.0-20231025213440-c8f16ef0855c h1:KLm70ZxJF9Zmi4Mcn96Ni9yELJDiwOkDZK25YO6ZGlA= -github.com/shurcooL/markdownfmt v0.0.0-20231025213440-c8f16ef0855c/go.mod h1:Y3QM23ahLei1QaMBScz4YZbWktsBlf2A2DT2Yw2Ts68= -github.com/sirupsen/logrus v1.0.5 h1:8c8b5uO0zS4X6RPl/sd1ENwSkIc0/H2PaHxE3udaE8I= -github.com/sirupsen/logrus v1.0.5/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8 h1:h7zdf0RiEvWbYBKIx4b+q41xoUVnMmvsGZnIVE5syG8= -golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 h1:OAj3g0cR6Dx/R07QgQe8wkA9RNjB2u4i700xBkIT4e0= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gotest.tools v2.1.0+incompatible h1:5USw7CrJBYKqjg9R7QlA6jzqZKEAtvW82aNmsxxGPxw= -gotest.tools v2.1.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= diff --git a/images/base/Dockerfile.ubuntu b/images/base/ubuntu.Dockerfile similarity index 93% rename from images/base/Dockerfile.ubuntu rename to images/base/ubuntu.Dockerfile index b4a2548..fa7893b 100644 --- a/images/base/Dockerfile.ubuntu +++ b/images/base/ubuntu.Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:22.04 SHELL ["/bin/bash", "-c"] -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive # Install the Docker apt repository RUN apt-get update && \ @@ -37,7 +37,7 @@ RUN apt-get update && \ vim \ wget \ rsync && \ - # Install latest Git using their official PPA +# Install latest Git using their official PPA add-apt-repository ppa:git-core/ppa && \ apt-get install --yes git \ && rm -rf /var/lib/apt/lists/* @@ -49,7 +49,7 @@ RUN systemctl enable docker RUN ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose # Make typing unicode characters in the terminal work. -ENV LANG en_US.UTF-8 +ENV LANG=en_US.UTF-8 # Add a user `coder` so that you're not developing as the `root` user RUN useradd coder \ diff --git a/images/minimal/Dockerfile.ubuntu b/images/minimal/ubuntu.Dockerfile similarity index 87% rename from images/minimal/Dockerfile.ubuntu rename to images/minimal/ubuntu.Dockerfile index 56047f8..7baf4e9 100644 --- a/images/minimal/Dockerfile.ubuntu +++ b/images/minimal/ubuntu.Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:22.04 USER root -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y --no-install-recommends \ bash \ @@ -19,5 +19,5 @@ RUN useradd coder \ --user-group && \ echo "coder ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers.d/nopasswd -ENV LANG en_US.UTF-8 +ENV LANG=en_US.UTF-8 USER coder diff --git a/scripts/build_images.sh b/scripts/build_images.sh index 846e412..2033375 100755 --- a/scripts/build_images.sh +++ b/scripts/build_images.sh @@ -90,7 +90,7 @@ fi for image in "${IMAGES[@]}"; do image_dir="$PROJECT_ROOT/images/$image" - image_file="Dockerfile.$TAG" + image_file="${TAG}.Dockerfile" image_ref="codercom/enterprise-$image:$TAG" image_path="$image_dir/$image_file" diff --git a/scripts/fmt.sh b/scripts/fmt.sh index 76dc2b6..f35c02e 100755 --- a/scripts/fmt.sh +++ b/scripts/fmt.sh @@ -6,14 +6,7 @@ set -euo pipefail source "$(dirname "${BASH_SOURCE[0]}")/lib.sh" cdroot -log "Fetching Dependencies" -go mod download +check_dependencies dprint shfmt -log "Formatting Markdown..." -go run github.com/shurcooL/markdownfmt@latest -w . - -log "Formatting Dockerfiles..." -for dockerfile in $(find ./images -iname 'Dockerfile.*'); do - log "${dockerfile}" - go run github.com/jessfraz/dockfmt@latest fmt -w "${dockerfile}" -done \ No newline at end of file +dprint fmt +shfmt . >/dev/null 2>&1 diff --git a/scripts/push_images.sh b/scripts/push_images.sh index 4df22d1..fa392ba 100755 --- a/scripts/push_images.sh +++ b/scripts/push_images.sh @@ -90,7 +90,7 @@ fi for image in "${IMAGES[@]}"; do image_dir="$PROJECT_ROOT/images/$image" - image_file="Dockerfile.$TAG" + image_file="${TAG}.Dockerfile" image_ref="codercom/enterprise-$image:$TAG" image_path="$image_dir/$image_file" diff --git a/tools/tools.go b/tools/tools.go deleted file mode 100644 index dee0e1f..0000000 --- a/tools/tools.go +++ /dev/null @@ -1,6 +0,0 @@ -package tools - -import ( - _ "github.com/jessfraz/dockfmt" - _ "github.com/shurcooL/markdownfmt" -) From aaad2dbca851a00c343a58550050440cbbc956d1 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Wed, 22 May 2024 20:57:40 +0100 Subject: [PATCH 3/5] fmt --- README.md | 2 +- changelog.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a9f31ea..0a83051 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repository contains example images for use with [Coder](https://coder.com/d - `enterprise-base`: Contains an example image that can be used as a base for other images. -- `enterprise-minimal`: Contains a minimal image that contians only the required +- `enterprise-minimal`: Contains a minimal image that contians only the required utilities for a Coder workspace to bootstrap successfully. ## Images on Docker Hub diff --git a/changelog.md b/changelog.md index b19b400..e21083a 100644 --- a/changelog.md +++ b/changelog.md @@ -2,5 +2,5 @@ ## BREAKING 02/15/2023 -- Due to low usage, removed support for CentOS base images. -- Due to excessive vulnerabilities removed `brew` from Ubuntu images. +- Due to low usage, removed support for CentOS base images. +- Due to excessive vulnerabilities removed `brew` from Ubuntu images. From 6f85d965dd931eb1e719ce98ef9251bdab38c863 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Wed, 22 May 2024 21:00:29 +0100 Subject: [PATCH 4/5] bump From e77747c2f98ef052cd1d11c7537e75b52a8de7bb Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Thu, 23 May 2024 10:51:32 +0100 Subject: [PATCH 5/5] rm unused check_unstaged.sh --- scripts/check_unstaged.sh | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100755 scripts/check_unstaged.sh diff --git a/scripts/check_unstaged.sh b/scripts/check_unstaged.sh deleted file mode 100755 index a6de5f0..0000000 --- a/scripts/check_unstaged.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -set -euo pipefail -# shellcheck source=scripts/lib.sh -source "$(dirname "${BASH_SOURCE[0]}")/lib.sh" -cdroot - -FILES="$(git ls-files --other --modified --exclude-standard)" -if [[ "$FILES" != "" ]]; then - mapfile -t files <<<"$FILES" - - log - log "The following files contain unstaged changes:" - log - for file in "${files[@]}"; do - log " - $file" - done - - log - log "These are the changes:" - log - for file in "${files[@]}"; do - git --no-pager diff "$file" 1>&2 - done - - log - error "Unstaged changes, see above for details." -fi