-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (137 loc) · 4.77 KB
/
build-druid.yml
File metadata and controls
150 lines (137 loc) · 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: build-druid
on:
schedule:
- cron: '0 0 */14 * *'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tag: [36.0.0, 35.0.1, 31.0.0, 30.0.1, 28.0.1]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Prepare git
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
run: |
set -x
git config --global user.name "1gtm"
git config --global user.email "1gtm@appscode.com"
git config --global \
url."https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com".insteadOf \
"https://github.com"
# git remote set-url origin https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
cache-image: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- uses: imjasonh/setup-crane@v0.1
- name: Install trivy
run: |
# wget https://github.com/aquasecurity/trivy/releases/download/v0.18.3/trivy_0.18.3_Linux-64bit.deb
# sudo dpkg -i trivy_0.18.3_Linux-64bit.deb
sudo apt-get install -y --no-install-recommends wget apt-transport-https gnupg lsb-release
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | gpg --dearmor | sudo tee /usr/share/keyrings/trivy.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/trivy.gpg] https://aquasecurity.github.io/trivy-repo/deb generic main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update
sleep 5
sudo apt-get install -y --no-install-recommends trivy
- name: Log in to the GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Setup upterm session
# uses: lhotari/action-upterm@v1
- name: Build
run: |
go run cmd/build-image/main.go --name=druid --tag=${{ matrix.tag }}
# report:
# name: Report
# runs-on: ubuntu-latest
# needs: build
# if: always()
# steps:
# - uses: actions/checkout@v4
#
# - name: Set up Go
# uses: actions/setup-go@v5
# with:
# go-version: '1.25'
#
# - name: Prepare git
# env:
# GITHUB_USER: 1gtm
# GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
# run: |
# set -x
# git config --global user.name "1gtm"
# git config --global user.email "1gtm@appscode.com"
# git config --global \
# url."https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com".insteadOf \
# "https://github.com"
# # git remote set-url origin https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
#
# - name: Set up QEMU
# id: qemu
# uses: docker/setup-qemu-action@v3
# with:
# cache-image: false
#
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# with:
# platforms: linux/amd64,linux/arm64
#
# - name: Log in to the GitHub Container registry
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Install trivy
# run: |
# # wget https://github.com/aquasecurity/trivy/releases/download/v0.18.3/trivy_0.18.3_Linux-64bit.deb
# # sudo dpkg -i trivy_0.18.3_Linux-64bit.deb
# sudo apt-get install -y --no-install-recommends wget apt-transport-https gnupg lsb-release
# wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
# echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list
# sudo apt-get update
# sudo apt-get install -y --no-install-recommends trivy
#
# - name: Build
# env:
# SMTP_ADDRESS: ${{ secrets.SMTP_ADDRESS }}
# SMTP_USERNAME: ${{ secrets.SMTP_USERNAME }}
# SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
# run: |
# go run cmd/mail-report/main.go --name=druid
#
# - name: Update repo
# run: |
# git add --all
# if [[ $(git status --porcelain) ]]; then
# git commit -s -a -m "update druid images $(date --rfc-3339=date)"
# git fetch origin
# # https://git-scm.com/docs/merge-strategies
# git pull --rebase -s ours origin master
# git push origin HEAD
# fi