From 3042fa052c15e6c0f70be9534fbd8c33f259e562 Mon Sep 17 00:00:00 2001 From: Neli Fonseca Date: Wed, 31 Jan 2024 16:28:33 +0000 Subject: [PATCH] New CI/CD pipelines --- .github/workflows/deployment.yml | 22 ++++++++++++++++++++++ .github/workflows/main.yml | 16 ---------------- .github/workflows/test.yml | 16 ++++++++++++++++ 3 files changed, 38 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/deployment.yml delete mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml new file mode 100644 index 0000000..c1e6c63 --- /dev/null +++ b/.github/workflows/deployment.yml @@ -0,0 +1,22 @@ +on: + pull_request: + branches: + - master + types: [closed] + +jobs: + deployment: + if: github.event.pull_request.merged == true + runs-on: + - self-hosted + steps: + - name: Pull repository + run: + ssh ${{ secrets.BSUB_SERVER }} "git -C ${{ secrets.DEPLOY_PATH }}/ pull" + - name: Deploy + run: | + ssh ${{ secrets.BSUB_SERVER }} "bsub -K -q datamover 'cd ${{ secrets.DEPLOY_PATH }} && find . -name \"*.xsd\" -exec cp --parents {} ${{ secrets.FTP_PATH2 }}/ \\;'" + ssh ${{ secrets.BSUB_SERVER }} "bsub -K -q datamover 'rsync -av ${{ secrets.DEPLOY_PATH }}/emdb_schemas/ ${{ secrets.FTP_PATH }}/'" + - name: Send e-mail + run: + echo "The AddedAnnotations repository was pulled and moved to production." | mail -s "[emdb-emicss] addedAnnotations has updated" pdb_em@ebi.ac.uk \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 93d71e6..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,16 +0,0 @@ -on: - push: - branches: - - master - -jobs: - deployment: - runs-on: ubuntu-latest - steps: - - name: HTTP Request Action - uses: fjogeleit/http-request-action@v1.11.1 - with: - url: 'https://wwwdev.ebi.ac.uk/emdb/jkn/job/emdb_schemas_cd/build?token=emdb_trigger' - method: 'POST' - username: ${{ secrets.JENKINS_USERNAME }} - password: ${{ secrets.JENKINS_API_KEY }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..dc22a4e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,16 @@ +name: Run Unit Tests + +on: + pull_request: + branches: + - master + +jobs: + test: + runs-on: self-hosted + + steps: + - name: Test in a sample data + run: | + rsync ${{ secrets.BSUB_SERVER }}:${{ secrets.DATA_PATH }}/emd-8117-v30.xml . + xmllint --noout --schema emdb_schemas/current/emdb_relaxed.xsd emd-8117-v30.xml