Skip to content

Commit

Permalink
Merge pull request #5 from gravitational/camh/move-to-github-actions
Browse files Browse the repository at this point in the history
Update versions, build on GitHub Actions
  • Loading branch information
camscale authored Nov 28, 2023
2 parents 1b50c62 + 4dbb647 commit b778684
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 99 deletions.
95 changes: 0 additions & 95 deletions .drone.yml

This file was deleted.

60 changes: 57 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,63 @@
name: Build FPM Images
on:
workflow_dispatch:
inputs:
version:
description: The version to use in the image label
required: true
type: string
push:
tags: [ '*' ]

jobs:
dummy:
build:
strategy:
matrix:
include:
- directory: centos/8
label: centos8
- directory: debian/12
label: debian12
runs-on: ubuntu-latest
permissions:
id-token: write # required for aws-actions/configure-aws-credentials
contents: read
steps:
- name: Greeting
run: echo "This is a dummy build to placate GitHub."
- name: version
env:
VERSION: ${{ inputs.version }}
REF_NAME: ${{ github.ref_name }}
run: |
V="${VERSION:-${REF_NAME}}"
if [[ -z "$V" ]]; then
echo "No version or ref_name set" >&2
exit 1
fi
V="$(echo "$V" | sed -e 's/[^A-Za-z0-9_.-]/-/g' -e 's/--*/-/g' -e 's/^[^A-Za-z0-9_]*//')"
echo "V=$V" >> "$GITHUB_ENV"
- name: Assume AWS ECR Push Role
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::146628656107:role/fpm-oci-tag-build-gha
role-session-name: "gha-fpm-build=${{ github.run_number }}"
role-duration-seconds: 900
- name: Log into ECR
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: public.ecr.aws
env:
AWS_REGION: us-east-1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Checkout repository
uses: actions/checkout@v4
- name: Build FPM Image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
push: true
context: ${{ matrix.directory }}
file: ${{ matrix.directory }}/Dockerfile
platforms: linux/amd64,linux/arm64
tags: |
public.ecr.aws/gravitational/fpm:${{ matrix.label }}-${{ env.V }}
6 changes: 5 additions & 1 deletion centos/8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM centos:8

RUN set -x \
&& sed -i \
-e 's/^mirrorlist/#mirrorlist/g' \
-e 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' \
/etc/yum.repos.d/CentOS-* \
&& yum install -y ruby-devel rubygems gcc make rpmdevtools rpm-sign \
&& gem install fpm \
&& gem install fpm -v 1.15.1 \
&& yum clean all \
&& mkdir /src

Expand Down
20 changes: 20 additions & 0 deletions debian/12/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM debian:12-slim

ENV DEBIAN_FRONTEND noninteractive

RUN set -x \
&& apt-get update && apt-get install -y --no-install-recommends \
ruby \
ruby-dev \
gcc \
make \
ca-certificates \
libffi-dev \
ruby-ffi \
&& rm -rf /var/lib/apt/lists/* \
&& gem install fpm -v 1.15.1 \
&& mkdir /src/

WORKDIR /src/

CMD /usr/local/bin/fpm

0 comments on commit b778684

Please sign in to comment.