Skip to content

Commit 41e3480

Browse files
author
xavier
committed
desktop-client-releaser first reun
1 parent ffa2c01 commit 41e3480

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+47
-2164
lines changed

desktop-client-releaser/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deb_release.deb
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
source 'https://rubygems.org'
22
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3+
4+
35
ruby '2.6.3'
4-
gem "activesupport"
5-
gem 'http'
6-
gem 'kerbi', '>= 1.1.34'
6+
7+
gem "octokit", "~> 4.0"
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
steps:
2+
- name: gcr.io/cloud-builders/gcloud
3+
entrypoint: bash
4+
args: ["-c", "gsutil"]

desktop-client-releaser/main.rb

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
require 'octokit'
2+
3+
REPO_ID = "nmachine-io/consumer-frontend-desktop"
4+
GH_SEC_NAME = "gh-token-delete-me-later"
5+
DEB_NAME = "deb_release.deb"
6+
WGET_PREFIX = "wget -q --auth-no-challenge --header='Accept:application/octet-stream'"
7+
BUCKET_PREFIX = "gs://nmachine-public/releases"
8+
9+
RELEASE_TYPES = [
10+
{ extension: ".deb", fname: DEB_NAME }
11+
]
12+
13+
token = `gcloud secrets versions access latest --secret=#{GH_SEC_NAME}`
14+
client = Octokit::Client.new(access_token: token)
15+
16+
releases = client.releases(REPO_ID, query: { type: 'created_at', sort: 'asc' })
17+
latest_release = releases.first
18+
19+
if latest_release
20+
release_assets = latest_release[:assets] || []
21+
22+
RELEASE_TYPES.each do |release_definition|
23+
extension, fname = release_definition.values_at(:extension, :fname)
24+
25+
asset = release_assets.find { |a| a[:name].end_with?(extension) }
26+
authenticated_dl_url = asset[:url].gsub("//", "//#{token}:@")
27+
28+
download_cmd = "#{WGET_PREFIX} #{authenticated_dl_url} -O #{fname}"
29+
puts "Downloading #{extension} into #{fname}..."
30+
system download_cmd
31+
32+
puts "Uploading #{extension} to #{fname} #{BUCKET_PREFIX}/#{fname}..."
33+
upload_cmd = "gsutil cp #{fname} #{BUCKET_PREFIX}/#{fname}"
34+
system upload_cmd
35+
end
36+
else
37+
puts "Repo has no latest release :/"
38+
end

prom-plugin/kerbi/Dockerfile

-6
This file was deleted.

prom-plugin/kerbi/Gemfile.lock

-55
This file was deleted.

prom-plugin/kerbi/cloudbuild.yaml

-15
This file was deleted.

prom-plugin/kerbi/main.rb

-11
This file was deleted.

prom-plugin/kerbi/values.yaml

-1
This file was deleted.

telem-plugin/app/.dockerignore

-2
This file was deleted.

telem-plugin/app/.gitignore

-2
This file was deleted.

telem-plugin/app/Dockerfile

-22
This file was deleted.

telem-plugin/app/Pipfile

-13
This file was deleted.

telem-plugin/app/Pipfile.lock

-180
This file was deleted.

0 commit comments

Comments
 (0)