Skip to content

Commit 2bc4ef4

Browse files
committed
Build better test container and push it to docker registry
1 parent 3780e07 commit 2bc4ef4

File tree

2 files changed

+42
-28
lines changed

2 files changed

+42
-28
lines changed

misc/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Base Image for kscript testing
2-
FROM ubuntu
2+
FROM ubuntu:18.04
33

44
## update apt cache
55
RUN apt-get update

misc/docker_tests.sh

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,67 @@
22

33

44

5-
# todo push image to docker registry
5+
########################################################################################################################
6+
## Build and upload the image to the registry
7+
68
cd ${KSCRIPT_HOME}/misc
9+
#docker run --name kscript_interactive -it ubuntu:18.04
10+
711
#docker build --no-cache -t kscript_tester .
812
docker build -t kscript_tester .
9-
docker run -it kscript_tester
1013

14+
# quick test -> does it work (see section below)
1115

12-
## or with host-local repo-copy
13-
#cd ~/Desktop/
14-
#git clone https://github.com/holgerbrandl/kscript.git kscript_docker
15-
docker run -it --rm -v $(pwd)/kscript_docker:/kscript kscript_tester
16+
#docker login
1617

17-
cd $KSCRIPT_HOME
18-
docker run -it --rm -v $(pwd):/kscript kscript_tester
19-
docker run -it --rm -v d://projects/misc/kscript:/kscript kscript_tester
20-
docker run -it --rm kscript_tester
18+
## create the versioned tag
19+
docker tag kscript_tester holgerbrandl/kscript_tester:jdk11_kotlin1.3.31_gradle4.10
20+
docker push holgerbrandl/kscript_tester:jdk11_kotlin1.3.31_gradle4.10
2121

22+
## create the latest tag
23+
docker tag kscript_tester holgerbrandl/kscript_tester
24+
docker push holgerbrandl/kscript_tester
2225

23-
#docker rm `docker ps -q -l` # restart it in the background
24-
docker start `docker ps -q -l` # restart it in the background
25-
docker attach `docker ps -q -l` # reattach the terminal & stdin
2626

27-
#curl -Lso /bin/kscript https://raw.githubusercontent.com/holgerbrandl/kscript/abb5f4c6ee72ec90d22c0fe913284e92363cad0e/kscript && chmod u+x /bin/kscript
28-
#curl -Lso /bin/kscript https://www.dropbox.com/s/l5g8vr0wz78y3zy/kscript?dl=1 && chmod u+x /bin/kscript
2927

30-
#kscript --help
28+
########################################################################################################################
29+
## Use the image for testing and debugging
3130

31+
cd ${KSCRIPT_HOME}
3232

33-
## or using github repo
34-
#git clone https://github.com/holgerbrandl/kscript.git
35-
cd kscript
36-
export KSCRIPT_HOME=$(pwd)
3733

38-
./gradlew assemble
34+
docker run -it --rm -v $(pwd)/kscript_docker:/kscript kscript_tester
35+
docker run -it --rm -v $(pwd)/kscript_docker:/kscript a9945a6a860d
3936

40-
wget https://raw.githubusercontent.com/lehmannro/assert.sh/master/assert.sh
41-
chmod u+x assert.sh
37+
## with slash escaped for windows
38+
#docker run -it --rm -v d:/projects/misc/kscript://kscript kscript_tester
39+
#docker run -it -v ${pwd}:/kscript kscript_tester
4240

43-
#export PATH=/kscript/build/libs:$PATH
44-
export PATH=$(pwd):${PATH}
45-
kscript --clear-cache
41+
## path path tp allow env usage within container
42+
export PATH=/kscript/build/libs:$PATH
43+
export KSCRIPT_HOME=/kscript
4644

4745

46+
# https://stackoverflow.com/questions/28302178/how-can-i-add-a-volume-to-an-existing-docker-container
47+
#docker commit a9945a6a860d kscript_tmp
48+
#docker rm `docker ps -q -l` # restart it in the background
49+
#docker start `docker ps -q -l` # restart it in the background
50+
#docker attach `docker ps -q -l` # reattach the terminal & stdin
51+
52+
## rebuild
53+
cd $KSCRIPT_HOME
54+
./gradlew assemble
55+
56+
kscript --clear-cache
57+
58+
## run test suite
59+
# git clone https://github.com/holgerbrandl/kscript kscript_docker
60+
#cd kscript_docker
61+
#test/test_suite.sh
4862
${KSCRIPT_HOME}/test/test_suite.sh
4963

5064

51-
## manuallt test dependency lookup
65+
## manual test dependency lookup
5266
./kscript --clear-cache
5367
rm -rf ~/.m2/; kscript --clear-cache
5468
resolve_deps() { kotlin -classpath kscript.jar kscript.app.DependencyUtil "$@";}

0 commit comments

Comments
 (0)