File tree Expand file tree Collapse file tree 2 files changed +25
-15
lines changed Expand file tree Collapse file tree 2 files changed +25
-15
lines changed Original file line number Diff line number Diff line change 1
1
version : 2.1
2
2
executors :
3
- linux :
4
- machine :
5
- image : ubuntu-2004:202104-01
6
- working_directory : /go/src/github.com/fergusstrange/embedded-postgres
7
3
linux-arm64 :
8
4
machine :
9
5
image : ubuntu-2004:202104-01
10
6
resource_class : arm.medium
11
- working_directory : /go/src/github.com/fergusstrange/embedded-postgres
12
- osx :
13
- macos :
14
- xcode : 11.4
15
- working_directory : /go/src/github.com/fergusstrange/embedded-postgres
7
+ working_directory : /home/circleci/go/src/github.com/fergusstrange/embedded-postgres
16
8
17
9
jobs :
18
10
platform_test :
19
11
parameters :
20
- os :
12
+ executor :
21
13
type : executor
22
14
executor : << parameters.executor >>
23
15
steps :
24
16
- checkout
25
17
- restore_cache :
26
18
keys :
27
- - embedded-postgres-{{ checksum "/go/src/github.com/fergusstrange/embedded-postgres/go.mod" }}
19
+ - embedded-postgres-{{ checksum "/home/circleci/ go/src/github.com/fergusstrange/embedded-postgres/go.mod" }}
28
20
- run : cd platform-test && go test -v -race ./...
29
21
- save_cache :
30
- key : embedded-postgres-{{ checksum "/go/src/github.com/fergusstrange/embedded-postgres/go.mod" }}
22
+ key : embedded-postgres-{{ checksum "/home/circleci/ go/src/github.com/fergusstrange/embedded-postgres/go.mod" }}
31
23
paths :
32
- - /go/pkg
24
+ - /home/circleci/ go/pkg
33
25
34
26
workflows :
35
27
version : 2
@@ -38,4 +30,4 @@ workflows:
38
30
- platform_test :
39
31
matrix :
40
32
parameters :
41
- executor : [ linux, linux -arm64, osx ]
33
+ executor : [ linux-arm64 ]
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ package embeddedpostgres
2
2
3
3
import (
4
4
"os"
5
+ "os/exec"
5
6
"runtime"
7
+ "strings"
6
8
)
7
9
8
10
// VersionStrategy provides a strategy that can be used to determine which version of Postgres should be used based on
@@ -14,8 +16,24 @@ func defaultVersionStrategy(config Config) VersionStrategy {
14
16
goos := runtime .GOOS
15
17
arch := runtime .GOARCH
16
18
17
- // use alpine specific build
18
19
if goos == "linux" {
20
+ // the zonkyio/embedded-postgres-binaries project produces
21
+ // arm binaries with the following name schema:
22
+ // 32bit: arm32v6 / arm32v7
23
+ // 64bit (aarch64): arm64v8
24
+ if arch == "arm64" {
25
+ arch += "v8"
26
+ } else if arch == "arm" {
27
+ if out , err := exec .Command ("uname" , "-m" ).Output (); err == nil {
28
+ s := string (out )
29
+ if strings .HasPrefix (s , "armv7" ) {
30
+ arch += "32v7"
31
+ } else if strings .HasPrefix (s , "armv6" ) {
32
+ arch += "32v6"
33
+ }
34
+ }
35
+ }
36
+ // check alpine specific build
19
37
if _ , err := os .Stat ("/etc/alpine-release" ); err == nil {
20
38
arch += "-alpine"
21
39
}
You can’t perform that action at this time.
0 commit comments