Merge pull request #1066 from fluxcd/manifest-bundle-tweaks

pull/1069/head
Hidde Beydals 4 years ago committed by GitHub
commit a4b9191fa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12,7 +12,7 @@ provides=("flux-bin")
conflicts=("flux-bin") conflicts=("flux-bin")
replaces=("flux-cli") replaces=("flux-cli")
depends=("glibc") depends=("glibc")
makedepends=("go") makedepends=('go>=1.16', 'kustomize>=3.0')
optdepends=('kubectl: for apply actions on the Kubernetes cluster', optdepends=('kubectl: for apply actions on the Kubernetes cluster',
'bash-completion: auto-completion for flux in Bash', 'bash-completion: auto-completion for flux in Bash',
'zsh-completions: auto-completion for flux in ZSH') 'zsh-completions: auto-completion for flux in ZSH')
@ -30,8 +30,9 @@ build() {
export CGO_CFLAGS="$CFLAGS" export CGO_CFLAGS="$CFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS" export CGO_CXXFLAGS="$CXXFLAGS"
export CGO_CPPFLAGS="$CPPFLAGS" export CGO_CPPFLAGS="$CPPFLAGS"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
go build -ldflags "-X main.VERSION=${pkgver}" -o ${_srcname} ./cmd/flux ./manifests/scripts/bundle.sh "${PWD}/manifests" "${PWD}/cmd/flux/manifests"
go build -ldflags "-linkmode=external -X main.VERSION=${pkgver}" -o ${_srcname} ./cmd/flux
} }
check() { check() {

@ -11,7 +11,7 @@ license=("APACHE")
provides=("flux-bin") provides=("flux-bin")
conflicts=("flux-bin") conflicts=("flux-bin")
depends=("glibc") depends=("glibc")
makedepends=("go") makedepends=('go>=1.16', 'kustomize>=3.0')
optdepends=('kubectl: for apply actions on the Kubernetes cluster', optdepends=('kubectl: for apply actions on the Kubernetes cluster',
'bash-completion: auto-completion for flux in Bash', 'bash-completion: auto-completion for flux in Bash',
'zsh-completions: auto-completion for flux in ZSH') 'zsh-completions: auto-completion for flux in ZSH')
@ -32,8 +32,9 @@ build() {
export CGO_CFLAGS="$CFLAGS" export CGO_CFLAGS="$CFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS" export CGO_CXXFLAGS="$CXXFLAGS"
export CGO_CPPFLAGS="$CPPFLAGS" export CGO_CPPFLAGS="$CPPFLAGS"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
go build -ldflags "-X main.VERSION=${pkgver}" -o ${_srcname} ./cmd/flux make cmd/flux/manifests
go build -ldflags "-linkmode=external -X main.VERSION=${pkgver}" -o ${_srcname} ./cmd/flux
} }
check() { check() {

@ -31,7 +31,7 @@ jobs:
- name: Generate manifests - name: Generate manifests
run: | run: |
make cmd/flux/manifests make cmd/flux/manifests
./manifests/scripts/bundle.sh ./output manifests.tar.gz ./manifests/scripts/bundle.sh "" ./output manifests.tar.gz
kustomize build ./manifests/install > ./output/install.yaml kustomize build ./manifests/install > ./output/install.yaml
- name: Run GoReleaser - name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1 uses: goreleaser/goreleaser-action@v1

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2020 The Flux authors. All rights reserved. # Copyright 2020, 2021 The Flux authors. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -16,9 +16,9 @@
set -e set -e
REPO_ROOT=$(git rev-parse --show-toplevel) IN_PATH=${1:-"$(git rev-parse --show-toplevel)/manifests"}
OUT_PATH=${1:-"${REPO_ROOT}/cmd/flux/manifests"} OUT_PATH=${2:-"$(git rev-parse --show-toplevel)/cmd/flux/manifests"}
TAR=${2} TAR=${3}
info() { info() {
echo '[INFO] ' "$@" echo '[INFO] ' "$@"
@ -45,20 +45,20 @@ files=""
info using "$(kustomize version --short)" info using "$(kustomize version --short)"
# build controllers # build controllers
for controller in ${REPO_ROOT}/manifests/bases/*/; do for controller in ${IN_PATH}/bases/*/; do
output_path="${OUT_PATH}/$(basename $controller).yaml" output_path="${OUT_PATH}/$(basename $controller).yaml"
build $controller $output_path build $controller $output_path
files+=" $(basename $output_path)" files+=" $(basename $output_path)"
done done
# build rbac # build rbac
rbac_path="${REPO_ROOT}/manifests/rbac" rbac_path="${IN_PATH}/rbac"
rbac_output_path="${OUT_PATH}/rbac.yaml" rbac_output_path="${OUT_PATH}/rbac.yaml"
build $rbac_path $rbac_output_path build $rbac_path $rbac_output_path
files+=" $(basename $rbac_output_path)" files+=" $(basename $rbac_output_path)"
# build policies # build policies
policies_path="${REPO_ROOT}/manifests/policies" policies_path="${IN_PATH}/policies"
policies_output_path="${OUT_PATH}/policies.yaml" policies_output_path="${OUT_PATH}/policies.yaml"
build $policies_path $policies_output_path build $policies_path $policies_output_path
files+=" $(basename $policies_output_path)" files+=" $(basename $policies_output_path)"

Loading…
Cancel
Save