Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rogge, Torben
lab-gitlab
Commits
7710d67f
Commit
7710d67f
authored
Nov 09, 2020
by
Torben Rogge
Browse files
Task 4 - Images I
parent
3649f63a
Pipeline
#21350
failed with stage
in 7 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
7710d67f
stages
:
-
generate
-
consume
variables
:
GREET
:
"
Groot!"
job1
:
stage
:
generate
script
:
-
mkdir build
-
echo "Hello I am job 1 executed on the $CI_COMMIT_REF_NAME branch only" > build/job1-result.txt
artifacts
:
paths
:
-
build/
only
:
-
master
stages
:
-
test
j
ob2
:
stage
:
genera
te
j
ava
:
stage
:
te
st
script
:
-
mkdir build
-
echo "Hello I am job 2 executed on the $CI_COMMIT_REF_NAME branch only" > build/job2-result.txt
artifacts
:
paths
:
-
build/
only
:
variables
:
-
$CI_COMMIT_REF_NAME == "release"
-
javac src/*.java
-
java -cp src/ Hello $GREET > result.txt
-
cat result.txt
-
cat result.txt | grep "Hello $GREET"
job3
:
stage
:
genera
te
python
:
stage
:
te
st
script
:
-
mkdir build
-
echo "Hello I am job3 and always executed except for the master or release branch" > build/job3-result.txt
artifacts
:
paths
:
-
build/
except
:
-
master
-
release
-
python src/hello.py $GREET > result.txt
-
cat result.txt
-
cat result.txt | grep "Hello $GREET"
job4
:
stage
:
consume
script
:
-
cat build/*-result.txt
src/Hello.java
View file @
7710d67f
public
class
Hello
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"
Hello
"
+
args
[
0
]);
System
.
out
.
println
(
"
I am
"
+
args
[
0
]);
}
}
src/hello.py
View file @
7710d67f
import
sys
print
(
f
"
Hello
{
sys
.
argv
[
1
]
}
"
)
print
(
f
"
I am
{
sys
.
argv
[
1
]
}
"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment