Skip to content

Commit

Permalink
Add pipeline to build boshcpi/light-stemcell-builder
Browse files Browse the repository at this point in the history
- Keep docker image up to date with golang and other dependencies
  • Loading branch information
jpalermo committed Mar 2, 2024
1 parent f289210 commit 99aa385
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 59 deletions.
9 changes: 9 additions & 0 deletions ci/configure.sh
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -e

FLY="${FLY_CLI:-fly}"

"$FLY" -t "${CONCOURSE_TARGET:-stemcells}" set-pipeline \
-p bosh-aws-light-stemcell-builder \
-c "$(dirname $0)/pipeline.yml"
18 changes: 18 additions & 0 deletions ci/docker/Dockerfile
@@ -0,0 +1,18 @@
FROM bosh/golang-release

ARG BOSH_CLI_VERSION
ARG METALINK_VERSION

RUN apt update; apt -y upgrade; apt-get clean
RUN apt install -y \
git tar curl wget make ruby unzip qemu-utils python3 python3-pip jq && \
apt-get clean
RUN pip3 install awscli

RUN curl -fsL https://github.com/cloudfoundry/bosh-cli/releases/download/v${BOSH_CLI_VERSION}/bosh-cli-${BOSH_CLI_VERSION}-linux-amd64 \
> /usr/local/bin/bosh \
&& chmod +x /usr/local/bin/bosh

RUN curl -fsL https://github.com/dpb587/metalink/releases/download/v${METALINK_VERSION}/meta4-${METALINK_VERSION}-linux-amd64 \
> /usr/local/bin/meta4 \
&& chmod +x /usr/local/bin/meta4
44 changes: 0 additions & 44 deletions ci/docker/boshcpi.light-stemcell-builder/Dockerfile

This file was deleted.

15 changes: 0 additions & 15 deletions ci/docker/boshcpi.light-stemcell-builder/build-image.sh

This file was deleted.

78 changes: 78 additions & 0 deletions ci/pipeline.yml
@@ -0,0 +1,78 @@
jobs:
- name: build-docker-image
plan:
- in_parallel:
- get: bosh-aws-light-stemcell-builder
- get: golang-release-registry-image
trigger: true
- get: bosh-cli-github-release
trigger: true
params:
globs:
- "no-files-needed"
- get: metalink-github-release
trigger: true
params:
globs:
- "no-files-needed"
- task: build-docker-args
image: golang-release-registry-image
config:
platform: linux
inputs:
- name: bosh-cli-github-release
- name: metalink-github-release
outputs:
- name: docker-build-args
run:
path: sh
args:
- -exc
- |
cat << EOF > docker-build-args/docker-build-args.json
{
"BOSH_CLI_VERSION": "$(cat bosh-cli-github-release/version)",
"METALINK_VERSION": "$(cat metalink-github-release/version)"
}
EOF
cat docker-build-args/docker-build-args.json
- put: light-stemcell-builder-docker-image
params:
build: bosh-aws-light-stemcell-builder/ci/docker/
build_args_file: docker-build-args/docker-build-args.json


resources:
- name: bosh-aws-light-stemcell-builder
type: git
source:
uri: https://github.com/cloudfoundry/bosh-aws-light-stemcell-builder.git

- name: light-stemcell-builder-docker-image
type: docker-image
source:
repository: boshcpi/light-stemcell-builder
username: ((dockerhub_username))
password: ((dockerhub_password))

- name: golang-release-registry-image
type: registry-image
source:
repository: bosh/golang-release
username: ((dockerhub_username))
password: ((dockerhub_password))

- name: bosh-cli-github-release
type: github-release
source:
access_token: ((github_public_repo_token))
owner: cloudfoundry
repository: bosh-cli

- name: metalink-github-release
type: github-release
source:
access_token: ((github_public_repo_token))
owner: dpb587
repository: metalink

0 comments on commit 99aa385

Please sign in to comment.