Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
s3-object-expirer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Docker
s3-object-expirer
Commits
8138d786
Commit
8138d786
authored
5 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Basic Dockerfile, installing dependencies
parent
a4afe80f
No related branches found
No related tags found
1 merge request
!1
MVP
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
context/Dockerfile
+10
-17
10 additions, 17 deletions
context/Dockerfile
with
11 additions
and
18 deletions
.gitlab-ci.yml
+
1
−
1
View file @
8138d786
...
@@ -44,6 +44,6 @@ build:dev:
...
@@ -44,6 +44,6 @@ build:dev:
stage
:
deploy
stage
:
deploy
script
:
script
:
-
docker build --pull -t "$CI_REGISTRY_IMAGE:dev" ./context/
-
docker build --pull -t "$CI_REGISTRY_IMAGE:dev" ./context/
-
docker push "$CI_REGISTRY_IMAGE:dev"
#
- docker push "$CI_REGISTRY_IMAGE:dev"
except
:
except
:
-
master
-
master
This diff is collapsed.
Click to expand it.
context/Dockerfile
+
10
−
17
View file @
8138d786
#!/bin/bash
FROM
debian:buster-slim
# Usage: ./deleteOld "bucketname" "30 days"
LABEL
maintainer="ethitter"
LABEL
version="1.0"
s3cmd ls s3://$1 | while read -r line;
RUN
echo
"deb http://security.debian.org/ buster/updates main"
>>
/etc/apt/sources.list
do
createDate=`echo $line|awk {'print $1" "$2'}`
RUN
apt-get update
\
createDate=`date -d"$createDate" +%s`
&&
apt-get
-y
--no-install-recommends
install
\
olderThan=`date -d"-$2" +%s`
s4cmd
\
if [[ $createDate -lt $olderThan ]]
&&
apt-get clean
\
then
&&
rm
-rf
/var/lib/apt/lists/
*
fileName=`echo $line|awk {'print $4'}`
echo $fileName
if [[ $fileName != "" ]]
then
s3cmd del "$fileName"
fi
fi
done;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment