Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new templates #32

Merged
merged 8 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/auto-cleaner.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const url = process.env.API_ENDPOINT;
const max_builds = process.env.MAX_BUILDS;
const buildsByAppsGQL = {
query: `
query BuildsByApps {
Expand Down Expand Up @@ -74,7 +75,6 @@ async function deleteBuilds(appName, buildsIds) {
}

async function cleanupEligibleBuilds() {
max_builds = 3
const buildsByAppsResponse = await fetch(url, buildsByAppsRequest);
const buildsByAppsJsonData = await gatherResponse(buildsByAppsResponse);

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/auto-cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
NODE_VERSION: 20.x

jobs:
image-build:
clean-builds:
if: github.event.action != 'closed' || (github.event.action == 'closed' && github.event.pull_request.merged)
runs-on: ubuntu-latest
steps:
Expand All @@ -36,7 +36,7 @@ jobs:
with:
node-version: ${{env.NODE_VERSION}}

- name: Build Image
- name: Cleanup
run: |
cat << EOF > /tmp/rclone.conf
$RCLONE_CONFIG
Expand All @@ -48,3 +48,4 @@ jobs:
API_ENDPOINT: ${{secrets.HOMELAB_LXC_EP}}
RCLONE_CONFIG: ${{secrets.RCLONE_CONFIG}}
RCLONE_CONFIG_PASS: ${{secrets.RCLONE_CONFIG_PASS}}
MAX_BUILDS: 3
48 changes: 48 additions & 0 deletions .github/workflows/build-apisix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build APISIX LXC Image

on:
pull_request:
types:
- opened
- reopened
- closed
branches:
- main
paths:
- '.github/workflows/build-apisix.yml'
- 'templates/apisix.yml'
schedule:
- cron: '0 3 */1 * *'

jobs:
init:
if: github.event.action != 'closed' || (github.event.action == 'closed' && github.event.pull_request.merged)
runs-on: ubuntu-latest
steps:
- name: Get Application version
id: get-app-version
run: |
echo "APP_VERSION=$(curl -s https://api.github.com/repos/apache/apisix/releases/latest | jq -r '.tag_name' | sed -E 's/^v|V|.+@//')" >> $GITHUB_OUTPUT
outputs:
app_version: ${{steps.get-app-version.outputs.APP_VERSION}}

image-build:
needs: init
strategy:
matrix:
architectures:
- amd64
uses: ./.github/workflows/builder.yml
with:
config_path: templates/apisix.yml
app_name: apisix
app_version: ${{needs.init.outputs.app_version}}
description: Full Lifecycle API Management platform to help you manage microservices, delivering the ultimate performance and security.
categories: Loadbalancer, API Gateway, Reverse Proxy
project_source: https://github.com/apache/apisix
distribution: debian
release: bullseye
architecture: ${{matrix.architectures}}
branch_name: ${{github.event.pull_request.base.ref}}
is_merged: ${{github.event.pull_request.merged || github.event_name == 'schedule'}}
secrets: inherit
48 changes: 48 additions & 0 deletions .github/workflows/build-gitea.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build Gitea LXC Image

on:
pull_request:
types:
- opened
- reopened
- closed
branches:
- main
paths:
- '.github/workflows/build-gitea.yml'
- 'templates/gitea.yml'
schedule:
- cron: '0 3 */1 * *'

jobs:
init:
if: github.event.action != 'closed' || (github.event.action == 'closed' && github.event.pull_request.merged)
runs-on: ubuntu-latest
steps:
- name: Get Application version
id: get-app-version
run: |
echo "APP_VERSION=$(curl -s https://dl.gitea.com/gitea/version.json| jq -r '.latest.version' | sed -E 's/^v|V|.+@//')" >> $GITHUB_OUTPUT
outputs:
app_version: ${{steps.get-app-version.outputs.APP_VERSION}}

image-build:
needs: init
strategy:
matrix:
architectures:
- amd64
uses: ./.github/workflows/builder.yml
with:
config_path: templates/gitea.yml
app_name: gitea
app_version: ${{needs.init.outputs.app_version}}
description: Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD.
categories: Git, CI CD, Dev
project_source: https://github.com/go-gitea/gitea
distribution: debian
release: bookworm
architecture: ${{matrix.architectures}}
branch_name: ${{github.event.pull_request.base.ref}}
is_merged: ${{github.event.pull_request.merged || github.event_name == 'schedule'}}
secrets: inherit
49 changes: 49 additions & 0 deletions .github/workflows/build-infisical.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build Infisical LXC Image

on:
pull_request:
types:
- opened
- reopened
- closed
branches:
- main
paths:
- '.github/workflows/build-infisical.yml'
- 'templates/infisical.yml'
schedule:
- cron: '0 3 */1 * *'

jobs:
init:
if: github.event.action != 'closed' || (github.event.action == 'closed' && github.event.pull_request.merged)
runs-on: ubuntu-latest
steps:
- name: Get Application version
id: get-app-version
run: |
DG=$(curl -s "https://hub.docker.com/v2/repositories/infisical/infisical/tags/" | jq -r '.results[] | select(.name |contains("latest-postgres"))|.digest')
echo "APP_VERSION=$(curl -s "https://hub.docker.com/v2/repositories/infisical/infisical/tags/"| jq --arg digest $DG -r '.results[] | select(.digest |contains($digest)) | select(.name |test("^v")) | .name' | sed -E 's/^(v|V)//' | sed -E 's/-postgres//')" >> $GITHUB_OUTPUT
outputs:
app_version: ${{steps.get-app-version.outputs.APP_VERSION}}

image-build:
needs: init
strategy:
matrix:
architectures:
- amd64
uses: ./.github/workflows/builder.yml
with:
config_path: templates/infisical.yml
app_name: infisical
app_version: ${{needs.init.outputs.app_version}}
description: Open Source all-in-one secret management platform to securely manage application configuration and secrets across your team and infrastructure.
categories: Secrets management, Security, Infra
project_source: https://github.com/Infisical/infisical
distribution: debian
release: bookworm
architecture: ${{matrix.architectures}}
branch_name: ${{github.event.pull_request.base.ref}}
is_merged: ${{github.event.pull_request.merged || github.event_name == 'schedule'}}
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:

- name: Build Image
run: |
sudo distrobuilder --cache-dir /tmp/cache/${{inputs.app_name}} build-lxc ${{github.workspace}}/${{inputs.config_path}} -o image.distribution=${{inputs.distribution}} -o image.architecture=${{inputs.architecture}} -o image.release=${{inputs.release}} -o image.serial="v${{inputs.app_version}}" -o source.url="http://ftp.us.debian.org/debian" /tmp/output/${{inputs.app_name}}/
sudo distrobuilder --cache-dir /tmp/cache/${{inputs.app_name}} build-lxc ${{github.workspace}}/${{inputs.config_path}} -o image.distribution=${{inputs.distribution}} -o image.architecture=${{inputs.architecture}} -o image.release=${{inputs.release}} -o image.serial="${{inputs.app_version}}" -o source.url="http://ftp.us.debian.org/debian" /tmp/output/${{inputs.app_name}}/
mv /tmp/output/${{inputs.app_name}}/rootfs.tar.xz ./${{inputs.app_name}}-${{inputs.app_version}}-${{inputs.architecture}}-root.tar.xz
mv /tmp/output/${{inputs.app_name}}/meta.tar.xz ./${{inputs.app_name}}-${{inputs.app_version}}-${{inputs.architecture}}-meta.tar.xz
echo "ARTIFACT_SIZE=$(du -sh ./${{inputs.app_name}}-${{inputs.app_version}}-${{inputs.architecture}}-root.tar.xz| cut -f 1)" >> $GITHUB_ENV
Expand Down
Loading