Skip to content

Commit 42013d3

Browse files
committed
Public parrot releases to Docker
1 parent 2497a60 commit 42013d3

File tree

5 files changed

+41
-4
lines changed

5 files changed

+41
-4
lines changed

.github/workflows/parrot-release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ jobs:
4545
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4646
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
4747
IMAGE_PREFIX: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com
48-
IMAGE_TAG: ${{ github.ref_name}}
48+
IMAGE_TAG: ${{ github.ref_name }}
49+
DOCKER_USERNAME: kalverra
50+
DOCKER_PASSWORD: ${{ secrets.KALVERRA_DOCKER_PASSWORD }}

parrot/.changeset/v0.4.2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Public docker releases for parrot

parrot/.goreleaser.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ env:
1616
builds:
1717
- id: parrot
1818
main: ./cmd/main.go
19+
ldflags:
20+
- -s
21+
- -w
22+
- -X github.com/smartcontractkit/chainlink-testing-framework/parrot.version={{.Version}}
23+
- -X github.com/smartcontractkit/chainlink-testing-framework/parrot.commit={{.ShortCommit}}
24+
- -X github.com/smartcontractkit/chainlink-testing-framework/parrot.date={{.CommitDate}}
25+
- -X github.com/smartcontractkit/chainlink-testing-framework/parrot.builtBy=goreleaser
1926
goos:
2027
- linux
2128
- darwin
@@ -34,6 +41,8 @@ dockers:
3441
image_templates:
3542
- '{{ .Env.IMG_PRE }}/parrot:{{ .Tag }}-amd64'
3643
- '{{ .Env.IMG_PRE }}/parrot:latest-amd64'
44+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USER }}/parrot:{{ .Tag }}-amd64{{ end }}'
45+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USER }}/parrot:latest-amd64{{ end }}'
3746
build_flag_templates:
3847
- --platform=linux/amd64
3948
- --pull
@@ -47,6 +56,8 @@ dockers:
4756
image_templates:
4857
- '{{ .Env.IMG_PRE }}/parrot:{{ .Tag }}-arm64'
4958
- '{{ .Env.IMG_PRE }}/parrot:latest-arm64'
59+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USER }}/parrot:{{ .Tag }}-arm64{{ end }}'
60+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USER }}/parrot:latest-arm64{{ end }}'
5061
build_flag_templates:
5162
- --platform=linux/arm64
5263
- --pull
@@ -64,6 +75,14 @@ docker_manifests:
6475
image_templates:
6576
- '{{ .Env.IMG_PRE }}/parrot:latest-amd64'
6677
- '{{ .Env.IMG_PRE }}/parrot:latest-arm64'
78+
- name_template: '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USER }}/parrot:{{ .Tag }}{{ end }}'
79+
image_templates:
80+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USER }}/parrot:{{ .Tag }}-amd64{{ end }}'
81+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USER }}/parrot:{{ .Tag }}-arm64{{ end }}'
82+
- name_template: '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USER }}/parrot:latest{{ end }}'
83+
image_templates:
84+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USER }}/parrot:latest-amd64{{ end }}'
85+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USER }}/parrot:latest-arm64{{ end }}'
6786

6887
before:
6988
hooks:

parrot/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM scratch
22

33
COPY parrot /parrot
4-
ENV PARROT_PORT 80
5-
ENV PARROT_TRACE true
4+
ENV PARROT_PORT=80
5+
ENV PARROT_TRACE=true
66
EXPOSE 80
77
ENTRYPOINT [ "/parrot" ]

parrot/parrot.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ const (
3333
MethodAny = "ANY"
3434
)
3535

36+
// These variables are set at build time and describe the Version of the application
37+
var (
38+
version = "dev"
39+
commit = "dev"
40+
date = time.Now().Format(time.RFC3339)
41+
builtBy = "local"
42+
)
43+
3644
// Route holds information about the mock route configuration
3745
type Route struct {
3846
// Method is the HTTP method to match
@@ -195,7 +203,14 @@ func (p *Server) run(listener net.Listener) {
195203
}()
196204

197205
p.log.Info().Str("Address", p.address).Msg("Parrot awake and ready to squawk")
198-
p.log.Debug().Str("Save File", p.saveFileName).Str("Log File", p.logFileName).Msg("Configuration")
206+
p.log.Debug().
207+
Str("Save File", p.saveFileName).
208+
Str("Log File", p.logFileName).
209+
Str("Version", version).
210+
Str("Commit", commit).
211+
Str("Build Date", date).
212+
Str("Built By", builtBy).
213+
Msg("Configuration")
199214
if err := p.server.Serve(listener); err != nil && !errors.Is(err, http.ErrServerClosed) {
200215
fmt.Println("ERROR: Failed to start server:", err)
201216
}

0 commit comments

Comments
 (0)