Skip to content

Commit c147a20

Browse files
authored
Configure standard project build structure (#2)
Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent e0bd670 commit c147a20

Some content is hidden

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

54 files changed

+1092
-995
lines changed

.github/.kodiak.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version = 1
2+
3+
[merge]
4+
method = "squash" # default: "merge"
5+
delete_branch_on_merge = true # default: false
6+
optimistic_updates = true # default: true
7+
prioritize_ready_to_merge = true # default: false
8+
9+
[merge.message]
10+
title = "pull_request_title" # default: "github_default"
11+
body = "github_default" # default: "github_default"
12+
strip_html_comments = true # default: false
13+
14+
[update]
15+
always = true # default: false
16+
17+
[approve]
18+
auto_approve_usernames = ["1gtm", "tamalsaha"]

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
push:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
name: Build
19+
runs-on: ubuntu-20.04
20+
steps:
21+
22+
- name: Set up Go 1.20
23+
uses: actions/setup-go@v1
24+
with:
25+
go-version: '1.20'
26+
id: go
27+
28+
- uses: actions/checkout@v2
29+
30+
- name: Set up QEMU
31+
id: qemu
32+
uses: docker/setup-qemu-action@v1
33+
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v1
36+
37+
- name: Run checks
38+
run: |
39+
make ci

.github/workflows/release-tracker.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: release-tracker
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-20.04
15+
16+
steps:
17+
- uses: actions/checkout@v1
18+
19+
- name: Prepare git
20+
env:
21+
GITHUB_USER: 1gtm
22+
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
23+
run: |
24+
git config --global user.name "${GITHUB_USER}"
25+
git config --global user.email "${GITHUB_USER}@appscode.com"
26+
git remote set-url origin https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
27+
28+
- name: Install GitHub CLI
29+
run: |
30+
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
31+
sudo mv bin/hub /usr/local/bin
32+
33+
- name: Update release tracker
34+
if: |
35+
github.event.action == 'closed' &&
36+
github.event.pull_request.merged == true
37+
env:
38+
GITHUB_USER: 1gtm
39+
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
40+
run: |
41+
./hack/scripts/update-release-tracker.sh

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*.*"
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
name: Build
17+
runs-on: ubuntu-20.04
18+
steps:
19+
- uses: actions/checkout@v1
20+
21+
- name: Print version info
22+
id: semver
23+
run: |
24+
make version
25+
26+
- name: Set up QEMU
27+
id: qemu
28+
uses: docker/setup-qemu-action@v1
29+
30+
- name: Set up Docker Buildx
31+
uses: docker/setup-buildx-action@v1
32+
33+
- name: Publish to GitHub Container Registry
34+
env:
35+
REGISTRY: ghcr.io/appscode
36+
DOCKER_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
37+
USERNAME: 1gtm
38+
APPSCODE_ENV: prod
39+
run: |
40+
docker login ghcr.io --username ${USERNAME} --password ${DOCKER_TOKEN}
41+
make release
42+
43+
- name: Release
44+
uses: softprops/action-gh-release@v1
45+
if: startsWith(github.ref, 'refs/tags/')
46+
with:
47+
files: |
48+
bin/docker-machine-operator-linux-amd64
49+
bin/docker-machine-operator-linux-arm64
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

DCO

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Developer Certificate of Origin
2+
Version 1.1
3+
4+
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
5+
660 York Street, Suite 102,
6+
San Francisco, CA 94110 USA
7+
8+
Everyone is permitted to copy and distribute verbatim copies of this
9+
license document, but changing it is not allowed.
10+
11+
12+
Developer's Certificate of Origin 1.1
13+
14+
By making a contribution to this project, I certify that:
15+
16+
(a) The contribution was created in whole or in part by me and I
17+
have the right to submit it under the open source license
18+
indicated in the file; or
19+
20+
(b) The contribution is based upon previous work that, to the best
21+
of my knowledge, is covered under an appropriate open source
22+
license and I have the right under that license to submit that
23+
work with modifications, whether created in whole or in part
24+
by me, under the same open source license (unless I am
25+
permitted to submit under a different license), as indicated
26+
in the file; or
27+
28+
(c) The contribution was provided directly to me by some other
29+
person who certified (a), (b) or (c) and I have not modified
30+
it.
31+
32+
(d) I understand and agree that this project and the contribution
33+
are public and that a record of the contribution (including all
34+
personal information I submit with it, including my sign-off) is
35+
maintained indefinitely and may be redistributed consistent with
36+
this project or the open source license(s) involved.

Dockerfile

Lines changed: 0 additions & 33 deletions
This file was deleted.

Dockerfile.dbg

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright AppsCode Inc. and Contributors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM ghcr.io/appscode/dlv:1.20.1
16+
17+
FROM {ARG_FROM}
18+
19+
LABEL org.opencontainers.image.source https://github.com/cluster-api/docker-machine-operator
20+
21+
RUN set -x \
22+
&& apt-get update \
23+
&& apt-get upgrade -y \
24+
&& apt-get install -y --no-install-recommends ca-certificates \
25+
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man /tmp/* \
26+
&& echo 'Etc/UTC' > /etc/timezone
27+
28+
ADD bin/{ARG_BIN}-{ARG_OS}-{ARG_ARCH} /{ARG_BIN}
29+
COPY --from=0 /usr/local/bin/dlv /bin/dlv
30+
31+
EXPOSE 40000
32+
33+
ENTRYPOINT ["/bin/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "exec", "/{ARG_BIN}", "--"]

Dockerfile.in

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright AppsCode Inc. and Contributors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM {ARG_FROM}
16+
17+
LABEL org.opencontainers.image.source https://github.com/cluster-api/docker-machine-operator
18+
19+
RUN set -x \
20+
&& apk add --update --upgrade --no-cache pcre2 ca-certificates tzdata \
21+
&& echo 'Etc/UTC' > /etc/timezone
22+
23+
ADD bin/{ARG_BIN}-{ARG_OS}-{ARG_ARCH} /{ARG_BIN}
24+
25+
USER 65534
26+
27+
ENTRYPOINT ["/{ARG_BIN}"]

0 commit comments

Comments
 (0)