* test 1

* test 2

* test 3

* test 4

* test 5

* test 6

* test 7

* test 8

* test 9

* test 10

* test 11

* test 12

* test 13

* test 14

* test 15

* test 16

* test 17

* test 18

* test 19

* test 20

* test 21

* test 22

* test 23

* test 24

* test 25

* test 26

* test 27

* test 28

* test 29

* test 30

* test 31

* test 32

* test 33

* test 34

* test 35

* test 36

* test 37

* test 38

* test 39

* test 40

* test 41

* test 42

* test 43

* test 44

* test 45

* test 46

* test 47

* test 48

* test 49

* test 50

* test 51

* test 52

* test 53

* test 54

* test 55

* test 56

* test 57

* test 58

* test 59

* test 60

* test 61

* test 62

* test 63

* test 64

---------

Co-authored-by: Barry McCormick <bmccormick@debianbeast.maildragon.com>
This commit is contained in:
Barry McCormick
2023-10-10 19:44:14 -07:00
committed by GitHub
parent 4ee0af9c49
commit 9b8d0a1f34
4 changed files with 76 additions and 9 deletions

View File

@@ -1,10 +1,44 @@
.cirrus.yml:
freebsd_instance:
image_family: freebsd-13-2
# .cirrus.yml:
env:
CIRRUS_CLONE_DEPTH: 1
ARCH: amd64
task:
freebsd_instance:
image: freebsd-13-2-release-amd64
build_trigger:
- echo "BRANCH=$(GITHUB_REF)" >> $CIRRUS_ENV
show_build_trigger: echo $BRANCH
script:
- echo "branch is $BRANCH"
- echo "trigger is $TRIGGER"
- pkg install -y git
- git clone https://github.com/BastilleBSD/bastille.git
- cd bastille
- make install
- cd /usr/local/etc/bastille
- cp bastille.conf.sample bastille.conf
- bastille setup
- bastille bootstrap 13.2-RELEASE
- bastille create testrun 13.2-RELEASE 10.0.0.1
- bastille list
- git clone https://github.com/BastilleBSD/templates.git
- cd templates
- echo " branch is $BRANCH "
- git checkout $BRANCH
- git diff --dirstat origin/cicd..cicd ./*
- git diff --dirstat main..$BRANCH ./* >> diff.txt
- echo "*** diff.txt ***"
- cat diff.txt
- # Use sed to remove characters before the match pattern
- match_pattern=" "
- sed "s/*$match_pattern/$match_pattern/" "diff.txt" >> changed.txt
- echo "*** changed.txt ***"
- cat changed.txt
- read -r CHDIR <"changed.txt"
- echo $CHDIR
- bastille template testrun $CHDIR
- cd $CHDIR
- pwd
- chmod +x ./test.sh
- ./test.sh
tasks:
build:
description: Build and test
script:
- echo "Build and test steps go here"
test.sh

22
www/nginx/.cirrus.yml Normal file
View File

@@ -0,0 +1,22 @@
# .cirrus.yml:
compute_engine_instance:
# Image list available via
# gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images
platform: freebsd
image_project: freebsd-org-cloud-dev
image: freebsd-13-2-release-amd64
cpu: 1
memory: 2G
disk: 10
task:
webserver_tests:
description: Test the web server
freebsd:
- pkg install -y curl wget # Install required tools (for FreeBSD)
script:
- curl -Is http://localhost:8080/ | grep "HTTP/1.1 200 OK" # Example test with curl
- wget --spider http://localhost:8080/ # Example test with wget

11
www/nginx/test.sh Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
response=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:80)
# Check if the response code is 200 (OK)
- if [ "$response" -eq 200 ]; then
echo "Web server is responding with HTTP 200 OK.";
else
echo "Web server is not responding with HTTP 200 OK. Response code: $response";
exit 1; # Exit with an error status
fi