Compare commits

...

22 Commits

Author SHA1 Message Date
8c3649f691 Merge pull request 'feature/ci-cd-drone-migration' (#3) from feature/ci-cd-drone-migration into develop
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
Reviewed-on: #3
2025-03-09 22:32:16 +00:00
b47194ed99 Final commit to merge through develop & master
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- CI/CD Pipeline now working & tested.
- Commits to all branches will trigger the pipeline in DroneCI.
- Commits to master will trigger the resulting ISO artefact to be uploaded to Gitea as a Package.
2025-03-09 22:25:08 +00:00
6bca42f2a5 Final Test before finalizing
All checks were successful
continuous-integration/drone/push Build is passing
- Single quotes were causing the first CURL to fail.
- This should be the penultimate commit before ready to progress through dev to master.
2025-03-09 22:18:19 +00:00
f1211f3cca Slowly making progress
All checks were successful
continuous-integration/drone/push Build is passing
- YAML is now valid - however, the attempt to temp store the revision number failed. Doing it inline instead.
2025-03-09 22:08:18 +00:00
0913daebc6 Still experiencing YAML errors, for some reason.
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-09 22:01:55 +00:00
d1a4b4d42f Another attempt - issues with YAML layout for some reason
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2025-03-09 21:57:19 +00:00
2906b8724b Exports don't persist between commands
Some checks reported errors
continuous-integration/drone/push Build encountered an error
- Exports don't persist between commands in Drone commands - removed these exports and made more verbose commands.
2025-03-09 21:45:29 +00:00
5e6e6c394a Debugging & Testing
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
- Mistakes made in the curl methods used & the curl upload-file flag - rectified.
2025-03-09 21:18:49 +00:00
315050f095 Further permission issues
Some checks failed
continuous-integration/drone/push Build is failing
- Further attempts to fix permission issues within Drone when exporting the Asuro.iso artefact
- Switched to `alpine/git` instead of `curl` image, as git didn't exist under the `curl` image.
2025-03-09 20:42:40 +00:00
f795ba24f8 Further tweaks to artefact upload step
Some checks failed
continuous-integration/drone/push Build is failing
DroneCI wasn't happy with the mv of `Asuro.iso` - changed to a cp.
2025-03-09 20:36:19 +00:00
738307d070 Testing artefact upload
Some checks failed
continuous-integration/drone/push Build is failing
- Testing the upload of the resulting `Asuro.iso` to Gitea fromt the Drone pipeline.
2025-03-09 20:30:45 +00:00
04cff2e2c3 Testing Succeeded - Refinement & removal of debugging code
All checks were successful
continuous-integration/drone/push Build is passing
- Removed the debug `exit 1` from `compile_stub.sh`
- Improved `compile.sh` to use runOrFail in a more suitable way, correctly passing through failure messages.
2025-03-09 19:58:24 +00:00
0b5981242b Intentional edit to cause build failure
Some checks failed
continuous-integration/drone/push Build is failing
- Intentional edit to `compile_stub.sh` in order to cause a build failure.
2025-03-09 19:44:19 +00:00
f0dc598f44 Cleaning up compile scripts
All checks were successful
continuous-integration/drone/push Build is passing
- Debugging removed from `compile_vergen.sh`
- `compile.sh` modified to use a for loop for each command & only continue if previous steps succeeded.
2025-03-09 19:39:25 +00:00
d4236f455e DroneCI doesn't fetch tags by default
All checks were successful
continuous-integration/drone/push Build is passing
- Added `git fetch --tags` as the first command
- Changes to compile_vergen.sh in order to debug.
2025-03-09 19:16:23 +00:00
96fcf19c14 Further updates to .drone.yml
All checks were successful
continuous-integration/drone/push Build is passing
Still experiencing issues with not being able to find the .sh files due to missing /code directory.
2025-03-09 18:59:32 +00:00
8c51bd8690 Attempts to resolve issues with missing /code directory
Some checks failed
continuous-integration/drone/push Build is failing
Dockerfile expects `/code` attempting to resolve this in the .drone.yml
2025-03-09 18:54:38 +00:00
43464bb550 Still not working
Some checks failed
continuous-integration/drone/push Build is failing
Testing whether mount paths are the problem
2025-03-09 18:08:28 +00:00
6a1b87e250 .drone.yml modifications
All checks were successful
continuous-integration/drone/push Build is passing
Modified drone.yml to copy source from the /drone/src directory to the /code directory.
2025-03-09 17:49:04 +00:00
9473e26b50 Dockerfile corrections
All checks were successful
continuous-integration/drone/push Build is passing
- /code already exists, don't create it in Dockerfile
2025-03-09 17:42:06 +00:00
f19444201d Updated registry to the registry server, as opposed to my username
Some checks failed
continuous-integration/drone/push Build is failing
Oops.
2025-03-09 17:36:45 +00:00
f907b7e072 First attempt at drone cicd migration
Some checks failed
continuous-integration/drone/push Build is failing
- Created a new `.drone.yml` that will compile the Dockerfile, upload this to the Docker Registry & then use this for building.
2025-03-09 17:32:35 +00:00
4 changed files with 71 additions and 88 deletions

52
.drone.yml Normal file
View File

@ -0,0 +1,52 @@
kind: pipeline
type: docker
name: build
steps:
- name: build-image
image: plugins/docker
settings:
repo: t3hn3rd/asuro-build
tags: latest
dockerfile: Dockerfile
registry: docker.io
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: compile
image: t3hn3rd/asuro-build:latest
depends_on:
- build-image
commands:
- git fetch --tags
- find . -type f -print0 | xargs -0 dos2unix
- chmod +x /drone/src/*.sh
- /drone/src/compile.sh
- name: upload-iso-artifact
image: alpine/git
depends_on:
- compile
when:
branch:
- master
environment:
GITEA_TOKEN:
from_secret: gitea_token
commands:
- apk add --no-cache curl
- chmod +w Asuro.iso
- cp Asuro.iso "Asuro-$(git rev-parse --short HEAD).iso"
- echo "Uploading Asuro-$(git rev-parse --short HEAD).iso to Gitea Packages..."
- |
curl -X PUT "https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/$(git rev-parse --short HEAD)/Asuro.iso" \
-H "Authorization: token $GITEA_TOKEN" --upload-file "Asuro-$(git rev-parse --short HEAD).iso"
- echo "Updating latest ISO reference..."
- |
curl -X DELETE https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/latest/Asuro.iso \
-H "Authorization: token $GITEA_TOKEN" || echo "No previous latest version found."
- |
curl -X PUT https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/latest/Asuro.iso \
-H "Authorization: token $GITEA_TOKEN" --upload-file "Asuro-$(git rev-parse --short HEAD).iso"

View File

@ -1,73 +0,0 @@
stages:
- Compile Versions
- Compile Sources
- Link
- Generate Documentation
- Deploy
cache:
- key: ${CI_COMMIT_REF_SLUG}
paths:
- lib/*.o
- bin/kernel.bin
- doc
before_script:
- chmod +x *.sh
versions:
stage: Compile Versions
script:
- ./compile_vergen.sh
artifacts:
paths:
- release/*.svg
- src/include/asuro.pas
compile_sources:
stage: Compile Sources
script:
- rm -f lib/*.so
- ./compile_sources.sh
needs:
- versions
link:
stage: Link
script:
- ./compile_stub.sh
- ./compile_link.sh
needs:
- versions
- compile_sources
isogen:
stage: Deploy
script:
- ./compile_isogen.sh
- ./compile_sumgen.sh
artifacts:
paths:
- ./Asuro.iso
- ./release/checksum.svg
needs:
- link
docgen:
stage: Generate Documentation
only:
- master
- develop
script:
- ./compile_sourcelist.sh
- ./compile_docs.sh
# Remove comments when we want to use gitlab pages.
#- cp doc public
allow_failure: true
artifacts:
paths:
- doc
#- public/*
#- ./sources.list
needs:
- versions

View File

@ -16,7 +16,7 @@ RUN curl -sL https://sourceforge.net/projects/freepascal/files/Linux/$FPC_VERSIO
COPY compile.sh /compile.sh
ADD https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver /usr/bin/semver
RUN mkdir /code && chmod +x /usr/bin/semver
RUN chmod +x /usr/bin/semver
WORKDIR /code
RUN find . -type f -print0 | xargs -0 dos2unix
ENTRYPOINT ["/bin/bash", "-c"]

View File

@ -20,26 +20,30 @@ runOrFail() {
fi
}
runOrFail $(pwd)/compile_stub.sh "Failed to compile stub!"
declare -a run_steps=(
"compile_stub.sh" "Failed to compile stub!"
"compile_vergen.sh" "Versions failed to compile"
"compile_sources.sh" "Failed to compile FPC Sources!"
"compile_link.sh" "Failed linking!"
"compile_isogen.sh" "Failed to create ISO!"
)
#Generate .pas with versioning headers.
runOrFail $(pwd)/compile_vergen.sh "Versions failed to compile"
#Compile all .pas sources
runOrFail $(pwd)/compile_sources.sh "Failed to compile FPC Sources!"
#Link into a binary.
runOrFail $(pwd)/compile_link.sh "Failed linking!"
#Generate an ISO with GRUB as the Bootloader.
runOrFail ./compile_isogen.sh "Failed to create ISO!"
for ((i=0; i<${#run_steps[@]}; i+=2))
do
if [ "$ERRCOUNT" -eq "0" ]
then
script=$(pwd)/"${run_steps[$i]}"
message="${run_steps[$i+1]}"
runOrFail "$script" "$message"
fi
done
#Call generate final artifacts based on failure or success of the above.
if [ "$ERRCOUNT" -ne "0" ]
then
./compile_finish.sh "failed"
. ./compile_finish.sh "failed"
else
./compile_finish.sh "success"
. ./compile_finish.sh "success"
fi
cd ..