This is a tutorial that uses a toy infrastructure project to highlight some of CUE's features and show how it can be used to simplify and manage infrastructure. Go to Tutorial if you want to skip the introductory stuff.
From cuelang.org:
#!/usr/bin/env bash | |
set -e | |
VERSION="v1.3.0" | |
# uname -s, uname -m | |
# Deb 32: Linux i686 | |
# Ubuntu 64: Linux x86_64 | |
# FreeBSD: FreeBSD amd64 |
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | tac | grep -m 1 -oP 'sha256:[0-9a-f]*')" | |
# syntax = docker/dockerfile:1.4.0 | |
FROM node:20 | |
WORKDIR /root | |
RUN npm install sqlite3 | |
RUN <<EOF cat >/root/schema.sql |
# inspired by: | |
# https://gist.github.com/BrutalSimplicity/882af1d343b7530fc7e005284523d38d | |
# and minimized thanks to: | |
# https://stackoverflow.com/questions/72102435/how-to-install-python3-6-on-ubuntu-22-04 | |
FROM ubuntu:22.04 | |
# ensure we use bash for all RUN commands | |
# use -l to use interactive login shell | |
# and ensure modifications to bashrc are properly sourced | |
SHELL ["/bin/bash", "-lc"] |
This is a tutorial that uses a toy infrastructure project to highlight some of CUE's features and show how it can be used to simplify and manage infrastructure. Go to Tutorial if you want to skip the introductory stuff.
From cuelang.org:
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.