File tree 4 files changed +18
-9
lines changed
4 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ name: e2e
3
3
on :
4
4
pull_request :
5
5
push :
6
- branches :
7
- - main
6
+ # branches:
7
+ # - main
8
8
9
9
permissions :
10
10
contents : read # for actions/checkout to fetch code
57
57
with :
58
58
go-version : 1.17.x
59
59
- name : Run tests
60
- run : make test
60
+ run : |
61
+ mkdir tmp-download; cd tmp-download; go mod init go-download;
62
+ GOBIN="${GITHUB_WORKSPACE}/build/gobin" go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
63
+ cd ..; rm -rf tmp-download
64
+ make test
61
65
- name : Prepare
62
66
id : prep
63
67
run : |
Original file line number Diff line number Diff line change @@ -108,5 +108,7 @@ RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
108
108
COPY --from=build /source-controller /usr/local/bin/
109
109
COPY ATTRIBUTIONS.md /
110
110
111
+ ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
112
+
111
113
USER 65534:65534
112
114
ENTRYPOINT [ "source-controller" ]
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ IMG ?= fluxcd/source-controller
3
3
TAG ?= latest
4
4
5
5
# Base image used to build the Go binary
6
- LIBGIT2_IMG ?= ghcr.io/fluxcd /golang-with-libgit2
7
- LIBGIT2_TAG ?= libgit2-1.1.1-4
6
+ LIBGIT2_IMG ?= ghcr.io/pjbgf /golang-with-libgit2
7
+ LIBGIT2_TAG ?= libgit2-1.1.1-6-nostdio
8
8
9
9
# Allows for defining additional Docker buildx arguments,
10
10
# e.g. '--push'.
@@ -35,13 +35,14 @@ export LIBRARY_PATH=$(LIBGIT2_LIB_PATH)
35
35
export CGO_CFLAGS =-I$(LIBGIT2_PATH ) /include -I$(LIBGIT2_PATH ) /include/openssl
36
36
37
37
38
+ # The pkg-config command will yield warning messages until libgit2 is downloaded.
38
39
ifeq ($(shell uname -s) ,Darwin)
39
- export CGO_LDFLAGS =$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH ) pkg-config --libs --static --cflags libssh2 openssl libgit2)
40
+ export CGO_LDFLAGS =$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH ) pkg-config --libs --static --cflags libssh2 openssl libgit2 2>/dev/null )
40
41
GO_STATIC_FLAGS =-ldflags "-s -w" -tags 'netgo,osusergo,static_build'
41
42
else
42
43
export PKG_CONFIG_PATH: =$(PKG_CONFIG_PATH ) :$(LIBGIT2_LIB64_PATH ) /pkgconfig
43
44
export LIBRARY_PATH: =$(LIBRARY_PATH ) :$(LIBGIT2_LIB64_PATH )
44
- export CGO_LDFLAGS =$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH ) pkg-config --libs --static --cflags libssh2 openssl libgit2)
45
+ export CGO_LDFLAGS =$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH ) pkg-config --libs --static --cflags libssh2 openssl libgit2 2>/dev/null )
45
46
endif
46
47
47
48
Original file line number Diff line number Diff line change @@ -47,17 +47,19 @@ function setup_current() {
47
47
# For MacOS development environments, download the amd64 static libraries released from from golang-with-libgit2.
48
48
49
49
# TODO: update URL with official URL + TAG:
50
- curl -o output.tar.gz -LO " https://github.com/pjbgf/golang-with-libgit2/releases/download/1.1.1-6 /darwin-libs.tar.gz"
50
+ curl -o output.tar.gz -LO " https://github.com/pjbgf/golang-with-libgit2/releases/download/${TAG} /darwin-libs.tar.gz"
51
51
52
52
DIR=libgit2-darwin
53
53
NEW_DIR=" $( /bin/pwd) /build/libgit2/${TAG} "
54
54
INSTALLED_DIR=" /Users/runner/work/golang-with-libgit2/golang-with-libgit2/build/${DIR} -amd64"
55
55
56
56
tar -xf output.tar.gz
57
+ rm output.tar.gz
57
58
mv " ${DIR} " " ${TAG} "
58
59
mv " ${TAG} /" " ./build/libgit2"
59
60
60
- sed -i " " " s;-L/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/lib ;;g" " $( /bin/pwd) /build/libgit2/${TAG} /lib/pkgconfig/libgit2.pc"
61
+ # Removes abs path from build machine, and let iconv be resolved automatically by default search paths.
62
+ sed -i " " " s;-L/Applications/Xcode_.* ;;g" " $( /bin/pwd) /build/libgit2/${TAG} /lib/pkgconfig/libgit2.pc"
61
63
62
64
# Update the prefix paths included in the .pc files.
63
65
# This will make it easier to update to the location in which they will be used.
You can’t perform that action at this time.
0 commit comments