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
2782ce9b
Commit
2782ce9b
authored
5 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Use s3cmd
parent
f0d3bcaa
Branches
Branches containing commit
No related tags found
1 merge request
!1
MVP
Checking pipeline status
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
context/Dockerfile
+1
-1
1 addition, 1 deletion
context/Dockerfile
context/s3-purge.sh
+2
-2
2 additions, 2 deletions
context/s3-purge.sh
docker-compose.yml
+8
-1
8 additions, 1 deletion
docker-compose.yml
with
11 additions
and
4 deletions
context/Dockerfile
+
1
−
1
View file @
2782ce9b
...
...
@@ -7,7 +7,7 @@ RUN echo "deb http://security.debian.org/ buster/updates main" >> /etc/apt/sourc
RUN
apt-get update
\
&&
apt-get
-y
--no-install-recommends
install
\
s
4
cmd
\
s
3
cmd
\
&&
apt-get clean
\
&&
rm
-rf
/var/lib/apt/lists/
*
...
...
This diff is collapsed.
Click to expand it.
context/s3-purge.sh
+
2
−
2
View file @
2782ce9b
...
...
@@ -6,7 +6,7 @@ export BUCKET_NAME
EXPIRE_AGE_DAYS
=
$(
cat
/s3_expire_days
)
export
EXPIRE_AGE_DAYS
s
4
cmd
--config
=
/s3_config
ls
s3://
"
${
BUCKET_NAME
}
"
|
while
read
-r
line
;
s
3
cmd
--config
=
/s3_config
ls
s3://
"
${
BUCKET_NAME
}
"
|
while
read
-r
line
;
do
createDate
=
$(
echo
"
$line
"
|awk
'{print $1" "$2}'
)
createDate
=
$(
date
-d
"
$createDate
"
+%s
)
...
...
@@ -17,7 +17,7 @@ s4cmd --config=/s3_config ls s3://"${BUCKET_NAME}" | while read -r line;
echo
"
$fileName
"
if
[[
$fileName
!=
""
]]
then
s
4
cmd
--config
=
/s3_config del
"
$fileName
"
s
3
cmd
--config
=
/s3_config del
"
$fileName
"
fi
fi
done
;
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
8
−
1
View file @
2782ce9b
...
...
@@ -3,7 +3,14 @@ services:
s3_object_expirer
:
image
:
containers.ethitter.com:443/docker/s3-object-expirer:latest
restart
:
unless-stopped
configs
:
secrets
:
-
source
:
s3_config
target
:
/s3_config
-
source
:
s3_bucket
target
:
/s3_bucket
-
source
:
s3_expire_days
target
:
/s3_expire_days
secrets
:
s3_config
:
file
:
./config/.s3cfg
s3_bucket
:
...
...
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