Skip to content

Commit f780ce8

Browse files
committed
Merge branch 'main' of github.com:smartcontractkit/chainlink-testing-framework into useParrot
2 parents 9cfdf7c + 7c476d8 commit f780ce8

File tree

10 files changed

+51
-6
lines changed

10 files changed

+51
-6
lines changed

.github/workflows/parrot-release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,16 @@ jobs:
3131
mask-password: 'true'
3232
env:
3333
AWS_REGION: ${{ secrets.AWS_REGION }}
34+
- name: Login to Docker Hub
35+
uses: docker/login-action@v3
36+
with:
37+
username: kalverra
38+
password: ${{ secrets.KALVERRA_DOCKER_PASSWORD }}
3439
- name: Set up Go
3540
uses: actions/setup-go@v5
3641
with:
3742
go-version: stable
43+
cache-dependency-path: ./parrot/go.mod
3844
- name: Goreleaser Release
3945
uses: goreleaser/goreleaser-action@v6
4046
with:
@@ -45,4 +51,6 @@ jobs:
4551
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4652
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
4753
IMAGE_PREFIX: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com
48-
IMAGE_TAG: ${{ github.ref_name}}
54+
IMAGE_TAG: ${{ github.ref_name }}
55+
DOCKER_USERNAME: kalverra
56+
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/.changeset/v0.4.3.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixes release env vars

parrot/.changeset/v0.4.4.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updates parrot to Go 1.24.0

parrot/.changeset/v0.4.5.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixes dockerhub versioning

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_USERNAME }}/parrot:{{ .Tag }}-amd64{{ end }}'
45+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USERNAME }}/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_USERNAME }}/parrot:{{ .Tag }}-arm64{{ end }}'
60+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USERNAME }}/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_USERNAME }}/parrot:{{ .Tag }}{{ end }}'
79+
image_templates:
80+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USERNAME }}/parrot:{{ .Tag }}-amd64{{ end }}'
81+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USERNAME }}/parrot:{{ .Tag }}-arm64{{ end }}'
82+
- name_template: '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USERNAME }}/parrot:latest{{ end }}'
83+
image_templates:
84+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USERNAME }}/parrot:latest-amd64{{ end }}'
85+
- '{{ if ne .Env.IMG_PRE "local" }}{{ .Env.DOCKER_USERNAME }}/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/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,3 @@ fuzz:
3737
build:
3838
cd .. && goreleaser release --snapshot --clean -f ./parrot/.goreleaser.yaml
3939
echo "Build done, check in parrot/dist for binaries"
40-

parrot/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/smartcontractkit/chainlink-testing-framework/parrot
22

3-
go 1.23.4
3+
go 1.24.0
44

55
require (
66
github.com/go-chi/chi v1.5.5

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)