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 base image and initial features #7

Merged
merged 53 commits into from
Jan 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
651421a
Add base image
Jan 25, 2024
88d8d5a
Fix broken YAML
Jan 25, 2024
5baf9d2
Fix config generator
Jan 25, 2024
9dd07c7
Fix workflow
Jan 25, 2024
6ca50ae
Bump dorny/paths-filter to v3.0.0
Jan 25, 2024
ccef921
Update script path in workflow
Jan 25, 2024
c747b97
Update EditorConfig
Jan 25, 2024
b7d1102
Rename to Dockerfile for Dependabot
Jan 25, 2024
00f2e65
Update configuration generator
Jan 25, 2024
0a9c667
Add multi-arch matrix to build-and-test
Jan 25, 2024
ec7e375
Add action
Jan 25, 2024
dd44344
Update uses
Jan 25, 2024
e6524a7
Add devcontainer lockfile
Jan 25, 2024
e9ffa96
Fix template
Jan 25, 2024
0192464
Add shell
Jan 25, 2024
666312d
Fix if
Jan 25, 2024
e5f6a34
update run
Jan 25, 2024
ca00cff
pinning at 1.16.0, 1.16.1 has no binaries
Jan 25, 2024
64efdce
forgot to delete this
Jan 25, 2024
8009b37
debug
Jan 25, 2024
f3a5ff8
im tired now
Jan 25, 2024
04844ec
Add structure test
Jan 25, 2024
d3d1a01
Add image scanning
Jan 25, 2024
4ee5f61
Remove platform flag
Jan 25, 2024
0bf4bfa
Add newline to devcontainer lockfile
Jan 25, 2024
e7a5fbe
hide progress, it's noisy
Jan 25, 2024
b02042e
add initial pre-flight check
Jan 25, 2024
37876a7
fix id-token
Jan 25, 2024
12f3464
Update preflight if statement
Jan 25, 2024
a8a405d
fix variable
Jan 25, 2024
b6ee10b
fix if
Jan 25, 2024
7d63af5
Add newline
Jan 25, 2024
f72e91e
Fix workflow AGAIN
Jan 25, 2024
2dc89ff
it's not README it's CHANGELOG
Jan 25, 2024
58af84e
Update .editorconfig file
Jan 25, 2024
da03c2d
SemVer for now
Jan 25, 2024
298d82f
Add JSON and YAML to EditorConfig
Jan 25, 2024
e6b0e80
Fix workflow
Jan 25, 2024
a5a74fe
Fix some linting stuff
Jan 25, 2024
144551c
Testing validation
Jan 26, 2024
da7eac0
Validate not on main
Jan 26, 2024
8010979
Update base path to features
Jan 26, 2024
1f6707f
Update base path to features/src
Jan 26, 2024
908396f
Remove strategy
Jan 26, 2024
b5dda2b
Fix Dockerfile and hopefully shellcheck
Jan 26, 2024
fa57952
Disable shellchecks
Jan 26, 2024
2b79bbd
Add Kubernetes and Terraform features
Jan 26, 2024
7be42ff
linters
Jan 26, 2024
a6cf702
Add shellcheck exclusion
Jan 26, 2024
6509cf3
Add system upgrade to base
Jan 26, 2024
d17f6b3
Add pre-flight to features
Jan 26, 2024
cc2fef8
Adds feature publishing
Jan 26, 2024
8feb5a5
Update devcontainer feature path
Jan 30, 2024
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
Prev Previous commit
Next Next commit
Add newline
Add README checking
ADD ONBUILD

Signed-off-by: Jacob Woffenden <jacob.woffenden@digital.justice.gov.uk>
  • Loading branch information
Jacob Woffenden committed Jan 25, 2024
commit 7d63af5b5e14612e900d007edc5a3ef2052e7e1e
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -11,4 +11,4 @@
"integrity": "sha256:7d31b83459dd5110c37e7f5acb2920335cb1e5ebf014326d7eb6a0b290cc820a"
}
}
}
}
47 changes: 46 additions & 1 deletion .github/workflows/images.yml
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ jobs:
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Check Version (GitHub Container Registry)
- name: Check Version
id: check_version
env:
GH_TOKEN: ${{ github.token }}
@@ -84,6 +84,51 @@ jobs:
fi
fi

- name: Check CHANGELOG Updates
id: check_changelog_updates
env:
GH_TOKEN: ${{ github.token }}
run: |
mainSha=$(gh api --method GET /repos/"${GITHUB_REPOSITORY}"/contents/containers/${{ inputs.image }}/CHANGELOG.md --field ref="main" | jq -r '.sha')
branchSha=$(gh api --method GET /repos/"${GITHUB_REPOSITORY}"/contents/containers/${{ inputs.image }}/CHANGELOG.md --field ref="${GITHUB_HEAD_REF}" | jq -r '.sha')

if [[ -z "${mainSha}" ]]; then
SHA not found for main branch, assuming CHANGELOG.md does not exist
elif [[ -z "${branchSha}" ]]; then
SHA not found for "${GITHUB_HEAD_REF}" branch, assuming CHANGELOG.md does not exist
"changelog_updated=false" >>"${GITHUB_ENV}"
elif [[ "${mainSha}" == "${branchSha}" ]]; then
echo "CHANGELOG.md matches main branch, needs to be updated"
echo "changelog_updated=false" >>"${GITHUB_ENV}"
elif [[ "${mainSha}" != "${branchSha}" ]]; then
echo "CHANGELOG.md does not match main branch, does not need to be updated"
echo "changelog_updated=true" >>"${GITHUB_ENV}"
fi

- name: Evaluate Checks
id: evaluate_checks
run: |
echo "::notice::# Preflight Checks"

if [[ "${{ env.tag_exists }}" == "true" ]]; then
echo "::error::FAIL: Container tag already exists"
export failBuild="true"
else
echo "::notice::OK: Container tag does not exist"
export failBuild="false"
fi

if [[ "${{ env.changelog_updated }}" == "true" ]]; then
echo "::notice::OK: CHANGELOG.md has been updated"
export failBuild="false"
elif [[ "${{ env.changelog_updated }}" == "false" ]]; then
echo "::error::FAIL: CHANGELOG.md needs to be updated"
export failBuild="true"
fi

if [[ "${failBuild}" == "true" ]]; then
exit 1
fi

build-test-scan:
needs: [detect-changes]
5 changes: 5 additions & 0 deletions images/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -7,3 +7,8 @@ LABEL org.opencontainers.image.vendor="Ministry of Justice" \
org.opencontainers.image.url="https://github.com/ministryofjustice/data-platform/tree/main/containers/actions-runner"

COPY --chown=nobody:nobody --chmod=0755 src/usr/local/bin/devcontainer-utils /usr/local/bin/devcontainer-utils

ONBUILD RUN apt-get update --yes \
&& apt-get upgrade --yes \
&& apt-get clean --yes \
&& rm -rf /var/lib/apt/lists/*
15 changes: 15 additions & 0 deletions images/base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- markdownlint-disable MD003 -->
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [2024.1.0] - 2024-25-01

### Added

- Initial release of image
Loading