Skip to content

Commit

Permalink
🚧 WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary-H9 committed May 14, 2024
1 parent e33b736 commit bc2fdc3
Show file tree
Hide file tree
Showing 13 changed files with 307 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Build and Test

on:
pull_request:
branches:
- main

permissions: {}

jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: docker.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:cd3513beca3fcaf5dd34cbe81a33b3ff30337d8ada5869b40a6454c21d6f7684 # v4.0.0
permissions:
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Build
id: build
run: |
/usr/local/bin/package
test:
name: Test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Lychee
id: lychee
uses: lycheeverse/lychee-action@c053181aa0c3d17606addfe97a9075a32723548a # v1.9.3
with:
args: --verbose --no-progress './**/*.md' './**/*.html' './**/*.erb' --accept 403,200,429
fail: true
47 changes: 47 additions & 0 deletions .github/workflows/openssf-scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: OpenSSF Scorecard

on:
branch_protection_rule:
push:
branches:
- main
schedule:
- cron: "30 6 * * 1"
workflow_dispatch:

permissions: {}

jobs:
openssf-scorecard:
name: OpenSSF Scorecard
runs-on: ubuntu-latest
permissions:
id-token: write
security-events: write
steps:
- name: Checkout
id: checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Run Analysis
id: run_analysis
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
publish_results: true

- name: Upload SARIF
id: upload_sarif
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: SARIF Results
path: results.sarif
retention-days: 5

- name: Upload to CodeQL
id: upload_to_codeql
uses: github/codeql-action/upload-sarif@df5a14dc28094dc936e103b37d749c6628682b60 # v3.25.0
with:
sarif_file: results.sarif
59 changes: 59 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: Build and Publish

on:
push:
branches:
- main

permissions: {}

concurrency:
group: github-pages
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: docker.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:cd3513beca3fcaf5dd34cbe81a33b3ff30337d8ada5869b40a6454c21d6f7684 # v4.0.0
permissions:
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Build
id: build
run: |
/usr/local/bin/package
- name: Upload Artifact
id: upload_artifact
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: github-pages
path: artifact.tar
retention-days: 1
overwrite: true

publish:
needs: build
name: Publish
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.configure_pages.outputs.base_url }}
permissions:
contents: read
id-token: write
pages: write
steps:
- name: Configure Pages
id: configure_pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0

- name: Deploy to GitHub Pages
id: deploy_pages
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![repo standards badge](https://img.shields.io/endpoint?labelColor=231f20&color=005ea5&style=for-the-badge&label=MoJ%20Compliant&url=https%3A%2F%2Foperations-engineering-reports.cloud-platform.service.justice.gov.uk%2Fapi%2Fv1%2Fcompliant_public_repositories%2Fendpoint%2F.devcontainer&logo=data:image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b1YuqDkgvH2GkURfakly01Cg7Cw0+qyXxkjojq9Lw+vT2AUY+DlF/otYq1Ixc35re2V7R8aTRg2KUv7+ou3x/14PsUBn3NG51S0XpG0Z9PcOPKWSS0SKNUo9Rv2Mmt/G5WpPF6pHGra7Jv410OVsdaz217AbkAPX3ubkm240belCuudT4Rp5p/DyC2lf9mfq1iq5eFe8/lu+K0YrVp0uret4nAkwlB6vzjI/1PxrlrTp/oNHbzTJI92T1qAT+BfW49MhMg6JUp7ehY5a6Tl2jjmVvitF9fxo5Yq8CaAfAkzLMnySt6uz/1k6bPx59CpCNxGfoSKA30IPoH7cQXdArwCOllFX/i53P5P9a/gNkKpsCMFRuFAAAAABJRU5ErkJggg==)](https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/public-report/.devcontainer)

This repository was created by Ministry of Justice's Dev Container Community of Practice. The goal is to release a foundational image for deployment, develop features that boost developer efficiency, and set a benchmark for using containerised development environments within the Ministry of Justice.
This repository was created by Ministry of Justice's Dev Container Community of Practice. The goal is to release a foundational image for deployment, develop features that boost developer efficiency, and set a benchmark for using containerised development environments within the Ministry of Justice. Additionally this repository serves documentation relating to the use and configuration of devcontainers within the Ministry of Justice.

Contact us on our Slack channel - [`#devcontainer-community`](https://moj.enterprise.slack.com/archives/C06DZ4F04JZ ).

Expand Down
23 changes: 23 additions & 0 deletions config/tech-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
collapsible_nav: true
default_owner_slack: "#devcontainer-community"
enable_search: true
footer_links:
Platform Status: https://status.observability-platform.service.justice.gov.uk
full_service_name: Dev Container User Guide
github_branch: main
github_repo: ministryofjustice/.devcontainer
header_links:
GitHub: https://github.com/ministryofjustice/.devcontainer
Slack: https://moj.enterprise.slack.com/archives/C06DZ4F04JZ
host: https://user-guide.devcontainer.service.justice.gov.uk
max_toc_heading_level: 3
owner_slack_workspace: mojdt
phase: prototype
prevent_indexing: true
service_link: /
service_name: Dev Container User Guide
show_contribution_banner: true
show_expiry: true
show_govuk_logo: false
show_review_banner: true
27 changes: 27 additions & 0 deletions scripts/documentation/local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

MODE="${1:-preview}"
TECH_DOCS_PUBLISHER_IMAGE="docker.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:cd3513beca3fcaf5dd34cbe81a33b3ff30337d8ada5869b40a6454c21d6f7684" # v4.0.0

case ${MODE} in
package | preview)
true
;;
*)
echo "Usage: ${0} [package|preview]"
exit 1
;;
esac

if [[ "$(uname --machine)" == "aarch64" ]] || [[ "$(uname --machine)" == "arm64" ]]; then
PLATFORM_FLAG="--platform=linux/amd64"
else
PLATFORM_FLAG=""
fi

docker run -it --rm ${PLATFORM_FLAG} \
--name "tech-docs-${MODE}" \
--publish 4567:4567 \
--volume "${PWD}/config:/app/config" \
--volume "${PWD}/source:/app/source" \
"${TECH_DOCS_PUBLISHER_IMAGE}" "/usr/local/bin/${MODE}"
58 changes: 58 additions & 0 deletions source/documentation/features/features.html.md.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Features
last_reviewed_on: 2024-04-15
review_in: 3 months
weight: 0
---

# <%= current_page.data.title %>

## What are Features?

In the context of the Ministry of Justice Dev Containers community, features are built by the community to satisfy the specific needs of our developers and the challenges they face on a day to day basis.

Features are built using the [.devcontainer](https.//github.com/ministryofjustice/.devcontainer/features/test) GitHub repository and are designed to be modular and reusable. This means that features can be combined to create a custom development environment that meets the needs of a specific project or team.

Features are can be used by Sofware Developers and those in Operations Roles to create consistent and reliable development environments for the applications and services they work on.

## Available Features

Features are located in the [features](https.//github.com/ministryofjustice/.devcontainer/features/src) folder in the Dev Containers GitHub repository.

### AWS

The AWS feature provides a development environment with the AWS CLI and SDKs pre-installed.

### Cloud Platform

The Cloud Platform feature provides a development environment with

### Container Structure Test

The Container Structure Test feature

### Kubernetes

### Static Analysis

The Static Analysis feature provides a development environment with static analysis tools pre-installed.

The tools include:

- [checkov](https://www.checkov.io/)

- [trivy](https://aquasecurity.github.io/trivy/v0.51/)

- [terrascan](https://runterrascan.io/)

### Terraform

The Terraform feature provides a development environment with the Terraform CLI pre-installed.

## Adding a New Features

To add a new feature:

1. Create a new feature in the [.devcontainer](https.//github.com/ministryofjustice/.devcontainer/features/src) GitHub repository.
1. Add the feature to the [Dev Containers Features](/documentation/features/features.html) documentation.
1. Add tests for the feature in the [.devcontainer](https.//github.com/ministryofjustice/.devcontainer/features/test) GitHub repository.
13 changes: 13 additions & 0 deletions source/documentation/getting-started/getting-started.html.md.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Getting Started with Dev Containers
last_reviewed_on: 2024-04-15
review_in: 3 months
weight: 0
---

# <%= current_page.data.title %>

## Heading

Content

27 changes: 27 additions & 0 deletions source/index.html.md.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: Dev Container User Guide
last_reviewed_on: 2024-05-14
review_in: 3 months
weight: 0
---

# <%= current_page.data.title %>

This documentation is for teams and individuals who wish to integrate [Dev Containers](https://containers.dev/) into their development workflow.

## Our Goals

The goal of the community is to provide a consistent and reliable development environment for all developers throughout the Ministry of Justice.
We welcome contributions to this community - Pull Requests, documentation, feedback and requests are all welcome.

## Getting Started

- [Getting Started with Dev Containers in the Ministry of Justice](/documentation/getting-started/getting-started.html)

## Features

- [Dev Containers Features](/documentation/features/features.html)

## Getting Help

You can contact us on Slack via [#devcontainer-community](https://moj.enterprise.slack.com/archives/C06DZ4F04JZ).
1 change: 1 addition & 0 deletions source/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//= require govuk_tech_docs
3 changes: 3 additions & 0 deletions source/stylesheets/print.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$is-print: true;

@import "govuk_tech_docs";
4 changes: 4 additions & 0 deletions source/stylesheets/screen-old-ie.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$is-ie: true;
$ie-version: 8;

@import "govuk_tech_docs";
1 change: 1 addition & 0 deletions source/stylesheets/screen.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "govuk_tech_docs";

0 comments on commit bc2fdc3

Please sign in to comment.