Skip to content

Commit

Permalink
Merge pull request #730 from opendevstack/feature/easy-install
Browse files Browse the repository at this point in the history
Simple Install
  • Loading branch information
michaelsauter committed Oct 2, 2023
2 parents 0c85d2d + 8ff845e commit ce04f93
Show file tree
Hide file tree
Showing 11 changed files with 213 additions and 288 deletions.
43 changes: 22 additions & 21 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
pull_request:

env:
# github.repository as <account>/<repo>
IMAGE_BASE: ${{ github.repository }}

jobs:
Expand All @@ -32,23 +31,25 @@ jobs:
name: Run tests
run: |
make test
# -
# name: Log into ghcr.io
# if: ${{ github.event_name != 'pull_request' }}
# uses: docker/login-action@v1
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# -
# name: Push images to ghcr.io
# if: ${{ github.event_name != 'pull_request' }}
# run: |
# images=(${{ env.IMAGES }})
# for image in ${images[*]}
# do
# echo "::group::Push ods-$image to ghcr.io"
# docker tag localhost:5000/ods/ods-$image:latest ghcr.io/${{ env.IMAGE_BASE }}/ods-$image:latest
# docker push ghcr.io/${{ env.IMAGE_BASE }}/ods-$image:latest
# echo "::endgroup::"
# done
-
name: Log into ghcr.io
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Push images to ghcr.io
if: ${{ github.event_name != 'pull_request' }}
env:
IMAGES: finish pipeline-manager start
run: |
images=(${{ env.IMAGES }})
for image in ${images[*]}
do
echo "::group::Push $image to ghcr.io"
docker tag localhost:5000/ods-pipeline/$image:latest ghcr.io/${{ env.IMAGE_BASE }}/$image:latest
docker push ghcr.io/${{ env.IMAGE_BASE }}/$image:latest
echo "::endgroup::"
done
30 changes: 24 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Release images
name: Release images and chart
on:
release:
types:
- released

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_BASE: ${{ github.repository }}

jobs:
Expand All @@ -23,7 +21,7 @@ jobs:
outputs:
imageTag: ${{ steps.createImageTag.outputs.imageTag }}

build:
release-images:
name: Build and release images
needs: setup
runs-on: ubuntu-latest
Expand All @@ -37,8 +35,8 @@ jobs:
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
Expand All @@ -63,3 +61,23 @@ jobs:
file: build/package/Dockerfile.${{ matrix.image }}
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_BASE }}/ods-${{ matrix.image }}:${{ needs.setup.outputs.imageTag }}

release-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.5.0
with:
charts_dir: deploy
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ listed in the changelog.

- Move pipeline tasks to separate repositories. This is a huge change with many implications. Instead of providing build, package and deploy taks as part of the `ods-pipeline` repository, the tasks are no provided by separate repositories, such as `ods-pipeline-go`, `ods-pipeline-sonar`, `ods-pipeline-image`, `ods-pipeline-helm` and so on. The only tasks that are provided by `ods-pipeline` are the start and finish tasks automatically injected into each pipeline. This change allows to have a different lifecycle for each task (or set of tasks). It also benefits maintenance greatly: running the tests for this repository is much faster now (around 10 minutes compared to 35+ minutes earlier). This repository facilitates task creation, maintenance and testing by providing a few Go packages that can be used by task repositories such as `ods-pipeline-helm`. For more information, see [#722](https://github.com/opendevstack/ods-pipeline/pull/722).

- Build tasks streamlining and avoidance of file copies (#678 fixed by [#710](https://github.com/opendevstack/ods-pipeline/pull/710)). This is an incompatible change. Build tasks were adjusted to (mostly) no longer copy build files in a dedicated location. Instead one should adjust the Dockerfile (or other downstream tasks) to directly consume the build outputs from their natural locations. In addition build task skipping now supports parameter `build-extra-inputs`. The package-image task `dockerfile` and `docker-dir` parameters have been changed to assume that the docker context and file are at the repository root. See the PR for further information and the issue for more context.
- Publish Helm chart and adjust install script to install from there. Instead of requiring users to create a local repository, using `git subtree`` to include the `deploy`` folder, and installing from the local chart, the install script now uses the published chart. This greatly simplifies the installation and upgrade procedure. See [#730](https://github.com/opendevstack/ods-pipeline/pull/730).

- Build tasks streamlining and avoidance of file copies (#678 fixed by [#710](https://github.com/opendevstack/ods-pipeline/pull/710)). This is an incompatible change. Build tasks were adjusted to (mostly) no longer copy build files in a dedicated location. Instead one should adjust the Dockerfile (or other downstream tasks) to directly consume the build outputs from their natural locations. In addition build task skipping now supports parameter `build-extra-inputs`. The package-image task `dockerfile` and `docker-dir` parameters have been changed to assume that the docker context and file are at the repository root. See the PR for further information and the issue for more context. Note that these changes affect the extracted tasks, as described above.

## [0.13.2] - 2023-07-18

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ lint-go: ## Run golangci-lint.
.PHONY: lint-go

lint-shell: ## Run shellcheck.
shellcheck scripts/*.sh build/package/scripts/* deploy/*.sh
shellcheck scripts/*.sh build/images/scripts/* deploy/*.sh
.PHONY: lint-shell

docs: ## Render documentation for tasks.
Expand Down
10 changes: 0 additions & 10 deletions deploy/basic-auth-secret.yaml.tmpl

This file was deleted.

4 changes: 2 additions & 2 deletions deploy/chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.13.2
version: 0.14.0-preview.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.13.2"
appVersion: "0.14.0-preview.1"
Loading

0 comments on commit ce04f93

Please sign in to comment.