Skip to content

Commit

Permalink
Merge pull request #96 from mkuron/patch-10
Browse files Browse the repository at this point in the history
re-enable kaniko cache
  • Loading branch information
jngrad authored Oct 11, 2019
2 parents 900d981 + 60d7eb3 commit 7e2a2cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion maintainer/docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ else
dest=test/$job_name-$CI_COMMIT_SHA
fi

cmd "/kaniko/executor --context $PWD --dockerfile Dockerfile-$docker_tag* --destination $CI_REGISTRY/$CI_PROJECT_PATH/$dest"
cmd "/kaniko/executor --context $PWD --dockerfile Dockerfile-$docker_tag* --destination $CI_REGISTRY/$CI_PROJECT_PATH/$dest --cache=true --cache-repo $CI_REGISTRY/$CI_PROJECT_PATH/cache"
5 changes: 5 additions & 0 deletions maintainer/docker_clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ for repo_id in $(curl -Ls --header "PRIVATE-TOKEN: $CI_JOB_TOKEN" https://$CI_SE
curl -Ls --request DELETE --data 'name_regex=.+' --data 'older_than=7d' --header "PRIVATE-TOKEN: $CI_JOB_TOKEN" "https://$CI_SERVER_HOST/api/v4/projects/$CI_PROJECT_ID/registry/repositories/$repo_id/tags" | jq
done

# same for the cache repo
repo_id=$(curl -Ls --header "PRIVATE-TOKEN: $CI_JOB_TOKEN" https://$CI_SERVER_HOST/api/v4/projects/$CI_PROJECT_ID/registry/repositories | jq -r '.[] | select(.name == "test/cuda") | [.id] | @tsv')
# delete all tags older than 30 days
curl -Ls --request DELETE --data 'name_regex=.+' --data 'older_than=30d' --header "PRIVATE-TOKEN: $CI_JOB_TOKEN" "https://$CI_SERVER_HOST/api/v4/projects/$CI_PROJECT_ID/registry/repositories/$repo_id/tags" | jq

0 comments on commit 7e2a2cf

Please sign in to comment.