urlhaus-filter/.gitlab-ci.yml

55 lines
1.3 KiB
YAML
Raw Normal View History

2018-10-09 06:18:46 +00:00
image: alpine:latest # Use latest version of Alpine Linux docker image
before_script:
# Install dependencies
- 'which ssh-agent || ( apk update && apk add openssh-client git wget)'
# Run ssh-agent
- eval $(ssh-agent -s)
# Import private key with ed25519 workaround
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
# Create the SSH directory and give it the right permissions
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
# Add gitlab.com as ssh known host
- ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
# Set commit author
- git config --global user.name "curben via GitLab Runner"
- git config --global user.email "curben@users.noreply.gitlab.com"
deploy:
script:
# SSH to gitlab.com
- ssh git@gitlab.com
# Shallow cloning for faster cloning
2018-10-10 04:44:59 +00:00
- git clone --depth 3 git@gitlab.com:curben/urlhaus-filter.git build
2018-10-09 06:18:46 +00:00
# Change to the downloaded repo directory
2018-10-10 06:57:16 +00:00
- cd build/
2018-10-09 06:18:46 +00:00
2018-10-10 01:10:27 +00:00
# Give execute permission to scripts
2018-10-10 06:57:16 +00:00
- cd utils/
- chmod 700 umbrella-top-1m.sh script.sh commit.sh
# Download Umbrella Popularity List
- ./umbrella-top-1m.sh
2018-10-10 01:10:27 +00:00
2018-10-09 06:18:46 +00:00
# Download database dump and process it
2018-10-10 01:10:27 +00:00
- ./script.sh
2018-10-09 06:18:46 +00:00
# Commit the changes
2018-10-10 01:10:27 +00:00
- ./commit.sh
2018-10-09 06:18:46 +00:00
# Push the commit
2018-10-10 06:44:49 +00:00
- cd ../
2018-10-09 06:18:46 +00:00
- git push
only:
- schedules