Skip to content

Commit 92718e5

Browse files
author
Paulo Gomes
committed
TEMPORARY waiting for official image
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
1 parent c5e2e5e commit 92718e5

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

.github/workflows/e2e.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: e2e
33
on:
44
pull_request:
55
push:
6-
branches:
7-
- main
6+
# branches:
7+
# - main
88

99
permissions:
1010
contents: read # for actions/checkout to fetch code
@@ -57,7 +57,11 @@ jobs:
5757
with:
5858
go-version: 1.17.x
5959
- 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
6165
- name: Prepare
6266
id: prep
6367
run: |

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,7 @@ RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
108108
COPY --from=build /source-controller /usr/local/bin/
109109
COPY ATTRIBUTIONS.md /
110110

111+
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
112+
111113
USER 65534:65534
112114
ENTRYPOINT [ "source-controller" ]

Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ IMG ?= fluxcd/source-controller
33
TAG ?= latest
44

55
# 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
88

99
# Allows for defining additional Docker buildx arguments,
1010
# e.g. '--push'.
@@ -35,13 +35,14 @@ export LIBRARY_PATH=$(LIBGIT2_LIB_PATH)
3535
export CGO_CFLAGS=-I$(LIBGIT2_PATH)/include -I$(LIBGIT2_PATH)/include/openssl
3636

3737

38+
# The pkg-config command will yield warning messages until libgit2 is downloaded.
3839
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)
4041
GO_STATIC_FLAGS=-ldflags "-s -w" -tags 'netgo,osusergo,static_build'
4142
else
4243
export PKG_CONFIG_PATH:=$(PKG_CONFIG_PATH):$(LIBGIT2_LIB64_PATH)/pkgconfig
4344
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)
4546
endif
4647

4748

hack/install-libraries.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,19 @@ function setup_current() {
4747
# For MacOS development environments, download the amd64 static libraries released from from golang-with-libgit2.
4848

4949
#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"
5151

5252
DIR=libgit2-darwin
5353
NEW_DIR="$(/bin/pwd)/build/libgit2/${TAG}"
5454
INSTALLED_DIR="/Users/runner/work/golang-with-libgit2/golang-with-libgit2/build/${DIR}-amd64"
5555

5656
tar -xf output.tar.gz
57+
rm output.tar.gz
5758
mv "${DIR}" "${TAG}"
5859
mv "${TAG}/" "./build/libgit2"
5960

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"
6163

6264
# Update the prefix paths included in the .pc files.
6365
# This will make it easier to update to the location in which they will be used.

0 commit comments

Comments
 (0)