This post will guide you through automating a "bare-metal" machine configuration, and getting a server ready for building and deploying Elixir / Phoenix applications (with LiveView support!)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Elixir CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| env: | |
| MIX_ENV: test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule KingOfTokyoWeb.ChatComponent do | |
| @moduledoc """ | |
| Displays the chat history and allows sending new messages | |
| """ | |
| use KingOfTokyoWeb, :live_component | |
| @impl true | |
| def handle_event("send-message", %{"body" => body}, socket) do | |
| send(self(), {:send_message, body}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /home/dorian/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_src_24.2/configure --cache-file=/dev/null CC=clang CPPFLAGS=-I/usr/local/opt/qt/include\ -I/usr/local/opt/openssl\@1\.1/include LDFLAGS=-L/usr/local/opt/qt/lib\ -L/usr/local/opt/openssl\@1\.1/lib --with-ssl=/usr/include/openssl | |
| === Running configure in /home/dorian/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_src_24.2/erts === | |
| ./configure 'CC=clang' 'CPPFLAGS=-I/usr/local/opt/qt/include -I/usr/local/opt/[email protected]/include' '--with-ssl=/usr/include/openssl' LDFLAGS='-L/usr/local/opt/qt/lib -L/usr/local/opt/[email protected]/lib' --disable-option-checking --cache-file=/dev/null --srcdir="/home/dorian/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_src_24.2/erts" | |
| checking build system type... x86_64-pc-linux-gnu | |
| checking host system type... x86_64-pc-linux-gnu | |
| checking for gcc... clang | |
| checking whether the C compiler works... yes | |
| checking for C compiler default output file name... a.out | |
| checking for suffix of executables... | |
| checking whether |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| relative_to_absolute = fn relative_path, importing_file -> | |
| Path.expand(relative_path, Path.dirname(importing_file)) | |
| |> String.split("src/") | |
| |> List.last() | |
| end | |
| Path.wildcard('src/**/*.{ts,tsx}') | |
| |> Enum.each(fn file -> | |
| IO.puts("Migrating #{file}...") | |
| contents = File.read!(file) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {%- style -%} | |
| {% assign header_font = section.settings.header_font %} | |
| {{ header_font | font_face }} | |
| {% assign header_font_bold = header_font | font_modify: 'weight', 'bolder' %} | |
| {% assign header_font_italic = header_font | font_modify: 'style', 'italic' %} | |
| {% assign header_font_bold_and_italic = header_font_bold | font_modify: 'style', 'italic' %} | |
| {{ header_font_bold | font_face }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # yaml-language-server: $schema=https://taskfile.dev/schema.json | |
| # NOTE: this file lives in the root of your project | |
| version: 3 | |
| includes: | |
| ci: | |
| taskfile: ./taskfiles/ci.yml | |
| # I have the phoenix app in ./app, so setting the dir here ensures that all the tasks below run inside that cwd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| # Colors for output | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[1;33m' | |
| BLUE='\033[0;34m' | |
| NC='\033[0m' # No Color |
OlderNewer