Skip to content

Commit

Permalink
Added demo
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Jan 24, 2024
1 parent 2e64519 commit f05f619
Show file tree
Hide file tree
Showing 9 changed files with 255 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/build-go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: build-go

on:
push:
paths:
- "go/*.go"
- "go/go.mod"
- "go/go.sum"
- ".github/workflows/build-go.yml"
pull_request:
types:
- opened
- synchronize
- labeled
- reopened
paths:
- "go/*.go"
- "go/go.mod"
- "go/go.sum"
- ".github/workflows/build-go.yml"
workflow_dispatch:

permissions:
contents: read

jobs:

build-go:
name: build-go
runs-on: ubuntu-22.04
steps:

- name: Checkout code
uses: actions/checkout@v4

- name: Build binary
run: |
cd go
go build -o ../hello .
- name: Smoke test
run: |
./hello
39 changes: 39 additions & 0 deletions .github/workflows/check-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: check-python

on:
push:
paths:
- "requirements.txt"
- ".github/workflows/check-python.yml"
pull_request:
types:
- opened
- synchronize
- labeled
- reopened
paths:
- "requirements.txt"
- ".github/workflows/check-python.yml"
workflow_dispatch:

permissions:
contents: read

jobs:

check-python:
name: check-python
runs-on: ubuntu-22.04
steps:

- name: Checkout code
uses: actions/checkout@v4

- name: Install
run: |
pip install --requirement requirements.txt
- name: Smoke test
run: |
cowsay --help
pyfiglet --help
56 changes: 56 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: docker-build

on:
push:
branches-ignore:
- "renovate/**"
paths:
- "ubuntu/22.04/**"
- ".github/workflows/docker-build.yml"
pull_request:
types:
- opened
- synchronize
- labeled
- reopened
paths:
- "ubuntu/22.04/**"
- ".github/workflows/docker-build.yml"
workflow_dispatch:

jobs:
build:
name: docker-build
permissions:
packages: write
runs-on: ubuntu-latest
env:
IMAGE_TAG: 22.04
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build
uses: docker/build-push-action@v4
with:
context: ubuntu/22.04
platforms: linux/amd64
provenance: false
sbom: false
cache-from: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
70 changes: 69 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,69 @@
# clc23-renovate-demo
# renovate-demo

This repository demonstrates RenovateBot

## Usage

Follow these steps to use this repository:

1. Fork this repository

After forking explore the repository to understand which outdated dependencies are present.

Before Renvoate is able to operate on the repository, enable the GitHub App

1. Enable RenovateBot

The following commands add a configuration for RenovateBot and complete the onboarding process:

```bash
git checkout Onboarding
git add .
git commit -m "Enable RenovateBot"
git push
```

1. Configure automerge

The following commands add a configuration for automerging some dependencies:

```bash
git checkout Automerge
git add .
git commit -m "Enable RenovateBot"
git push
```

## Updates to this repository

### Go to beginning

1. Checkout tag `Start`: `git checkout Start`
1. Set branch main: `git branch main --force`
1. Checkout branch `main`: `git checkout main`

### Update demo

1. Update and commit (optionally rebase)
1. Set tag `Start`: `git tag --annotate --message Start Start --force`

### Go to onboarding

1. Copy from tag `Onboarding`: `git checkout Onboarding -- renovate.json`
1. (Optional) Update and commit (optionally rebase)
1. Commit: `git commit --message Onboarding`
1. Set tag `Onboarding`: `git tag --annotate --message Onboarding Onboarding --force`

### Go to automerge

1. Copy from tag `Automerge`: `git checkout Automerge -- renovate.json`
1. (Optional) Update and commit (optionally rebase)
1. Commit: `git commit --message Automerge`
1. Set tag `Automerge`: `git tag --annotate --message Automerge Automerge --force`

### Prepare for usage

1. Return to beginning of demo: `git checkout Start`
1. Reset branch `main`: `git branch main --force`
1. Checkout branch `main`: `git checkout main`
1. Push: `git push --all --force`
5 changes: 5 additions & 0 deletions go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/nicholasdille/clc23-renovate-demo

go 1.20

require github.com/TwiN/go-color v1.4.0
2 changes: 2 additions & 0 deletions go/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/TwiN/go-color v1.4.0 h1:fNbOwOrvup5oj934UragnW0B1WKaAkkB85q19Y7h4ng=
github.com/TwiN/go-color v1.4.0/go.mod h1:0QTVEPlu+AoCyTrho7bXbVkrCkVpdQr7YF7PYWEtSxM=
15 changes: 15 additions & 0 deletions go/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package main

import (
"fmt"

"github.com/TwiN/go-color"
)

var Author string = "unknown"
var Version string = "none"

func main() {
println(color.InGreen("hello world"))
fmt.Printf("by %s, version %s", Author, Version)
}
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cowsay==5.0
pyfiglet==1.0.1
24 changes: 24 additions & 0 deletions ubuntu/22.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#syntax=docker/dockerfile:1.6.0

FROM ubuntu:22.04 AS base

SHELL [ "bash", "-o", "errexit", "-c"]
ARG DEBIAN_FRONTEND=noninteractive

COPY <<no-recommends <<no-suggests /etc/apt/apt.conf.d/
APT::Install-Recommends "false";
no-recommends
APT::Install-Suggests "false";
no-suggests

RUN <<EOF
grep security /etc/apt/sources.list >/etc/apt/sources.list.d/security.list
apt-get update -o Dir::Etc::SourceList=/etc/apt/false -o Dir::Etc::SourceParts=/etc/apt/sources.list.d
apt-get upgrade -y
rm -f /etc/apt/sources.list.d/security.list
EOF

ARG ref=main
LABEL org.opencontainers.image.source="https://github.com/nicholasdille/clc23-renovate-demo" \
org.opencontainers.image.title="Ubuntu" \
org.opencontainers.image.description="Base image for Ubuntu"

0 comments on commit f05f619

Please sign in to comment.