Skip to content
Snippets Groups Projects
Commit b1e80d44 authored by George Adrian Stoica's avatar George Adrian Stoica
Browse files

work on support for windows

parent da759cf4
No related branches found
No related tags found
No related merge requests found
Pipeline #53413 passed
......@@ -120,22 +120,21 @@ task checkDocker {
doLast{
def result = 1
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
println "windows os"
result = exec{
def command = "/c docker --version"
ignoreExitValue = true
executable "cmd" args command
}
println "windows os"
result = exec{
def command = "/c docker --version"
ignoreExitValue = true
executable "cmd" args command
}
} else {
//we assume linux/mac with bash if not having windows -
//more fine tuned testing can be done if needed
println "linux / unix os"
result = exec{
def command = "command -v docker"
ignoreExitValue = true
executable "bash" args "-l", "-c", command
}
//we assume linux/mac with bash if not having windows -
//more fine tuned testing can be done if needed
println "linux / unix os"
result = exec{
def command = "command -v docker"
ignoreExitValue = true
executable "bash" args "-l", "-c", command
}
}
if(result.getExitValue()==0){
......@@ -149,15 +148,38 @@ task checkDocker {
}
task pdfSlides {
doLast{
if (dockerAvailable){
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
println "run windows script"
def result = exec{
workingDir = '.'
ignoreExitValue = true
commandLine 'cmd','/c','pdfslides.bat'
}
if(result.getExitValue()==0){
println "export successful"
} else {
print "export to pdf failed"
}
} else {
def result = exec{
def command = "pdfslides.sh"
ignoreExitValue = true
executable "bash" args "-l", "-c", command
}
if(result.getExitValue()==0){
println "export successful"
} else {
print "export to pdf failed"
}
println "run linux / unix script"
}
} else {
println "docker is not available on this machine"
}
}
}
build.dependsOn 'asciidoctorRevealJs'
......
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION
SET CURRENT_PATH=%~dp0
SET "URL_SLIDES=https://gitlab.stud.idi.ntnu.no/it1901/course-material/-/jobs/artifacts/master/file/lectures/build/docs/revealjs/"
rem using 2.9 as the latest vesion is not working properly in our case
SET "DOCKER_PARAMS=run --rm -t -v ^"%CURRENT_PATH%build\docs\pdf^":/slides astefanutti/decktape:2.9 --size=1280x1000"
docker %DOCKER_PARAMS% %URL_SLIDES%course-intro.html?job=build 01.a.course-intro-slides.pdf
docker %DOCKER_PARAMS% %URL_SLIDES%02-software-development.html?job=build 02.a.software-development-slides.pdf
docker %DOCKER_PARAMS% %URL_SLIDES%scm.html?job=build 02.b.source-code-management.pdf
docker %DOCKER_PARAMS% %URL_SLIDES%03-build-tools-and-some-testing.html?job=build 03-build-tools-and-some-testing.pdf
docker %DOCKER_PARAMS% %URL_SLIDES%07-documentation.html?job=build 07.b.-documentation.pdf
docker %DOCKER_PARAMS% %URL_SLIDES%08-workflow-example.html?job=build 08.workflow-example.pdf
\ No newline at end of file
......@@ -2,12 +2,12 @@
URL_SLIDES="https://gitlab.stud.idi.ntnu.no/it1901/course-material/-/jobs/artifacts/master/file/lectures/build/docs/revealjs/"
#using 2.9 as the latest vesion is not working properly in our case
DOCKER_PARAMS="run --rm -t -v `pwd`:/slides astefanutti/decktape:2.9"
DOCKER_PARAMS="run --rm -t -v `pwd`:/slides astefanutti/decktape:2.9 --size=1280x1000"
docker ${DOCKER_PARAMS} --size=1280x1000 ${URL_SLIDES}course-intro.html?job=build 01.a.course-intro-slides.pdf
docker ${DOCKER_PARAMS} --size=1280x1000 ${URL_SLIDES}02-software-development.html?job=build 02.a.software-development-slides.pdf
docker ${DOCKER_PARAMS} --size=1280x1000 ${URL_SLIDES}scm.html?job=build 02.b.source-code-management.pdf
docker ${DOCKER_PARAMS} --size=1280x1000 ${URL_SLIDES}03-build-tools-and-some-testing.html?job=build 03-build-tools-and-some-testing.pdf
docker ${DOCKER_PARAMS} --size=1280x1000 ${URL_SLIDES}07-documentation.html?job=build 07.b.-documentation.pdf
docker ${DOCKER_PARAMS} --size=1280x1000 ${URL_SLIDES}08-workflow-example.html?job=build 08.workflow-example.pdf
docker ${DOCKER_PARAMS} ${URL_SLIDES}course-intro.html?job=build 01.a.course-intro-slides.pdf
docker ${DOCKER_PARAMS} ${URL_SLIDES}02-software-development.html?job=build 02.a.software-development-slides.pdf
docker ${DOCKER_PARAMS} ${URL_SLIDES}scm.html?job=build 02.b.source-code-management.pdf
docker ${DOCKER_PARAMS} ${URL_SLIDES}03-build-tools-and-some-testing.html?job=build 03-build-tools-and-some-testing.pdf
docker ${DOCKER_PARAMS} ${URL_SLIDES}07-documentation.html?job=build 07.b.-documentation.pdf
docker ${DOCKER_PARAMS} ${URL_SLIDES}08-workflow-example.html?job=build 08.workflow-example.pdf
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION
SET CURRENT_PATH=%~dp0
SET "URL_SLIDES=/revealjs/"
rem using 2.9 as the latest vesion is not working properly in our case
SET "DOCKER_PARAMS=run --rm -t -v ^"%CURRENT_PATH%build\docs\pdf^":/slides -v ^"%CURRENT_PATH%build\docs\revealjs^":/revealjs astefanutti/decktape:2.9 --size=1280x1000 --chrome-arg=--allow-file-access-from-files"
docker %DOCKER_PARAMS% "%URL_SLIDES%course-intro.html" 01.a.course-intro-slides.pdf
docker %DOCKER_PARAMS% %URL_SLIDES%02-software-development.html 02.a.software-development-slides.pdf
docker %DOCKER_PARAMS% %URL_SLIDES%scm.html 02.b.source-code-management.pdf
docker %DOCKER_PARAMS% %URL_SLIDES%03-build-tools-and-some-testing.html 03-build-tools-and-some-testing.pdf
docker %DOCKER_PARAMS% %URL_SLIDES%07-documentation.html 07.b.-documentation.pdf
docker %DOCKER_PARAMS% %URL_SLIDES%08-workflow-example.html 08.workflow-example.pdf
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment