schuellerf / xfce-test

Docker/Xephyr environment for XFCE testing
MIT License
56 stars 15 forks source link

Modify parsing of tags #43

Open JCGoran opened 3 years ago

JCGoran commented 3 years ago

Fixes #41. Instead of Git tags, it now parses Dockerhub tags instead. Additionally, now it always uses 'latest' as the default tag.

JCGoran commented 3 years ago

Okay, your first suggestion was simple to fix, but the second was a bit trickier, and I will admit that my solution is somewhat hacky. That said, the following used to break the script:

# invalid tag (unless it's available locally)
$ export TAG='asdf' && ./xfce-test start
# invalid Dockerhub tag
$ ./xfce-test pull asdf

Now it doesn't break anymore, and the output with an invalid tag looks something like this:

$ export TAG='asdf' && ./xfce-test start
The tag 'asdf' was not found on Dockerhub
---
The following tags are available on Dockerhub:
latest
audio_test
...
ubuntu_20.04-xfce-4.16pre2
ubuntu_xfce-4.16pre1
xubuntu_19.04
Attempting to find the tag 'asdf' locally...
The tag 'asdf' was not found locally
---
The following tags are available locally:
latest
ubuntu_20.04-xfce-4.16pre2
Unable to find the tag 'asdf' either on Dockerhub or locally, exiting...

while the pull version outputs just the Dockerhub tags and exits gracefully. This is a bit lengthy, but could be fixed separately by adding a verbosity flag or something to the script itself.