2019-05-11 09:19:25 +00:00
|
|
|
image: alpine:latest # Use the latest version of Alpine Linux docker image
|
2018-10-09 06:18:46 +00:00
|
|
|
|
|
|
|
before_script:
|
|
|
|
# Install dependencies
|
2019-05-28 03:13:57 +00:00
|
|
|
- 'which ssh-agent || ( apk update && apk add openssh-client git grep)'
|
2018-10-09 06:18:46 +00:00
|
|
|
|
|
|
|
# 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
|
2018-11-11 11:22:52 +00:00
|
|
|
- git config --global user.name "curben-bot"
|
|
|
|
- git config --global user.email "curben-bot@users.noreply.gitlab.com"
|
2018-10-09 06:18:46 +00:00
|
|
|
|
|
|
|
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-10 06:57:16 +00:00
|
|
|
- cd build/
|
2018-10-09 06:18:46 +00:00
|
|
|
|
2019-05-27 05:31:57 +00:00
|
|
|
# Run scripts
|
2019-05-29 05:15:08 +00:00
|
|
|
- sh script.sh
|
2018-10-09 06:18:46 +00:00
|
|
|
|
2019-05-28 00:21:49 +00:00
|
|
|
# Commit the changes
|
2019-05-28 00:31:09 +00:00
|
|
|
- sh utils/commit.sh
|
2019-05-28 00:21:49 +00:00
|
|
|
|
2018-10-09 06:18:46 +00:00
|
|
|
# Push the commit
|
|
|
|
- git push
|
|
|
|
|
|
|
|
only:
|
2018-10-11 00:42:35 +00:00
|
|
|
# Allow CI to be triggered by schedule
|
2018-10-09 06:18:46 +00:00
|
|
|
- schedules
|
2018-10-11 00:42:35 +00:00
|
|
|
|
|
|
|
# Allow CI to be triggered manually
|
|
|
|
- web
|