-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* first attempt to add gh-action * adding entrypoint.sh * need to install bash' Signed-off-by: vsoch <vsoch@users.noreply.github.com> Co-authored-by: vsoch <vsoch@users.noreply.github.com>
- Loading branch information
Showing
6 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: CI | ||
on: [pull_request] | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Actions Repository | ||
uses: actions/checkout@v2 | ||
- name: Test dockerfile uptodate GitHub Action | ||
uses: ./ | ||
with: | ||
root: ./tests | ||
parser: dockerfile | ||
|
||
- name: Check output files | ||
run: | | ||
sudo apt-get install -y tree | ||
tree ./tests | ||
- name: Test dockerhierarchy uptodate GitHub Action | ||
uses: ./ | ||
with: | ||
root: ./tests | ||
parser: dockerhierarchy | ||
|
||
- name: Check output files again | ||
run: | | ||
tree ./tests | ||
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM golang:alpine as builder | ||
|
||
ARG version | ||
LABEL maintainer="@vsoch" | ||
|
||
LABEL "com.github.actions.name"="UpToDate Action" | ||
LABEL "com.github.actions.description"="Check that repository assets are up to date" | ||
LABEL "com.github.actions.icon"="activity" | ||
LABEL "com.github.actions.color"="blue" | ||
|
||
# Install module dependencies | ||
WORKDIR /code | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
# Copy the rest! | ||
COPY . . | ||
|
||
# Install some dependencies | ||
RUN apk add --no-cache binutils build-base linux-headers | ||
|
||
# Build the action | ||
RUN make | ||
|
||
# Multistage build to only copy over the binary | ||
FROM alpine | ||
|
||
RUN apk add --no-cache git bash | ||
WORKDIR /code | ||
COPY --from=builder /code/uptodate /code/entrypoint.sh /code/ | ||
ENV PATH /code:$PATH | ||
ENTRYPOINT ["/bin/bash", "/code/entrypoint.sh"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: "uptodate-action" | ||
author: "Vanessa Sochat" | ||
description: "Check that repository assets are up to date" | ||
|
||
inputs: | ||
root: | ||
description: "Root path to provide to command. Can be a Dockerfile or directory." | ||
required: false | ||
default: "" | ||
|
||
parser: | ||
description: "Parser to run, one of dockerfile, or dockerhierarchy" | ||
required: true | ||
|
||
dry_run: | ||
description: "Do a dry run (don't write, but show changes) one of true or false, defaults to false" | ||
required: false | ||
default: false | ||
|
||
runs: | ||
using: "docker" | ||
image: "Dockerfile" | ||
|
||
branding: | ||
icon: "activity" | ||
color: "blue" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
printf "Found files in workspace:\n" | ||
ls | ||
|
||
printf "Looking for uptodate install...\n" | ||
which uptodate | ||
|
||
COMMAND="uptodate ${INPUT_PARSER} " | ||
|
||
# dry run? | ||
if [ "${INPUT_DRY_RUN}" == "true" ]; then | ||
COMMAND="${COMMAND} --dry-run" | ||
fi | ||
|
||
COMMAND="${COMMAND} ${INPUT_ROOT}" | ||
echo "${COMMAND}" | ||
|
||
${COMMAND} | ||
echo $? |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM ubuntu:21.04 | ||
|
||
LABEL maintainer vsoch | ||
|
||
RUN apt-get update && apt-get install -y vim |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
dockerhierarchy: | ||
container: | ||
name: ubuntu | ||
filter: | ||
# we only want XX.04 versions | ||
- "^[0-9]+[.]04$" | ||
startat: "16.04" | ||
|
||
# Versions to skip (not LTS releases) | ||
skips: | ||
- "17.04" | ||
- "19.04" |