Skip to content

Commit

Permalink
Geodesic version 3 (#945)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuru authored Jun 4, 2024
1 parent 103733c commit cea5e23
Show file tree
Hide file tree
Showing 51 changed files with 416 additions and 1,709 deletions.
8 changes: 2 additions & 6 deletions .github/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,9 @@ change-template: |
template: |
$CHANGES
## Every Release
#### Footnote
In every release, we update all [unpinned packages](https://github.com/cloudposse/geodesic/blob/main/packages.txt) to their latest packaged versions.
On a regular basis (roughly weekly), on Alpine only, we update the AWS CLI v1 and its dependencies to the latest versions. Debian does not have AWS CLI v1 installed, only v2.
These changes are not detailed here.
In every release, we update all [unpinned packages](https://github.com/cloudposse/geodesic/blob/main/packages.txt) to their latest packaged versions. These changes are not detailed here.
replacers:
# Remove irrelevant information from Renovate bot
Expand Down
24 changes: 11 additions & 13 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ alpine-only:
- changed-files:
- all-globs-to-all-files:
- os/alpine/**
- '!os/alpine/Dockerfile.alpine'
# We are not publishing Alpine anymore, so changes to the Alpine Dockerfile do not matter anymore
# - '!os/alpine/Dockerfile.alpine'

direnv:
- changed-files:
- any-glob-to-any-file:
- rootfs/etc/direnv/**
#direnv:
#- changed-files:
# - any-glob-to-any-file:
# - rootfs/etc/direnv/**

docker:
- changed-files:
- any-glob-to-any-file:
- os/alpine/Dockerfile.alpine
# - os/alpine/Dockerfile.alpine
- os/debian/Dockerfile.debian

docs:
Expand All @@ -31,8 +32,10 @@ github:
packages:
- changed-files:
- any-glob-to-any-file:
- "**/packages*.txt"
- "**/requirements*.txt"
- "packages*.txt"
- "requirements*.txt"
- "os/debian/packages*.txt"
- "os/debian/requirements*.txt"

scripts:
- changed-files:
Expand All @@ -44,8 +47,3 @@ shell:
- changed-files:
- any-glob-to-any-file:
- rootfs/etc/profile.d/**

terraform:
- changed-files:
- any-glob-to-any-file:
- rootfs/etc/direnv/rc.d/terraform
1 change: 1 addition & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"dockerfile": {
"ignorePaths": [
"os/alpine/**",
"rootfs/**",
"Dockerfile.custom",
"Dockerfile.options"
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
name: "docker"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
workflow_dispatch:

Expand All @@ -22,7 +27,7 @@ jobs:
ECR_REGISTRY: public.ecr.aws/ # Images will be published to `public.ecr.aws/cloudposse/$repositoryName`
strategy:
matrix:
os: ['alpine', 'debian']
os: ['debian']
steps:
- name: "Checkout source code at current commit"
uses: actions/checkout@v4
Expand Down
71 changes: 48 additions & 23 deletions .github/workflows/vhs.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: vhs
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- '*.tape'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
TERM: "xterm-256color"
COLORTERM: "truecolor"
Expand All @@ -13,49 +18,63 @@ env:
jobs:
vhs:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: "Check commit message for flags"
id: check
run: |
set -x
magic_words='\[skip vhs\]'
if [[ $(git log --format=%B -n 1 --no-merges) =~ $magic_words ]]; then
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Set up Docker Buildx
if: steps.check.outputs.skip != 'true'
id: buildx
uses: docker/setup-buildx-action@v3

- name: "Override Env for Geodesic Demo Purposes"
- name: "Override Env and Define Commands for Geodesic Demo Purposes"
if: steps.check.outputs.skip != 'true'
run: |
echo "PROMPT_STYLE=unicode" > ${ENV_FILE}
echo "BANNER_MARK=🚀" >> ${ENV_FILE}
echo "ASSUME_ROLE_INACTIVE_MARK= " >> ${ENV_FILE}
echo "PROMPT_HOST_MARK=(demo)" >> ${ENV_FILE}
mkdir -p "$HOME/.geodesic"
cat > "$HOME/.geodesic/preferences" <<-'EOF'
function demo-tofu-version() {
printf '\nTofu Version as of when we recorded this demo:\n'
printf ' %s\n\n' $(tofu version | sed 's/ / /g')
}
function demo-list-packages() {
printf '\nPackages installed by Geodesic:\n\n'; apt list --manual-installed=true 2>/dev/null | tail -n +2 | cut -f1 -d/ | pr -4 -t -a -w 100
echo
}
EOF
# Speed up builds for demo by pre-building docker image
- name: "make all"
if: steps.check.outputs.skip != 'true'
run: make all

# We need to install the Hack Nerd Font for the demo
# but vhs-action will not install it for us due to issue 264
- name: Install Hack Nerd Font
run: |
curl -sSLO https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/Hack.zip
unzip -d hack_nerd_font Hack.zip
mv hack_nerd_font/ /usr/share/fonts/
fc-cache -fv
- uses: charmbracelet/vhs-action@v2
if: steps.check.outputs.skip != 'true'
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: demo.tape
# Cannot use `install-fonts`: https://github.com/charmbracelet/vhs-action/issues/264
# install-fonts: true
install-fonts: false
# Cannot use v0.7.2: https://github.com/charmbracelet/vhs-action/issues/256
version: v0.7.1

install-fonts: true

- uses: stefanzweifel/git-auto-commit-action@v5
if: steps.check.outputs.skip != 'true'
id: auto-commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -67,13 +86,19 @@ jobs:
file_pattern: '*.gif'

- name: Add Image to Job Summary
if: steps.auto-commit.outputs.changes_detected == 'true'
if: steps.auto-commit.outputs.changes_detected == 'true' && steps.check.outputs.skip != 'true'
run: |
echo "## Demo GIF" >> $GITHUB_STEP_SUMMARY
echo "![Demo GIF](https://github.com/${{ github.repository }}/blob/${{ steps.auto-commit.outputs.commit_hash }}/docs/demo.gif?raw=true)" >> $GITHUB_STEP_SUMMARY
- name: No changes
if: steps.auto-commit.outputs.changes_detected == 'false'
if: steps.auto-commit.outputs.changes_detected == 'false' || steps.check.outputs.skip == 'true'
env:
SKIPPED: ${{ steps.check.outputs.skip }}
run: |
echo "No changes to demo" >> $GITHUB_STEP_SUMMARY
if [[ "${SKIPPED}" == "true" ]]; then
echo "Demo update skipped" >> $GITHUB_STEP_SUMMARY
else
echo "No changes to demo" >> $GITHUB_STEP_SUMMARY
fi
24 changes: 6 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ all: init deps lint build install run/new
%.build %.install %.all: DOCKER_BASE_OS = $*

lint: deps
@LINT=true \
find rootfs/usr/local/include -type f '!' -name '*.sample' -exec \
/bin/sh -c 'echo "==> {}">/dev/stderr; make --include-dir=rootfs/usr/local/include/ --just-print --dry-run --recon --no-print-directory --quiet --silent -f {}' \; > /dev/null
@if [ -d rootfs/usr/local/include ]; then \
LINT=true \
find rootfs/usr/local/include -type f '!' -name '*.sample' -exec \
/bin/sh -c 'echo "==> {}">/dev/stderr; make --include-dir=rootfs/usr/local/include/ --just-print --dry-run --recon --no-print-directory --quiet --silent -f {}' \; > /dev/null; \
fi

deps: init
@exit 0
Expand Down Expand Up @@ -69,18 +71,4 @@ bash/fmt:
bash/fmt/check:
shfmt -d $(PWD)/rootfs

.PHONY: geodesic_apkindex.md5 geodesic_aptindex.md5 all %.all build %.build install %.install run %.run run/new run/check

apk-update geodesic_apkindex.md5: DOCKER_BASE_OS = alpine
apk-update geodesic_apkindex.md5:
@echo geodesic_apkindex.md5 old $$(cat os/alpine/geodesic_apkindex.md5 || echo '<not found>')
@docker run --rm $(DOCKER_IMAGE_NAME) -c \
'apk update >/dev/null && geodesic-apkindex-md5' > os/alpine/geodesic_apkindex.md5
@echo geodesic_apkindex.md5 new $$(cat os/alpine/geodesic_apkindex.md5 || echo '<not found>')

apt-update geodesic_aptindex: DOCKER_BASE_OS = debian
apt-update geodesic_aptindex.md5:
@echo geodesic_aptindex.md5 old $$(cat os/debian/geodesic_aptindex.md5 || echo '<not found>')
@docker run --rm $(DOCKER_IMAGE_NAME) -c \
'apt-get update >/dev/null && geodesic-aptindex-md5' > os/debian/geodesic_aptindex.md5
@echo geodesic_aptindex.md5 new $$(cat os/debian/geodesic_aptindex.md5 || echo '<not found>')
.PHONY: all %.all build %.build install %.install run %.run run/new run/check
Loading

0 comments on commit cea5e23

Please sign in to comment.