Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .circleci/config.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/master.yml

This file was deleted.

58 changes: 58 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
pipeline {

agent {
label 'docker'
}

stages {

stage('Checkout') {
steps {
git changelog: true, branch: "${BRANCH_NAME}", url: 'https://github.com/schemeorg-community/index.scheme.org'
}
}

stage('Build') {
agent {
docker {
image 'docker:cli'
args "-u root"
reuseNode true
}
}
steps {
sh '''
docker build -f ./build/Dockerfile . -t scheme-index:latest
docker create --name dummy scheme-index:latest
docker cp dummy:/schemeindex.zip ./schemeindex.zip
docker rm -f dummy
'''
}
}

stage('Deploy') {
agent {
dockerfile {
filename './deploy/ansible.Dockerfile'
reuseNode true
}
}
when {
branch 'master'
}
steps {
dir('deploy') {
sh 'pip install ansible'
sshagent(credentials: ['index_scheme_org_ssh']) {
sh '''
ssh-keyscan -t rsa index.scheme.org >> ~/.ssh/known_hosts
ansible-playbook -i hosts deploy.yml -e content_zip_file=../schemeindex.zip
'''
}
}
}
}

}

}
6 changes: 6 additions & 0 deletions deploy/ansible.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM python:3.9.20
RUN useradd -ms /bin/bash ansible
USER ansible
RUN pip install ansible
ENV PATH="/home/ansible/.local/bin:$PATH"
RUN mkdir -p /home/ansible/.ssh
Loading