Merge branch 'develop'
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
commit
7bf53181e2
52
.drone.yml
Normal file
52
.drone.yml
Normal 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"
|
@ -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
|
|
@ -16,7 +16,7 @@ RUN curl -sL https://sourceforge.net/projects/freepascal/files/Linux/$FPC_VERSIO
|
|||||||
|
|
||||||
COPY compile.sh /compile.sh
|
COPY compile.sh /compile.sh
|
||||||
ADD https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver /usr/bin/semver
|
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
|
WORKDIR /code
|
||||||
RUN find . -type f -print0 | xargs -0 dos2unix
|
RUN find . -type f -print0 | xargs -0 dos2unix
|
||||||
ENTRYPOINT ["/bin/bash", "-c"]
|
ENTRYPOINT ["/bin/bash", "-c"]
|
||||||
|
32
compile.sh
32
compile.sh
@ -20,26 +20,30 @@ runOrFail() {
|
|||||||
fi
|
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.
|
for ((i=0; i<${#run_steps[@]}; i+=2))
|
||||||
runOrFail $(pwd)/compile_vergen.sh "Versions failed to compile"
|
do
|
||||||
|
if [ "$ERRCOUNT" -eq "0" ]
|
||||||
#Compile all .pas sources
|
then
|
||||||
runOrFail $(pwd)/compile_sources.sh "Failed to compile FPC Sources!"
|
script=$(pwd)/"${run_steps[$i]}"
|
||||||
|
message="${run_steps[$i+1]}"
|
||||||
#Link into a binary.
|
runOrFail "$script" "$message"
|
||||||
runOrFail $(pwd)/compile_link.sh "Failed linking!"
|
fi
|
||||||
|
done
|
||||||
#Generate an ISO with GRUB as the Bootloader.
|
|
||||||
runOrFail ./compile_isogen.sh "Failed to create ISO!"
|
|
||||||
|
|
||||||
#Call generate final artifacts based on failure or success of the above.
|
#Call generate final artifacts based on failure or success of the above.
|
||||||
if [ "$ERRCOUNT" -ne "0" ]
|
if [ "$ERRCOUNT" -ne "0" ]
|
||||||
then
|
then
|
||||||
./compile_finish.sh "failed"
|
. ./compile_finish.sh "failed"
|
||||||
else
|
else
|
||||||
./compile_finish.sh "success"
|
. ./compile_finish.sh "success"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd ..
|
cd ..
|
Loading…
x
Reference in New Issue
Block a user