golang.org/x/build@v0.0.0-20240506185731-218518f32b70/cmd/relui/README.md (about)

     1  # golang.org/x/build/cmd/relui
     2  
     3  ```
     4                 ▀▀█             ▀
     5    ▄ ▄▄   ▄▄▄     █    ▄   ▄  ▄▄▄
     6    █▀  ▀ █▀  █    █    █   █    █
     7    █     █▀▀▀▀    █    █   █    █
     8    █     ▀█▄▄▀    ▀▄▄  ▀▄▄▀█  ▄▄█▄▄
     9  ```
    10  
    11  relui is a web interface for managing the release process of Go.
    12  
    13  ## Development
    14  
    15  Run the command with the appropriate
    16  [libpq-style environment variables](https://www.postgresql.org/docs/current/libpq-envars.html)
    17  set.
    18  
    19  ```bash
    20  PGHOST=localhost PGDATABASE=relui-dev PGUSER=postgres go run . -listen-http=localhost:8080
    21  ```
    22  
    23  Alternatively, using docker:
    24  
    25  ```bash
    26  make dev
    27  ```
    28  
    29  ### Updating Queries
    30  
    31  Create or edit SQL files in `internal/relui/queries`.
    32  After editing the query, run `sqlc generate` in this directory. The
    33  `internal/relui/db` package contains the generated code.
    34  
    35  See [sqlc documentation](https://docs.sqlc.dev/en/stable/) for further
    36  details.
    37  
    38  ### Creating & Running Database Migrations
    39  
    40  Migrations are managed using `github.com/golang-migrate/migrate`. 
    41  
    42  #### Creating
    43  
    44  ```bash
    45  go run -tags pgx github.com/golang-migrate/migrate/v4/cmd/migrate \
    46    create \
    47    --dir ../../internal/relui/migrations/ \
    48    -ext sql \
    49    my_fancy_migration
    50  # alternatively, install the migrate command with pgx support.
    51  ```
    52  
    53  #### Running
    54  
    55  Migrations are automatically ran on application launch. "Down"
    56  migrations are not automatically run and must be manually invoked in
    57  `psql`, or by the `--migrate-down-up` flag or `make migrate-down-up`.
    58  
    59  ## Testing
    60  
    61  Run go test with the appropriate
    62  [libpq-style environment variables](https://www.postgresql.org/docs/current/libpq-envars.html)
    63  set. If the database connection fails, database integration tests will
    64  be skipped. If PGDATABASE is unset, relui-test is created, migrated, 
    65  and used by default.
    66  
    67  ```bash
    68  PGHOST=localhost PGUSER=postgres go test -v ./... ../../internal/relui/...
    69  ```
    70  
    71  Alternatively, using docker:
    72  ```bash
    73  make test
    74  ```
    75  
    76  ## Deployment
    77  
    78  See the documentation on [deployment](../../doc/deployment.md).
    79  
    80  ## JS/CSS formatting and lint
    81  
    82  This project uses eslint and stylelint to format JavaScript and CSS files.
    83  
    84  To run:
    85  
    86  ```bash
    87  npm run lint
    88  ```
    89  
    90  Alternatively, using Docker:
    91  
    92  ```bash
    93  make lint
    94  ```