Skip to content

Commit

Permalink
TEMPORARY waiting for official image
Browse files Browse the repository at this point in the history
Signed-off-by: Paulo Gomes <[email protected]>
  • Loading branch information
Paulo Gomes committed Feb 7, 2022
1 parent c5e2e5e commit 92718e5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: e2e
on:
pull_request:
push:
branches:
- main
# branches:
# - main

permissions:
contents: read # for actions/checkout to fetch code
Expand Down Expand Up @@ -57,7 +57,11 @@ jobs:
with:
go-version: 1.17.x
- name: Run tests
run: make test
run: |
mkdir tmp-download; cd tmp-download; go mod init go-download;
GOBIN="${GITHUB_WORKSPACE}/build/gobin" go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
cd ..; rm -rf tmp-download
make test
- name: Prepare
id: prep
run: |
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,7 @@ RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
COPY --from=build /source-controller /usr/local/bin/
COPY ATTRIBUTIONS.md /

ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

USER 65534:65534
ENTRYPOINT [ "source-controller" ]
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ IMG ?= fluxcd/source-controller
TAG ?= latest

# Base image used to build the Go binary
LIBGIT2_IMG ?= ghcr.io/fluxcd/golang-with-libgit2
LIBGIT2_TAG ?= libgit2-1.1.1-4
LIBGIT2_IMG ?= ghcr.io/pjbgf/golang-with-libgit2
LIBGIT2_TAG ?= libgit2-1.1.1-6-nostdio

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


# The pkg-config command will yield warning messages until libgit2 is downloaded.
ifeq ($(shell uname -s),Darwin)
export CGO_LDFLAGS=$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs --static --cflags libssh2 openssl libgit2)
export CGO_LDFLAGS=$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs --static --cflags libssh2 openssl libgit2 2>/dev/null)
GO_STATIC_FLAGS=-ldflags "-s -w" -tags 'netgo,osusergo,static_build'
else
export PKG_CONFIG_PATH:=$(PKG_CONFIG_PATH):$(LIBGIT2_LIB64_PATH)/pkgconfig
export LIBRARY_PATH:=$(LIBRARY_PATH):$(LIBGIT2_LIB64_PATH)
export CGO_LDFLAGS=$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs --static --cflags libssh2 openssl libgit2)
export CGO_LDFLAGS=$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs --static --cflags libssh2 openssl libgit2 2>/dev/null)
endif


Expand Down
6 changes: 4 additions & 2 deletions hack/install-libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,19 @@ function setup_current() {
# For MacOS development environments, download the amd64 static libraries released from from golang-with-libgit2.

#TODO: update URL with official URL + TAG:
curl -o output.tar.gz -LO "https://github.com/pjbgf/golang-with-libgit2/releases/download/1.1.1-6/darwin-libs.tar.gz"
curl -o output.tar.gz -LO "https://github.com/pjbgf/golang-with-libgit2/releases/download/${TAG}/darwin-libs.tar.gz"

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

tar -xf output.tar.gz
rm output.tar.gz
mv "${DIR}" "${TAG}"
mv "${TAG}/" "./build/libgit2"

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"
# Removes abs path from build machine, and let iconv be resolved automatically by default search paths.
sed -i "" "s;-L/Applications/Xcode_.* ;;g" "$(/bin/pwd)/build/libgit2/${TAG}/lib/pkgconfig/libgit2.pc"

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

0 comments on commit 92718e5

Please sign in to comment.