* feat:[CI-15236]: Added PLUGIN_TAR_PATH as output variable for the plugin.
* feat:[CI-15236]: Added PLUGIN_TAR_PATH as output variable for the plugin.
* feat:[CI-15236]: Added PLUGIN_TAR_PATH as output variable for the plugin.
* feat:[CI-15236]: Added PLUGIN_TAR_PATH as output variable for the plugin.
* feat:[CI-15236]: Test commit.
* feat:[CI-15236]: Test commit.
* feat:[CI-15236]: Added PLUGIN_TAR_PATH as output variable for the plugin.
* feat:[CI-15236]: Directory check and UTs.
* Update pkg/output/output.go
* feat:[CI-15236]: fixes
* feat:[CI-15236]: Test fixes - removed root
* feat:[CI-15236]: Test fixes - removed root
* feat:[CI-15236]: Test fixes - removed root
* feat:[CI-15236]: If tarPath directory no present it will create it.
* feat:[CI-15236]: If tarPath directory no present it will create it.
* feat:[CI-15236]: fixes
* Update kaniko.go
removed as getTarPath is only called when tarPath isn't empty
---------
Co-authored-by: OP (oppenheimer) <21008429+Ompragash@users.noreply.github.com>
The kaniko flag `snapshotMode` is deprecated in favor of `snapshot-mode`. The default value of `snapshot-mode` is `full`. As a result, the `optimize` flag set in Harness CI's `BuildAndPushToDocker` steps doesn't behave as expected because the `full` mode triggers a full filesystem scan which is slow. The `optimize` flag in Harness translates to `snapshot-mode=redo` which means only filesystem deltas are compared which is much faster.
This change fixes the flag name being sent to Kaniko executor. I verified that the executor present in the current version already supports this flag as shown below:
```
hemanthkumarmantri@Hemanth Kumar harness-core % docker run -it --entrypoint /kaniko/executor plugins/kaniko:1.8.10 --help | grep snapshot-mode
--snapshot-mode string Change the file attributes inspected during snapshotting (default "full")
--snapshotMode string This flag is deprecated. Please use '--snapshot-mode'.
```
* Port the auto tag feature from https://plugins.drone.io/drone-plugins/drone-docker
The logic is forked from https://github.com/drone-plugins/drone-docker code base
with necessary modification. I've tested it e2e for DockerHub on my Drone server
via this plugin image https://hub.docker.com/repository/docker/15cm/drone-kaniko,
for both tag pushes and commit pushes.
With this change the .drone.yml in this repo should work as intended.
Other changes:
- Rename the existing "auto tag" flags/code to "expand tag" for a less
misleading naming.
- ATTENTION: make a breaking change to set default value of "--tags" to empty.
Rationale is to expect most users to use the auto tagging feature. When power
users want to specify tags, they should always explicitly set tags instead of
being surprised by the default "latest" tag.
* Change how --auto-tag flag works with other flags
The --auto-tag has to be a breaking change. This commit limit the breaking
impact to the users who enable the flag. Behaviors of flag combination after
this commit:
* --auto-tag=false: No changes.
* --auto-tag=false,--expand-tag=true,tags=1.0.0:
* Old behavior: Should not happen. --expand-tag didn't exist.
* New Behavior: Build with [1,1.0,1.0.0] tags.
* --auto-tag=true
* Old behavior: Build with the "latest" tag.
* New behavior: Build with auto detected tags. Abort if auto detection failed.
* --auto-tag=true,tags=latest: same as "--auto-tag=true".
* --auto-tag=true,tags=1.0.0:
* Old behavior: Build with [1,1.0,1.0.0] tags.
* New behavior: Abort the build with an error message.
* --auto-tag=true,--expand-tag=true,tags=1.0.0: Abort the build with an error message.
Also added a test for the integration of the BUILD struct and the tagger
package, which is used by kaniko.go.
* Update readme to note that expand-tag and auto-tag don't support artifacts