Skip to content

Commit

Permalink
ci(shared): bump vendored ci files
Browse files Browse the repository at this point in the history
  • Loading branch information
galoybot committed Jun 24, 2024
1 parent 6bf661f commit 1b08ae9
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 20 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
name: Check Code
runs-on: ubuntu-latest
steps:
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- uses: actions/checkout@v3
- name: Run check code
run: make check-code
run: nix develop -c make check-code
6 changes: 5 additions & 1 deletion .github/workflows/vendor/rust-check-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
name: Check Code
runs-on: ubuntu-latest
steps:
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- uses: actions/checkout@v3
- name: Run check code
run: make check-code
run: nix develop -c make check-code
10 changes: 5 additions & 5 deletions ci/vendir.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apiVersion: vendir.k14s.io/v1alpha1
directories:
- contents:
- git:
commitTitle: 'feat: allow public or private repo selection (#34)'
sha: 53fc9dd805d3574d200e8e6e99f856c0912b52a8
commitTitle: 'fix: rm bundled deps from inputs'
sha: 8ce8d05594881f5012402c84db80b4075c448a1b
path: .
path: ../.github/workflows/vendor
- contents:
- git:
commitTitle: 'feat: allow public or private repo selection (#34)'
sha: 53fc9dd805d3574d200e8e6e99f856c0912b52a8
commitTitle: 'fix: rm bundled deps from inputs'
sha: 8ce8d05594881f5012402c84db80b4075c448a1b
path: .
path: ./vendor
path: vendor
kind: LockConfig
4 changes: 2 additions & 2 deletions ci/vendir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ directories:
- path: . # Copy this folder out to ..
git:
url: https://github.com/GaloyMoney/concourse-shared.git
ref: 53fc9dd805d3574d200e8e6e99f856c0912b52a8
ref: 8ce8d05594881f5012402c84db80b4075c448a1b
includePaths:
- shared/actions/*
excludePaths:
Expand All @@ -20,7 +20,7 @@ directories:
- path: .
git:
url: https://github.com/GaloyMoney/concourse-shared.git
ref: 53fc9dd805d3574d200e8e6e99f856c0912b52a8
ref: 8ce8d05594881f5012402c84db80b4075c448a1b
includePaths:
- shared/ci/**/*
excludePaths:
Expand Down
48 changes: 40 additions & 8 deletions ci/vendor/pipeline-fragments.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ source:
repository: #@ release_concourse_image()
#@ end

#@ def nix_task_image_config():
type: registry-image
source:
repository: nixpkgs/nix-flakes
#@ end

#@ def slack_failure_notification():
#@ fail_url = "<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME| :face_with_symbols_on_mouth: $BUILD_JOB_NAME> failed!"
put: slack
Expand All @@ -54,6 +60,25 @@ params:
text: #@ fail_url
#@ end

#@ def check_code():
name: check-code
serial: true
plan:
- in_parallel:
- { get: repo, trigger: true }
- { get: pipeline-tasks }
- task: check-code
config:
platform: linux
image_resource: #@ nix_task_image_config()
inputs:
- name: pipeline-tasks
- name: repo
run:
path: pipeline-tasks/ci/vendor/tasks/check-code.sh
on_failure: #@ slack_failure_notification()
#@ end

#@ def nodejs_check_code():
name: check-code
serial: true
Expand Down Expand Up @@ -265,21 +290,27 @@ plan:
run:
path: pipeline-tasks/ci/vendor/tasks/docker-prep-docker-build-env.sh
- task: build
privileged: true
config:
platform: linux
image_resource:
type: registry-image
source:
repository: vito/oci-build-task
repository: gcr.io/kaniko-project/executor
tag: debug
inputs:
- name: repo
outputs:
- name: image
params:
CONTEXT: repo
run:
path: build
path: /kaniko/executor
args:
- --dockerfile=Dockerfile
- --context=repo
- --use-new-run
- --single-snapshot
- --cache=false
- --no-push
- --tar-path=image/image.tar
- put: edge-image
params:
image: image/image.tar
Expand Down Expand Up @@ -370,6 +401,7 @@ plan:
platform: linux
image_resource: #@ nodejs_task_image_config()
inputs:
- name: repo
- name: pipeline-tasks
- name: edge-image
- name: charts-repo
Expand Down Expand Up @@ -413,7 +445,7 @@ source:
tag: edge
username: #@ data.values.docker_registry_user
password: #@ data.values.docker_registry_password
repository: #@ public_docker_registry() if publicRepo else private_docker_registry() + "/" + data.values.gh_repository
repository: #@ public_docker_registry() + "/" + data.values.gh_repository if publicRepo else private_docker_registry() + "/" + data.values.gh_repository
#@ end

#@ def nodejs_deps_resource(webhook = False):
Expand Down Expand Up @@ -477,13 +509,13 @@ source:
private_key: #@ data.values.github_private_key
#@ end

#@ def versioned_image_resource():
#@ def versioned_image_resource(publicRepo = True):
name: versioned-image
type: registry-image
source:
username: #@ data.values.docker_registry_user
password: #@ data.values.docker_registry_password
repository: #@ public_docker_registry() + "/" + data.values.gh_repository
repository: #@ public_docker_registry() + "/" + data.values.gh_repository if publicRepo else private_docker_registry() + "/" + data.values.gh_repository
#@ end

#@ def gh_release_resource():
Expand Down
7 changes: 5 additions & 2 deletions ci/vendor/tasks/chart-open-charts-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
set -eu

export digest=$(cat ./edge-image/digest)
export ref=$(cat ./repo/.git/short_ref)

pushd charts-repo

ref=$(yq e '.image.git_ref' charts/${CHARTS_SUBDIR}/values.yaml)
git checkout ${BRANCH}
old_ref=$(yq e '.image.git_ref' charts/${CHARTS_SUBDIR}/values.yaml)

old_digest=$(yq e '.image.digest' "./charts/${CHARTS_SUBDIR}/values.yaml")
old_ref=$(grep "digest: \"${old_digest}\"" "./charts/${CHARTS_SUBDIR}/values.yaml" \
| sed -n 's/.*commit_ref=\([^;]*\);.*/\1/p' | tr -d ' \n')

cat <<EOF >> ../body.md
# Bump ${CHARTS_SUBDIR} image
Expand Down
10 changes: 10 additions & 0 deletions ci/vendor/tasks/check-code.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

#! Auto synced from Shared CI Resources repository
#! Don't change this file, instead change it in github.com/GaloyMoney/concourse-shared

set -eu

pushd repo

nix develop -c make check-code
4 changes: 3 additions & 1 deletion ci/vendor/tasks/docker-bump-image-digest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export app_version=$(cat version/version)
pushd charts-repo

yq -i e '.image.digest = strenv(digest)' ./charts/${CHARTS_SUBDIR}/values.yaml
yq -i e '.image.git_ref = strenv(ref)' ./charts/${CHARTS_SUBDIR}/values.yaml

sed -i "s|\(digest: \"${digest}\"\).*$|\1 # METADATA:: repository=https://github.com/GaloyMoney/${CHARTS_SUBDIR};commit_ref=${ref};app=${CHARTS_SUBDIR};|g" "./charts/${CHARTS_SUBDIR}/values.yaml"

yq -i e '.appVersion = strenv(app_version)' ./charts/${CHARTS_SUBDIR}/Chart.yaml

if [[ -z $(git config --global user.email) ]]; then
Expand Down

0 comments on commit 1b08ae9

Please sign in to comment.