Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rpi builds of .deb packages and arm copies #123

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions pipelines/package_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,18 @@ func BuildPackage(ctx context.Context, d *dagger.Client, src *dagger.Directory,
)
if isEnterprise {
edition = "enterprise"
// If the user has manually set the edition flag, then override it with their selection.
// Temporary fix: to avoid creating a --grafana and a --enterprise package with a conflicting name, only allow
// overriding the 'edition' if we're building enterprise.
if e := args.PackageOpts.Edition; e != "" {
edition = e
}
s, err := args.GrafanaOpts.Enterprise(ctx, src, d)
if err != nil {
return err
}
src = s
}

// If the user has manually set the edition flag, then override it with their selection.
if e := args.PackageOpts.Edition; e != "" {
edition = e
}

opts := PackageOpts{
GrafanaCompileOpts: &GrafanaCompileOpts{
Source: src,
Expand Down
9 changes: 6 additions & 3 deletions pipelines/package_installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,20 @@ func PackageInstaller(ctx context.Context, d *dagger.Client, args PipelineArgs,
fpmArgs = append(fpmArgs, fmt.Sprintf("--architecture=%s", arch))
}

// Honestly we don't care about making fpm installers for non-enterprise or non-grafana flavors of grafana
if tarOpts.Edition == "enterprise" {
fpmArgs = append(fpmArgs, fmt.Sprintf("--name=grafana-%s", tarOpts.Edition))
fpmArgs = append(fpmArgs, "--description=\"Grafana Enterprise\"")
fpmArgs = append(fpmArgs, "--conflicts=grafana")
} else {
fpmArgs = append(fpmArgs, "--name=grafana")
fpmArgs = append(fpmArgs, "--description=Grafana")
fpmArgs = append(fpmArgs, "--license=agpl3")
}

if tarOpts.Edition != "" {
fpmArgs = append(fpmArgs, fmt.Sprintf("--name=grafana-%s", tarOpts.Edition))
} else {
fpmArgs = append(fpmArgs, "--name=grafana")
}

// The last fpm arg which is required to say, "use the PWD to build the package".
fpmArgs = append(fpmArgs, ".")

Expand Down
13 changes: 13 additions & 0 deletions scripts/drone_publish_tag_grafana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ dagger run --silent go run ./cmd \
--destination=${local_dst} \
--gcp-service-account-key-base64=${GCP_KEY_BASE64} > assets.txt

dagger run --silent go run ./cmd \
package \
--yarn-cache=${YARN_CACHE_FOLDER} \
--distro=linux/arm/v7 \
--checksum \
--build-id=${DRONE_BUILD_NUMBER} \
--grafana-dir=${GRAFANA_DIR} \
--github-token=${GITHUB_TOKEN} \
--version=${DRONE_TAG} \
--edition=rpi \
--destination=${local_dst} \
--gcp-service-account-key-base64=${GCP_KEY_BASE64} >> assets.txt

echo "Done building tar.gz packages..."
cat assets.txt

Expand Down
1 change: 1 addition & 0 deletions scripts/drone_publish_tag_pro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dagger run go run ./cmd \
package \
--yarn-cache=${YARN_CACHE_FOLDER} \
--distro=linux/amd64 \
--distro=linux/arm64 \
--env GO_BUILD_TAGS=pro \
--env WIRE_TAGS=pro \
--go-tags=pro \
Expand Down
Loading