Skip to content
Snippets Groups Projects
Commit a4afe80f authored by Erick Hitter's avatar Erick Hitter
Browse files
parent 645b6dea
No related branches found
No related tags found
1 merge request!1MVP
.idea
*.iml
image: docker:latest
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
#
# TESTS
#
lint:dockerfile:
stage: test
image: hadolint/hadolint:latest-debian
before_script:
- mkdir ~/.config
- cp ./.hadolint.yaml ~/.config/hadolint.yaml
script:
- find . -name "Dockerfile" -execdir hadolint {} \;
lint:shell-script:
stage: test
image: koalaman/shellcheck-alpine:latest
before_script:
- shellcheck -V
script:
- find . -name "*.sh" -exec shellcheck {} \;
#
# IMAGE BUILDS/PUSHES
#
build:master:
stage: deploy
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:latest" ./context/
- docker push "$CI_REGISTRY_IMAGE:latest"
only:
- master
when: manual
build:dev:
stage: deploy
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:dev" ./context/
- docker push "$CI_REGISTRY_IMAGE:dev"
except:
- master
#!/bin/bash
# Usage: ./deleteOld "bucketname" "30 days"
s3cmd ls s3://$1 | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -d"$createDate" +%s`
olderThan=`date -d"-$2" +%s`
if [[ $createDate -lt $olderThan ]]
then
fileName=`echo $line|awk {'print $4'}`
echo $fileName
if [[ $fileName != "" ]]
then
s3cmd del "$fileName"
fi
fi
done;
#!/bin/bash
# Usage: ./deleteOld "bucketname" "30 days"
s3cmd ls s3://$1 | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -d"$createDate" +%s`
olderThan=`date -d"-$2" +%s`
if [[ $createDate -lt $olderThan ]]
then
fileName=`echo $line|awk {'print $4'}`
echo $fileName
if [[ $fileName != "" ]]
then
s3cmd del "$fileName"
fi
fi
done;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment