From 3042fa052c15e6c0f70be9534fbd8c33f259e562 Mon Sep 17 00:00:00 2001 From: Neli Fonseca Date: Wed, 31 Jan 2024 16:28:33 +0000 Subject: [PATCH 1/4] 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 From 0c229df6bacec291b429393aefac1fdcefe40742 Mon Sep 17 00:00:00 2001 From: Neli Fonseca Date: Wed, 31 Jan 2024 16:37:34 +0000 Subject: [PATCH 2/4] Test --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc22a4e..a2648af 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,5 +12,6 @@ jobs: steps: - name: Test in a sample data run: | + ls -l rsync ${{ secrets.BSUB_SERVER }}:${{ secrets.DATA_PATH }}/emd-8117-v30.xml . xmllint --noout --schema emdb_schemas/current/emdb_relaxed.xsd emd-8117-v30.xml From 5bca0233bddacc45dd8ad1afa3a7c3e3162ea7bd Mon Sep 17 00:00:00 2001 From: Neli Fonseca Date: Wed, 31 Jan 2024 16:40:57 +0000 Subject: [PATCH 3/4] Test --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a2648af..95bea28 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,10 @@ jobs: runs-on: self-hosted steps: + + - name: Checkout repository + uses: actions/checkout@v2 + - name: Test in a sample data run: | ls -l From aabd447a11381d0de70cce8055c4362d8324d6b0 Mon Sep 17 00:00:00 2001 From: Neli Fonseca Date: Wed, 31 Jan 2024 16:42:39 +0000 Subject: [PATCH 4/4] Test --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 95bea28..79f5b03 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,6 +16,5 @@ jobs: - name: Test in a sample data run: | - ls -l rsync ${{ secrets.BSUB_SERVER }}:${{ secrets.DATA_PATH }}/emd-8117-v30.xml . xmllint --noout --schema emdb_schemas/current/emdb_relaxed.xsd emd-8117-v30.xml