Skip to content

Commit 232034b

Browse files
committed
setup CI and renovate
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
1 parent 84ae302 commit 232034b

File tree

6 files changed

+74
-4
lines changed

6 files changed

+74
-4
lines changed

.github/renovate.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended",
5+
"regexManagers:dockerfileVersions"
6+
]
7+
}
8+

.github/workflows/ci.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Docker Image
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags:
7+
- '*'
8+
pull_request:
9+
branches: [ main ]
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v1
20+
21+
- name: Build Docker image
22+
run: make docker-build
23+
24+
- name: Log in to Docker Hub
25+
if: startsWith(github.ref, 'refs/tags/')
26+
uses: docker/login-action@v1
27+
with:
28+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
29+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
30+
31+
- name: Push Docker image
32+
if: startsWith(github.ref, 'refs/tags/')
33+
run: make docker-push

.github/workflows/renovate.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Renovate Bot
2+
3+
on:
4+
# schedule:
5+
# - cron: '0 * * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
renovate:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Run Renovate
17+
uses: renovatebot/github-action@v40.1.2
18+
env:
19+
# RENOVATE_DRY_RUN: true
20+
RENOVATE_REPOSITORIES: linka-cloud/docker-machine-driver-scaleway
21+
RENOVATE_TOKEN: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }}

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ RUN apk add --no-cache git
1717

1818
WORKDIR /go/src/github.com/docker/machine
1919

20-
RUN git clone --branch=v0.16.2-gitlab.21 https://gitlab.com/gitlab-org/ci-cd/docker-machine .
20+
ARG DOCKER_MACHINE_VERSION=v0.16.2-gitlab.21
21+
22+
RUN git clone --branch=${DOCKER_MACHINE_VERSION} https://gitlab.com/gitlab-org/ci-cd/docker-machine .
2123
RUN CGO_ENABLED=0 GO111MODULE=off go build -o docker-machine -trimpath -ldflags="-s -w" ./cmd/docker-machine
2224

2325

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
DOCKER_MACHINE_IMAGE := linkacloud/docker-machine-scaleway
22
RUNNER_IMAGE := linkacloud/gitlab-runner-docker-machine-scaleway
33

4+
# renovate: datasource=gitlab-tags depName=gitlab/gitlab-runner versioning=semver
5+
RUNNER_VERSION := v16.8.0
6+
47
docker: docker-build docker-push
58

69
docker-build:
710
@docker build -t $(DOCKER_MACHINE_IMAGE) .
8-
@docker build -t $(RUNNER_IMAGE) -f gitlab-runner.Dockerfile .
11+
@docker build -t $(RUNNER_IMAGE):$(RUNNER_VERSION) -f gitlab-runner.Dockerfile .
912
docker-push:
1013
@docker push $(DOCKER_MACHINE_IMAGE)
11-
@docker push $(RUNNER_IMAGE)
14+
@docker push $(RUNNER_IMAGE):$(RUNNER_VERSION)

gitlab-runner.Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ RUN apk add --no-cache git
1717

1818
WORKDIR /go/src/github.com/docker/machine
1919

20-
RUN git clone --branch=v0.16.2-gitlab.21 https://gitlab.com/gitlab-org/ci-cd/docker-machine .
20+
# renovate: datasource=gitlab-tags depName=gitlab-org/ci-cd/docker-machine versioning=semver
21+
ARG DOCKER_MACHINE_VERSION=v0.16.2-gitlab.21
22+
23+
RUN git clone --branch=${DOCKER_MACHINE_VERSION} https://gitlab.com/gitlab-org/ci-cd/docker-machine .
2124
RUN CGO_ENABLED=0 GO111MODULE=off go build -o docker-machine -trimpath -ldflags="-s -w" ./cmd/docker-machine
2225

2326

0 commit comments

Comments
 (0)