Skip to content

Commit fe9ce4e

Browse files
author
Soft-Serve
committed
chore: reverting hack dir move
1 parent 999001b commit fe9ce4e

8 files changed

Lines changed: 61 additions & 59 deletions

File tree

.github/hack/soft-serve/start.sh

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/golang-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
go-version: 1.24
2222
- name: start soft-serve
23-
run: ./.github/hack/soft-serve/start.sh
23+
run: .//hack/soft-serve/start.sh
2424
- name: run golang tests
2525
env:
2626
SOPS_AGE_KEY_FILE: ${{ github.workspace }}/test_assets/keys.txt
File renamed without changes.
File renamed without changes.

hack/soft-serve/start.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
BASE="$(git rev-parse --show-toplevel)"
4+
[[ $? -eq 0 ]] || {
5+
echo 'Run this script from inside the repository (cannot determine toplevel directory)'
6+
exit 1
7+
}
8+
9+
log() {
10+
if [[ $VERBOSE == 'true' ]]; then
11+
echo $1
12+
fi
13+
}
14+
15+
# cleanup
16+
rm -rf $BASE/hack/soft-serve/ssh-key
17+
rm -rf $BASE/hack/soft-serve/ssh-key.pub
18+
rm -rf $BASE/hack/soft-serve/data
19+
rm -rf $BASE/hack/soft-serve/gitops-test
20+
21+
remove_ssh_key() {
22+
ssh-add -d $BASE/hack/soft-serve/ssh-key.pub
23+
}
24+
25+
trap remove_ssh_key INT
26+
27+
# generate ssh key
28+
ssh-keygen -t ed25519 -N '' -f $BASE/hack/soft-serve/ssh-key
29+
30+
# set config vars
31+
export SOFT_SERVE_INITIAL_ADMIN_KEYS=$(cat $BASE/hack/soft-serve/ssh-key.pub)
32+
33+
mkdir -p $BASE/hack/soft-serve/data
34+
35+
docker compose -f $BASE/hack/soft-serve/docker-compose.yml up -d
36+
37+
sleep 1
38+
39+
ssh-add $BASE/hack/soft-serve/ssh-key
40+
echo "Creating repo"
41+
ssh -p 23231 -o StrictHostKeychecking=no -i $BASE/hack/soft-serve/ssh-key localhost repo create gitops-test
42+
43+
echo "Cloning repo"
44+
export GIT_SSH_COMMAND="ssh -o StrictHostKeychecking=no -i $BASE/hack/soft-serve/ssh-key"
45+
git clone ssh://localhost:23231/gitops-test.git $BASE/hack/soft-serve/gitops-test
46+
mkdir -p $BASE/hack/soft-serve/gitops-test/applications/dev/service-test
47+
cp $BASE/hack/soft-serve/fixtures/values.yaml $BASE/hack/soft-serve/gitops-test/applications/dev/service-test/values.yaml
48+
cd $BASE/hack/soft-serve/gitops-test
49+
git config user.name "Soft-Serve"
50+
git config user.email "soft-serve@localhost"
51+
git checkout -b main
52+
git add .
53+
git commit -m "feat: add service-test application"
54+
git push origin main
55+
56+
cd $BASE
57+
58+
chmod -R 644 $BASE/hack

internal/git/git_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func getSshKeyData(t *testing.T) []byte {
1616
assert.NoError(t, err)
1717
assert.NotEmpty(t, baseDir)
1818

19-
sshKeyPath := path.Join(baseDir, ".github", "hack", "soft-serve", "ssh-key")
19+
sshKeyPath := path.Join(baseDir, "hack", "soft-serve", "ssh-key")
2020
assert.FileExists(t, sshKeyPath)
2121

2222
sshKey, err := os.ReadFile(sshKeyPath)

internal/patch/method_git_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func getSshKeyData(t *testing.T) []byte {
1616
assert.NoError(t, err)
1717
assert.NotEmpty(t, baseDir)
1818

19-
sshKeyPath := path.Join(baseDir, ".github", "hack", "soft-serve", "ssh-key")
19+
sshKeyPath := path.Join(baseDir, "hack", "soft-serve", "ssh-key")
2020
assert.FileExists(t, sshKeyPath)
2121

2222
sshKey, err := os.ReadFile(sshKeyPath)

0 commit comments

Comments
 (0)