Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Sep 7, 2024
1 parent 2ef6d28 commit 3f9f07b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 31 deletions.
55 changes: 29 additions & 26 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
Expand All @@ -49,7 +49,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
Expand All @@ -64,7 +64,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Make Manifests
- name: Make manifests
run: make -C operator manifests
- name: Check CRDs
run: |
Expand All @@ -77,12 +77,12 @@ jobs:
fi
buildtools:
name: Build Buildtools
name: Build buildtools
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
Expand All @@ -109,18 +109,18 @@ jobs:
with:
fetch-depth: 0

- name: Cache Melange
- name: Cache melange
uses: actions/cache@v4
with:
path: |
local-artifact-mirror/cache/.melange-cache
operator/cache/.melange-cache
key: melange-cache

- name: Setup Melange
- name: Setup melange
uses: chainguard-dev/actions/setup-melange@main

- name: Setup Go
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
Expand Down Expand Up @@ -152,15 +152,15 @@ jobs:
output/bin/embedded-cluster-original
output/bin/embedded-cluster-release-builder
- name: Export K0s Version
- name: Export K0s version
id: export
run: |
K0S_VERSION="$(make print-K0S_VERSION)"
echo "K0S_VERSION=\"$K0S_VERSION\""
echo "k0s_version=$K0S_VERSION" >> "$GITHUB_OUTPUT"
build-previous-k0s:
name: Build Previous K0s
name: Build previous K0s
runs-on: ubuntu-latest
needs:
- git-sha
Expand All @@ -172,18 +172,18 @@ jobs:
with:
fetch-depth: 0

- name: Cache Melange
- name: Cache melange
uses: actions/cache@v4
with:
path: |
local-artifact-mirror/cache/.melange-cache
operator/cache/.melange-cache
key: melange-cache

- name: Setup Melange
- name: Setup melange
uses: chainguard-dev/actions/setup-melange@main

- name: Setup Go
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
Expand Down Expand Up @@ -214,15 +214,15 @@ jobs:
output/bin/embedded-cluster-original
output/bin/embedded-cluster-release-builder
- name: Export K0s Version
- name: Export K0s version
id: export
run: |
K0S_VERSION="$(make print-PREVIOUS_K0S_VERSION)"
echo "K0S_VERSION=\"$K0S_VERSION\""
echo "k0s_version=$K0S_VERSION" >> "$GITHUB_OUTPUT"
build-upgrade:
name: Build Upgrade
name: Build upgrade
runs-on: ubuntu-latest
needs:
- git-sha
Expand All @@ -234,18 +234,18 @@ jobs:
with:
fetch-depth: 0

- name: Cache Melange
- name: Cache melange
uses: actions/cache@v4
with:
path: |
local-artifact-mirror/cache/.melange-cache
operator/cache/.melange-cache
key: melange-cache

- name: Setup Melange
- name: Setup melange
uses: chainguard-dev/actions/setup-melange@main

- name: Setup Go
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
Expand Down Expand Up @@ -276,15 +276,15 @@ jobs:
output/bin/embedded-cluster-original
output/bin/embedded-cluster-release-builder
- name: Export K0s Version
- name: Export K0s version
id: export
run: |
K0S_VERSION="$(make print-K0S_VERSION)"
echo "K0S_VERSION=\"$K0S_VERSION\""
echo "k0s_version=$K0S_VERSION" >> "$GITHUB_OUTPUT"
check-images:
name: Check Images
name: Check images
runs-on: ubuntu-latest
needs:
- buildtools
Expand Down Expand Up @@ -321,7 +321,7 @@ jobs:
fi
release-app:
name: Create App Releases
name: Create app releases
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand All @@ -335,7 +335,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Replicated CLI
- name: Install replicated CLI
run: |
curl --retry 5 --retry-all-errors -fs https://api.github.com/repos/replicatedhq/replicated/releases/latest \
| grep "browser_download_url.*linux_amd64.tar.gz" \
Expand All @@ -344,7 +344,7 @@ jobs:
| wget -O replicated.tar.gz -qi -
tar xf replicated.tar.gz replicated && rm replicated.tar.gz
mv replicated /usr/local/bin/replicated
- name: Create CI Releases
- name: Create CI releases
env:
REPLICATED_APP: "embedded-cluster-smoke-test-staging-app"
REPLICATED_API_TOKEN: ${{ secrets.STAGING_REPLICATED_API_TOKEN }}
Expand Down Expand Up @@ -377,7 +377,7 @@ jobs:
export RELEASE_YAML_DIR=e2e/kots-release-upgrade
./scripts/ci-release-app.sh
- name: Create Airgap Release
- name: Create airgap releases
env:
REPLICATED_APP: "embedded-cluster-smoke-test-staging-app"
REPLICATED_API_TOKEN: ${{ secrets.STAGING_REPLICATED_API_TOKEN }}
Expand Down Expand Up @@ -422,14 +422,15 @@ jobs:
echo "Happy debugging!" >> download-link.txt
cat download-link.txt
- name: comment download link
- name: Comment download link
if: github.event_name == 'pull_request'
uses: mshick/add-pr-comment@v2
with:
message-path: download-link.txt

# e2e-docker runs the e2e tests inside a docker container rather than a full VM
e2e-docker:
name: E2E docker
runs-on: ubuntu-latest
needs:
- build-current
Expand All @@ -446,7 +447,7 @@ jobs:
with:
name: current-release
path: output/bin
- name: Setup Go
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
Expand All @@ -461,6 +462,7 @@ jobs:
make e2e-test TEST_NAME=${{ matrix.test }}
e2e:
name: E2E
runs-on: ${{ matrix.runner || 'ubuntu-latest' }}
needs:
- build-current
Expand Down Expand Up @@ -547,6 +549,7 @@ jobs:
# this job will validate that all the tests passed
# it is used for the github branch protection rule
validate-success:
name: Validate success
runs-on: ubuntu-20.04
needs:
- e2e
Expand Down
4 changes: 3 additions & 1 deletion scripts/ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set -euo pipefail
EC_VERSION=${EC_VERSION:-}
K0S_VERSION=${K0S_VERSION:-}
S3_BUCKET="${S3_BUCKET:-dev-embedded-cluster-bin}"
IMAGES_REGISTRY_SERVER=${IMAGES_REGISTRY_SERVER:-ttl.sh}

require S3_BUCKET "${S3_BUCKET:-}"

Expand Down Expand Up @@ -46,6 +47,7 @@ function binary() {
METADATA_KOTS_BINARY_URL_OVERRIDE="$kots_binary_url" \
METADATA_OPERATOR_BINARY_URL_OVERRIDE="$operator_binary_url" \
LOCAL_ARTIFACT_MIRROR_IMAGE="$local_artifact_mirror_image"
cp output/bin/embedded-cluster output/bin/embedded-cluster-original
}

function update_operator_metadata() {
Expand All @@ -69,7 +71,7 @@ function update_operator_metadata() {
INPUT_OPERATOR_CHART_VERSION=$(echo "$operator_chart" | rev | cut -d':' -f1 | rev)
INPUT_OPERATOR_IMAGE=$(echo "$operator_image" | cut -d':' -f1)

export IMAGES_REGISTRY_SERVER=ttl.sh
export IMAGES_REGISTRY_SERVER
export INPUT_OPERATOR_CHART_URL
export INPUT_OPERATOR_CHART_VERSION
export INPUT_OPERATOR_IMAGE
Expand Down
1 change: 1 addition & 0 deletions scripts/ci-update-operator-metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -euo pipefail
# shellcheck source=./common.sh
source ./scripts/common.sh

require IMAGES_REGISTRY_SERVER "${IMAGES_REGISTRY_SERVER:-}"
require OPERATOR_CHART "${OPERATOR_CHART:-}"
require OPERATOR_IMAGE "${OPERATOR_IMAGE:-}"

Expand Down
12 changes: 8 additions & 4 deletions scripts/dev-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ REPLICATED_API_ORIGIN=${REPLICATED_API_ORIGIN:-https://api.staging.replicated.co

ARCH=${ARCH:-amd64}
USE_CHAINGUARD=${USE_CHAINGUARD:-0}
DO_RELEASE=${DO_RELEASE:-1}

require REPLICATED_APP "${REPLICATED_APP:-}"
require REPLICATED_API_TOKEN "${REPLICATED_API_TOKEN:-}"
require REPLICATED_API_ORIGIN "${REPLICATED_API_ORIGIN:-}"
require AWS_ACCESS_KEY_ID "${AWS_ACCESS_KEY_ID:-}"
require AWS_SECRET_ACCESS_KEY "${AWS_SECRET_ACCESS_KEY:-}"

DO_RELEASE=${DO_RELEASE:-1}

if [ "$DO_RELEASE" == "1" ]; then
require REPLICATED_APP "${REPLICATED_APP:-}"
require REPLICATED_API_TOKEN "${REPLICATED_API_TOKEN:-}"
require REPLICATED_API_ORIGIN "${REPLICATED_API_ORIGIN:-}"
fi

export EC_VERSION APP_VERSION APP_CHANNEL RELEASE_YAML_DIR ARCH USE_CHAINGUARD
export REPLICATED_API_ORIGIN REPLICATED_APP REPLICATED_API_TOKEN AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY

Expand Down

0 comments on commit 3f9f07b

Please sign in to comment.