]> gitweb.factorcode.org Git - factor.git/commitdiff
ci.docker: move to docker vocab
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 25 Jan 2023 19:12:04 +0000 (11:12 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 25 Jan 2023 23:19:41 +0000 (15:19 -0800)
extra/ci/docker/authors.txt [deleted file]
extra/ci/docker/docker.factor [deleted file]
extra/docker/authors.txt [new file with mode: 0644]
extra/docker/docker.factor [new file with mode: 0644]

diff --git a/extra/ci/docker/authors.txt b/extra/ci/docker/authors.txt
deleted file mode 100644 (file)
index 7c1b2f2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Doug Coleman
diff --git a/extra/ci/docker/docker.factor b/extra/ci/docker/docker.factor
deleted file mode 100644 (file)
index 2c92704..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-! Copyright (C) 2018 Doug Coleman.
-! See https://factorcode.org/license.txt for BSD license.
-
-USING: io.launcher io.standard-paths json kernel literals
-namespaces sequences strings system ;
-
-IN: ci.docker
-
-SYMBOL: docker-username
-SYMBOL: docker-password
-
-: docker-path ( -- path )
-    "docker" find-in-standard-login-path ;
-
-: docker-machine-path ( -- path )
-    "docker-machine" find-in-standard-login-path ;
-
-: vboxmanage-path ( -- path )
-    "VBoxManage" find-in-standard-login-path ;
-
-: sudo-linux ( seq -- seq' )
-    os linux? [ "sudo" prefix ] when ;
-
-: docker-lines ( seq -- lines )
-    docker-path prefix sudo-linux process-lines ;
-
-: docker-machine-lines ( seq -- lines )
-    docker-machine-path prefix process-lines ;
-
-
-: docker-command ( seq -- )
-    docker-path prefix sudo-linux try-output-process ;
-
-: docker-machine-command ( seq -- )
-    docker-machine-path prefix try-output-process ;
-
-
-: docker-version ( -- string )
-    { "version" } docker-lines ;
-
-: docker-machine-version ( -- string )
-    { "version" } docker-machine-lines ?first ;
-
-
-
-: docker-machine-inspect ( string -- json )
-    { "inspect" } swap suffix docker-machine-lines "" join json> ;
-
-
-: docker-machines ( -- seq )
-    { "ls" "-q" } docker-machine-lines ;
-
-: docker-machine-status ( string -- status )
-    { "status" } swap suffix docker-machine-lines ;
-
-
-: docker-image-names ( -- seq )
-    { "image" "ls" "-q" } docker-lines ;
-
-: docker-image-ls ( -- seq )
-    { "image" "ls" } docker-lines ;
-
-: docker-login ( -- )
-    ${
-        "sudo"
-        docker-path "login"
-        "-p" docker-password get-global
-        "-u" docker-username get-global
-    } run-process drop ;
-
-GENERIC: docker-pull ( obj -- )
-
-M: string docker-pull ( string -- )
-    { "pull" } swap suffix docker-command ;
-
-M: sequence docker-pull ( seq -- )
-    [ docker-pull ] each ;
-
-: docker-hello-world ( -- )
-    { "run" "hello-world" } docker-command ;
diff --git a/extra/docker/authors.txt b/extra/docker/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/extra/docker/docker.factor b/extra/docker/docker.factor
new file mode 100644 (file)
index 0000000..4d2cea7
--- /dev/null
@@ -0,0 +1,80 @@
+! Copyright (C) 2018 Doug Coleman.
+! See https://factorcode.org/license.txt for BSD license.
+
+USING: io.launcher io.standard-paths json kernel literals
+namespaces sequences strings system ;
+
+IN: docker
+
+SYMBOL: docker-username
+SYMBOL: docker-password
+
+: docker-path ( -- path )
+    "docker" find-in-standard-login-path ;
+
+: docker-machine-path ( -- path )
+    "docker-machine" find-in-standard-login-path ;
+
+: vboxmanage-path ( -- path )
+    "VBoxManage" find-in-standard-login-path ;
+
+: sudo-linux ( seq -- seq' )
+    os linux? [ "sudo" prefix ] when ;
+
+: docker-lines ( seq -- lines )
+    docker-path prefix sudo-linux process-lines ;
+
+: docker-machine-lines ( seq -- lines )
+    docker-machine-path prefix process-lines ;
+
+
+: docker-command ( seq -- )
+    docker-path prefix sudo-linux try-output-process ;
+
+: docker-machine-command ( seq -- )
+    docker-machine-path prefix try-output-process ;
+
+
+: docker-version ( -- string )
+    { "version" } docker-lines ;
+
+: docker-machine-version ( -- string )
+    { "version" } docker-machine-lines ?first ;
+
+
+
+: docker-machine-inspect ( string -- json )
+    { "inspect" } swap suffix docker-machine-lines "" join json> ;
+
+
+: docker-machines ( -- seq )
+    { "ls" "-q" } docker-machine-lines ;
+
+: docker-machine-status ( string -- status )
+    { "status" } swap suffix docker-machine-lines ;
+
+
+: docker-image-names ( -- seq )
+    { "image" "ls" "-q" } docker-lines ;
+
+: docker-image-ls ( -- seq )
+    { "image" "ls" } docker-lines ;
+
+: docker-login ( -- )
+    ${
+        "sudo"
+        docker-path "login"
+        "-p" docker-password get-global
+        "-u" docker-username get-global
+    } run-process drop ;
+
+GENERIC: docker-pull ( obj -- )
+
+M: string docker-pull ( string -- )
+    { "pull" } swap suffix docker-command ;
+
+M: sequence docker-pull ( seq -- )
+    [ docker-pull ] each ;
+
+: docker-hello-world ( -- )
+    { "run" "hello-world" } docker-command ;