Skip to content
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
194 changes: 163 additions & 31 deletions .github/workflows/main.yml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/dist/
**/dist/
**/.ch-cache/
3 changes: 3 additions & 0 deletions _base/images/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM scratch
ARG NODEJS_VERSION
LABEL nodejs.version="${NODEJS_VERSION}"
11 changes: 11 additions & 0 deletions _base/images/node/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Node

Demo image with no install steps, existing purely to verify that `tag_ranges` resolves
the latest Node.js version from Docker Hub at discovery time and threads it through as
the `NODEJS_VERSION` build arg.

## Usage

```dockerfile
FROM __hive__/node:<resolved-version>
```
19 changes: 19 additions & 0 deletions _base/images/node/image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
description: "Minimal image proving tag_ranges resolves the latest Node.js version straight from Docker Hub."

tag_ranges:
- tag_name: "{{.full}}"
source:
type: dockerhub
image: library/node
select:
major: { last: 1 }
minor: { last: 1 }
patch: { last: 1 }
versions:
nodejs: "{{.full}}"

report:
icon: "devicon-nodejs-plain"

platforms:
- linux/amd64
85 changes: 73 additions & 12 deletions gitlab/pipeline.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Auto-generated by ContainerHive
# Do not edit - regenerate with: ch --project gitlab template ci --provider gitlab --output gitlab/pipeline.gitlab-ci.yml --image-name ghcr.io/containerhive/containerhive
# tag_ranges resolved to 9 shard unit(s) - regenerate if this changes.

workflow:
auto_cancel:
on_new_commit: interruptible

default:
interruptible: true

stages:
- generate
Expand All @@ -10,6 +18,9 @@ stages:
- build-base-deployment
- test-base-deployment
- manifest-base-deployment
- build-node
- test-node
- manifest-node
- build-dotnet-runtime
- test-dotnet-runtime
- manifest-dotnet-runtime
Expand All @@ -30,7 +41,7 @@ before_script:

.build:
image:
name: ghcr.io/containerhive/containerhive:df0b431
name: ghcr.io/containerhive/containerhive:cefac90
entrypoint: [""]
services:
- name: moby/buildkit:v0.31.0
Expand All @@ -51,14 +62,14 @@ before_script:

.manifest:
image:
name: ghcr.io/containerhive/containerhive:df0b431
name: ghcr.io/containerhive/containerhive:cefac90
entrypoint: [""]
script:
- ch -p gitlab finalize ${IMAGE_NAME} --build-id "$SNAPSHOT_ID"

.test:
image:
name: ghcr.io/containerhive/containerhive:df0b431
name: ghcr.io/containerhive/containerhive:cefac90
entrypoint: [""]
services:
- name: docker:dind
Expand All @@ -73,9 +84,16 @@ before_script:
# === GENERATE ===
generate:
image:
name: ghcr.io/containerhive/containerhive:df0b431
name: ghcr.io/containerhive/containerhive:cefac90
entrypoint: [""]
stage: generate
cache:
key: ch-versions
paths:
- gitlab/.ch-cache/
policy: pull-push
variables:
CONTAINER_HIVE_CACHE_DIR: gitlab/.ch-cache
script:
- ch -p gitlab generate --build-id "$SNAPSHOT_ID"
artifacts:
Expand All @@ -88,8 +106,15 @@ lint:
needs:
- generate
image:
name: ghcr.io/containerhive/containerhive:df0b431
name: ghcr.io/containerhive/containerhive:cefac90
entrypoint: [""]
cache:
key: ch-versions
paths:
- gitlab/.ch-cache/
policy: pull
variables:
CONTAINER_HIVE_CACHE_DIR: gitlab/.ch-cache
script:
- ch -p gitlab lint --format codeclimate=gl-code-quality-report.json
artifacts:
Expand All @@ -105,7 +130,6 @@ build-base-ci-amd64:
variables:
IMAGE_NAME: base-ci
PLATFORM: amd64
parallel: 2
needs:
- generate
artifacts:
Expand All @@ -120,7 +144,6 @@ build-base-ci-arm64:
variables:
IMAGE_NAME: base-ci
PLATFORM: arm64
parallel: 2
needs:
- generate
artifacts:
Expand All @@ -146,7 +169,6 @@ test-base-ci:
stage: test-base-ci
variables:
IMAGE_NAME: base-ci
parallel: 2
needs:
- generate
- build-base-ci-amd64
Expand All @@ -165,7 +187,6 @@ build-base-deployment-amd64:
variables:
IMAGE_NAME: base-deployment
PLATFORM: amd64
parallel: 2
needs:
- generate
artifacts:
Expand All @@ -180,7 +201,6 @@ build-base-deployment-arm64:
variables:
IMAGE_NAME: base-deployment
PLATFORM: arm64
parallel: 2
needs:
- generate
artifacts:
Expand All @@ -206,7 +226,6 @@ test-base-deployment:
stage: test-base-deployment
variables:
IMAGE_NAME: base-deployment
parallel: 2
needs:
- generate
- build-base-deployment-amd64
Expand All @@ -217,6 +236,47 @@ test-base-deployment:
- gitlab/dist/**/*-cst-report.xml
reports:
junit: gitlab/dist/**/*-cst-report.xml
# === NODE ===

build-node-amd64:
extends: .build-amd64
stage: build-node
variables:
IMAGE_NAME: node
PLATFORM: amd64
needs:
- generate
artifacts:
paths:
- gitlab/dist/node/*/*/cyclonedx.json
reports:
cyclonedx: gitlab/dist/node/*/*/cyclonedx.json


manifest-node:
extends: .manifest
stage: manifest-node
variables:
IMAGE_NAME: node
needs:
- generate
- test-node
- build-node-amd64

test-node:
extends: .test
stage: test-node
variables:
IMAGE_NAME: node
needs:
- generate
- build-node-amd64
artifacts:
when: always
paths:
- gitlab/dist/**/*-cst-report.xml
reports:
junit: gitlab/dist/**/*-cst-report.xml
# === DOTNET-RUNTIME ===

build-dotnet-runtime-amd64:
Expand Down Expand Up @@ -308,7 +368,7 @@ test-go-ci:

report:
image:
name: ghcr.io/containerhive/containerhive:df0b431
name: ghcr.io/containerhive/containerhive:cefac90
entrypoint: [""]
stage: report
needs:
Expand All @@ -317,6 +377,7 @@ report:
- build-base-ci-arm64
- build-base-deployment-amd64
- build-base-deployment-arm64
- build-node-amd64
- build-dotnet-runtime-amd64
- build-go-ci-amd64
script:
Expand Down
Loading