Skip to content

Commit

Permalink
Merge pull request #30 from devatherock/git-upgrade
Browse files Browse the repository at this point in the history
feat: Upgraded git cli to 2.26.3
  • Loading branch information
devatherock authored May 31, 2023
2 parents b3ce4c9 + d920106 commit 6ccabef
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Upgraded spotless to `6.18.0`
- Updated dockerhub readme in CI pipeline
- Built a multi-arch docker image
- Pinned git cli version to `2.20.4` in the docker image, to get around the `safe.directory` check
- Pinned git cli version to the [highest available version](https://pkgs.alpinelinux.org/packages?name=git&branch=v3.12&repo=&arch=&maintainer=) less than [2.30.3](https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9) in the docker image, to get around the `safe.directory` check

## [3.0.0] - 2023-05-06
### Changed
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
DOCKER_TAG=latest
additional_gradle_args=

clean:
./gradlew clean
test:
sh unit-tests.sh
functional-test:
sh functional-tests.sh
sh functional-tests.sh "$(additional_gradle_args)"
jar-build:
docker run --rm \
-v $(CURDIR):/work \
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ compileGroovy {

test {
useJUnitPlatform()

systemProperty 'skip.pull', System.properties['skip.pull']
}

ext.jacoco = [
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ USER root
RUN apk --update add openssh

# Install git. Pinned git version to get around the safe.directory check
RUN apk add git=2.20.4-r0 --repository=http://dl-cdn.alpinelinux.org/alpine/v3.9/main
RUN apk add git=2.26.3-r1 --repository=http://dl-cdn.alpinelinux.org/alpine/v3.12/main

COPY SyncGitRepos.jar /scripts/
COPY docker/entry-point.sh /scripts/
Expand Down
4 changes: 3 additions & 1 deletion functional-tests.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/bin/sh

additional_gradle_args=$1

mkdir git-sync-test
cp -r * git-sync-test
cp -r .git git-sync-test
cd git-sync-test
export CURRENT_BRANCH=$(git symbolic-ref --short HEAD)
git remote set-url origin "https://git-sync-token:$GIT_TOKEN@github.com/devatherock/git-sync.git"
./gradlew test --tests '*SyncGitReposDockerSpec*' -x jacocoTestCoverageVerification
./gradlew test --tests '*SyncGitReposDockerSpec*' -x jacocoTestCoverageVerification ${additional_gradle_args}
exit_code=$?
cd ..
rm -rf git-sync-test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ class SyncGitReposDockerSpec extends Specification {

void setupSpec() {
System.setProperty('java.util.logging.SimpleFormatter.format', '%5$s%n')
ProcessUtil.executeCommand("docker pull ${dockerImage}")

if (!Boolean.getBoolean('skip.pull')) {
ProcessUtil.executeCommand("docker pull ${dockerImage}")
}
}

void setup() {
Expand Down

0 comments on commit 6ccabef

Please sign in to comment.