File tree Expand file tree Collapse file tree 7 files changed +121
-21
lines changed
actions/build-push-lvp-image Expand file tree Collapse file tree 7 files changed +121
-21
lines changed Original file line number Diff line number Diff line change
1
+ name : ' Build and push local-volume-provider image'
2
+ description : ' Composite action for building and pushing local-volume-provider image'
3
+ inputs :
4
+ image-name :
5
+ description : ' Full destination local-volume-provider image name'
6
+ required : true
7
+
8
+ git-tag :
9
+ description : ' Git tag'
10
+ required : true
11
+
12
+ registry-username :
13
+ description : ' Username to login to registry'
14
+ default : ' '
15
+ required : false
16
+
17
+ registry-password :
18
+ description : ' Password to login to registry'
19
+ default : ' '
20
+ required : false
21
+
22
+ runs :
23
+ using : " composite"
24
+ steps :
25
+ - name : template melange and apko configs
26
+ shell : bash
27
+ run : |
28
+ export GIT_TAG=${{ inputs.git-tag }}
29
+ envsubst '${GIT_TAG}' < deploy/melange.yaml.tmpl > deploy/melange.yaml
30
+ envsubst '${GIT_TAG}' < deploy/apko.yaml.tmpl > deploy/apko.yaml
31
+
32
+ - id : cache-dir
33
+ shell : bash
34
+ run : echo "cache_dir=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
35
+
36
+ - uses : chainguard-dev/actions/melange-build@main
37
+ with :
38
+ config : deploy/melange.yaml
39
+ archs : x86_64
40
+ sign-with-temporary-key : true
41
+ cache-dir : ${{ steps.cache-dir.outputs.cache_dir }}
42
+
43
+ - uses : chainguard-images/actions/apko-publish@main
44
+ with :
45
+ config : deploy/apko.yaml
46
+ archs : x86_64
47
+ tag : ${{ inputs.image-name }}
48
+ vcs-url : true
49
+ generic-user : ${{ inputs.registry-username }}
50
+ generic-pass : ${{ inputs.registry-password }}
Original file line number Diff line number Diff line change @@ -36,14 +36,15 @@ jobs:
36
36
- name : Checkout
37
37
uses : actions/checkout@v3
38
38
39
- - name : Build local-volume-provider image from Dockerfile
40
- run : |
41
- docker build --pull -t replicated/local-volume-provider:${{ github.sha }} -f deploy/local-volume-provider/Dockerfile --build-arg VERSION=${{ github.sha }} .
42
-
39
+ - uses : ./.github/actions/build-push-lvp-image
40
+ with :
41
+ image-name : ttl.sh/automated-${{ github.run_id }}/local-volume-provider:${{ github.sha }}
42
+ git-tag : ${{ github.sha }}
43
+
43
44
- name : Run Trivy vulnerability scanner
44
45
uses : aquasecurity/trivy-action@master
45
46
with :
46
- image-ref : ' replicated /local-volume-provider:${{ github.sha }}'
47
+ image-ref : ' ttl.sh/automated-${{ github.run_id }} /local-volume-provider:${{ github.sha }}'
47
48
format : ' sarif'
48
49
output : ' trivy-results.sarif'
49
50
ignore-unfixed : true
Original file line number Diff line number Diff line change 15
15
id : get_tag
16
16
shell : bash
17
17
run : echo ::set-output name=GIT_TAG::${GITHUB_REF/refs\/tags\//}
18
- - uses : azure/docker-login@v1
19
- env :
20
- DOCKER_CONFIG : ./.docker
18
+ - uses : ./.github/actions/build-push-lvp-image
21
19
with :
22
- username : ${{ secrets.DOCKERHUB_USER }}
23
- password : ${{ secrets.DOCKERHUB_PASSWORD }}
24
- - name : Build
25
- env :
26
- VERSION : ${{ steps.get_tag.outputs.GIT_TAG }}
27
- DOCKER_CONFIG : ./.docker
28
- run : |
29
- make container
30
- make push
20
+ image-name : index.docker.io/replicated/local-volume-provider:${{ steps.get_tag.outputs.GIT_TAG }}
21
+ git-tag : ${{ steps.get_tag.outputs.GIT_TAG }}
22
+ registry-username : ${{ secrets.DOCKERHUB_USER }}
23
+ registry-password : ${{ secrets.DOCKERHUB_PASSWORD }}
Original file line number Diff line number Diff line change 2
2
REGISTRY ?= replicated
3
3
4
4
PLUGIN_NAME ?= local-volume-provider
5
- PLUGIN_IMAGE ?= $(REGISTRY ) /$(PLUGIN_NAME )
5
+ PLUGIN_IMAGE ?= $(REGISTRY ) /$(PLUGIN_NAME )
6
6
7
- VERSION ?= main
7
+ VERSION ?= main
8
8
CURRENT_USER := $(shell id -u -n)
9
9
10
10
GOOS ?= $(shell go env GOOS)
@@ -32,7 +32,7 @@ ci: verify-modules local test
32
32
33
33
.PHONY : container
34
34
container :
35
- docker build --pull -t $(PLUGIN_IMAGE ) :$(VERSION ) -f deploy/local-volume-provider/ Dockerfile --build-arg VERSION=$(VERSION ) .
35
+ docker build --pull -t $(PLUGIN_IMAGE ) :$(VERSION ) -f deploy/Dockerfile --build-arg VERSION=$(VERSION ) .
36
36
37
37
# push pushes the Docker image to its registry.
38
38
.PHONY : push
45
45
46
46
.PHONY ttl.sh :
47
47
ttl.sh :
48
- docker build -t $(CURRENT_USER ) /$(PLUGIN_NAME ) :12h -f deploy/local-volume-provider/ Dockerfile .
48
+ docker build -t $(CURRENT_USER ) /$(PLUGIN_NAME ) :12h -f deploy/Dockerfile .
49
49
docker tag $(CURRENT_USER ) /$(PLUGIN_NAME ) :12h ttl.sh/$(CURRENT_USER ) /$(PLUGIN_NAME ) :12h
50
50
@docker push ttl.sh/$(CURRENT_USER ) /$(PLUGIN_NAME ) :12h
51
51
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ contents:
2
+ repositories:
3
+ - https://packages.wolfi.dev/os
4
+ - ./packages/
5
+ keyring:
6
+ - https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
7
+ - ./melange.rsa.pub
8
+ packages:
9
+ - local-volume-provider-head # This is expected to be built locally by `melange`.
10
+ - bash
11
+ - busybox
12
+ - curl
13
+ - git
14
+ - wolfi-baselayout
15
+
16
+ environment:
17
+ VERSION: ${GIT_TAG}
18
+
19
+ cmd: /bin/bash -c "cp /plugins/* /target/."
Original file line number Diff line number Diff line change
1
+ package:
2
+ name: local-volume-provider-head
3
+ version: ${GIT_TAG}
4
+ epoch: 0
5
+ description: local-volume-provider package
6
+ copyright:
7
+ - license: Apache-2.0
8
+
9
+ environment:
10
+ contents:
11
+ repositories:
12
+ - https://packages.wolfi.dev/os
13
+ keyring:
14
+ - https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
15
+ packages:
16
+ - ca-certificates-bundle
17
+ - busybox
18
+ - git
19
+ - go
20
+ environment:
21
+ GOMODCACHE: '/var/cache/melange'
22
+
23
+ pipeline:
24
+ - runs: |
25
+ set -x
26
+ export DESTDIR="${{targets.destdir}}"
27
+ mkdir -p "${DESTDIR}/plugins"
28
+
29
+ export VERSION=${{package.version}}
30
+
31
+ CGO_ENABLED=0 go build \
32
+ -ldflags=" -X github.com/replicatedhq/local-volume-provider/pkg/version.version=$VERSION " \
33
+ -o "${DESTDIR}/plugins/local-volume-provider" ./cmd/local-volume-provider
34
+
35
+ CGO_ENABLED=0 go build \
36
+ -ldflags=" -X github.com/replicatedhq/local-volume-provider/pkg/version.version=$VERSION " \
37
+ -o "${DESTDIR}/local-volume-fileserver" ./cmd/local-volume-fileserver
You can’t perform that action at this time.
0 commit comments