From 81f3845d685d7830911e1455e87f1df4eb59f7ae Mon Sep 17 00:00:00 2001 From: Nico Reinartz Date: Sun, 19 Nov 2023 17:56:48 +0100 Subject: [PATCH] chore: use own workflow --- .github/ISSUE_TEMPLATE/bug-fix-template.md | 18 ------ .../ISSUE_TEMPLATE/documentation-template.md | 12 ---- .../ISSUE_TEMPLATE/enhancement-template.md | 14 ----- .github/workflows/docker-CI-release.yml | 41 ------------- .github/workflows/docker-CI.yml | 57 ------------------- .github/workflows/docker-image.yml | 49 ++++++++++++++++ .github/workflows/docker-pr.yml | 35 ------------ 7 files changed, 49 insertions(+), 177 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug-fix-template.md delete mode 100644 .github/ISSUE_TEMPLATE/documentation-template.md delete mode 100644 .github/ISSUE_TEMPLATE/enhancement-template.md delete mode 100644 .github/workflows/docker-CI-release.yml delete mode 100644 .github/workflows/docker-CI.yml create mode 100644 .github/workflows/docker-image.yml delete mode 100644 .github/workflows/docker-pr.yml diff --git a/.github/ISSUE_TEMPLATE/bug-fix-template.md b/.github/ISSUE_TEMPLATE/bug-fix-template.md deleted file mode 100644 index aa7ed459..00000000 --- a/.github/ISSUE_TEMPLATE/bug-fix-template.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Bug fix template -about: Template for an issue reporting a bug in the system. -title: "[BUG] Title" -labels: bug -assignees: '' - ---- - -Bug-related issues need to report how, when (how often) and where an issue occurs. To answer these questions, the following sections are defined: - -1. **Summary** - A short description/story on how the issue was first encountered. Intended to be a more readable version of the next section. -2. **Bug Details** - A detailed explanation of the issue, structured in subsections: - 1. **What?** - A short statement of the problem. - 2. **Where?** - In which part of the system or an artifact of the system is the bug occuring? What parts of the system is it influencing? - 3. **When?/How often?** - When does the bug occur? This can be in regards to some causing event or just at particular time; state it. Does it occur regularly? If so, how often? - 4. **How?/Current state** - Here an example of a bug-producing scenario should be given, i.e. the steps that produced the bug. If there is an artifact produced by the bug, show it as well. -3. *(Optional)* **Fixed state** - If a correct state of the system/artifact is known, describe it here. diff --git a/.github/ISSUE_TEMPLATE/documentation-template.md b/.github/ISSUE_TEMPLATE/documentation-template.md deleted file mode 100644 index 698ec8f8..00000000 --- a/.github/ISSUE_TEMPLATE/documentation-template.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: Documentation template -about: Describe this issue template's purp.ose here -title: "[DOC] Title" -labels: documentation -assignees: '' - ---- - -The following sections are required when creating a documentation issue: -1. **Subject** - A statement on what needs to be documented and why, in as much detail as possible. If possible, give a name for the document here. If the issue is in reference to an existing piece of documentation, make sure it is referenced correctly, in particular with regards to the name and section of the referenced document and give a link if possible. -2. **Location** - Specify where the document should be kept. This can be a wiki entry, github/gitlab repository or similar. If the requested piece of documentation is a part of another document, reference that document here. diff --git a/.github/ISSUE_TEMPLATE/enhancement-template.md b/.github/ISSUE_TEMPLATE/enhancement-template.md deleted file mode 100644 index f61ef347..00000000 --- a/.github/ISSUE_TEMPLATE/enhancement-template.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: Enhancement template -about: These issues deal with the addition of new features to the system. -title: "[ENH] Title" -labels: enhancement -assignees: '' - ---- - -The sections for an enhancement issue are: - -1. **Motivation** - A description of the context of the new feature. Answers questions such as: "What is the new feature?", "Why do we need it?/What are we lacking?/What benefits does it bring?", "How does it fit with the rest of the system?". -2. **Specification** - A detailed list of what needs to be done in order to complete the issue. -3. **Finalised state** - A definition of the state of the system when the feature is implemented and fully integrated. Here it should be described how the system will function with the new feature included. diff --git a/.github/workflows/docker-CI-release.yml b/.github/workflows/docker-CI-release.yml deleted file mode 100644 index b5aa9184..00000000 --- a/.github/workflows/docker-CI-release.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Docker Build and Push for releases - -on: - release: - types: [ published, edited ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - # get the tag of the release, e.g. 1.2.3 - - name: Get tag - id: get_tag - shell: bash - run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF#refs/tags/})" - - # get the major version of the release, e.g. for 1.2.3 -> 1 - # use this if you want to have an image with the major version as tag that is always the latest release of this major version - # e.g. new release from 1.2.3 to 1.2.4: create new image with tag 1.2.4 and update image with tag 1 - #- name: Get version - # id: get_version - # shell: bash - # run: | - # TAG=${{ steps.get_tag.outputs.tag }} - # echo "##[set-output name=version;]$(echo ${TAG%%.*})" - - - name: Build the Docker image - run: | - docker build -t registry.tech4comp.dbis.rwth-aachen.de/rwthacis/social-bot-manager:${{ steps.get_tag.outputs.tag }} . - # docker tag registry.tech4comp.dbis.rwth-aachen.de/rwthacis/social-bot-manager:${{ steps.get_tag.outputs.tag }} registry.tech4comp.dbis.rwth-aachen.de/rwthacis/social-bot-manager:${{ steps.get_version.outputs.version }} - - - name: Push to the registry - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PW: ${{ secrets.DOCKER_PW }} - run: | - docker login -u $DOCKER_USERNAME -p $DOCKER_PW registry.tech4comp.dbis.rwth-aachen.de - docker push registry.tech4comp.dbis.rwth-aachen.de/rwthacis/social-bot-manager:${{ steps.get_tag.outputs.tag }} - # docker push registry.tech4comp.dbis.rwth-aachen.de/rwthacis/social-bot-manager:${{ steps.get_version.outputs.version }} diff --git a/.github/workflows/docker-CI.yml b/.github/workflows/docker-CI.yml deleted file mode 100644 index 7622367e..00000000 --- a/.github/workflows/docker-CI.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Docker Build and Push - -on: - push: - - branches: [ master, develop, ma-lakhoune] - - -jobs: - test: - runs-on: ubuntu-latest - env: - DB_DATABASE: LAS2PEERMON - DB_USER: root - DB_PASSWORD: root - WEBCONNECTOR_URL: http://localhost:8080 - steps: - - name: Set up MySQL - run: | - sudo /etc/init.d/mysql start - mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'adopt' - - run: mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} ${{ env.DB_DATABASE }} < ./SBF.sql - # copy etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties.sample to etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties - - run: cp etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties.sample etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties - - run: sed -i "s|databasePassword =|databasePassword = ${{ env.DB_PASSWORD }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties - - run: sed -i "s|databaseUser =|databaseUser = ${{ env.DB_USER }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties - - run: sed -i "s|databaseName =|databaseName = ${{ env.DB_DATABASE }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties - - run: sed -i "s|webconnectorUrl =|webconnectorUrl = ${{ env.WEBCONNECTOR_URL }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties - - name: Grant Gradle permissions - run: chmod +x gradlew - - name: Test with Gradle - run: ./gradlew clean test --stacktrace --info - build: - runs-on: ubuntu-latest - needs: test - steps: - - uses: actions/checkout@v3 - - name: Extract branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - id: extract_branch - - name: Build the Docker image - run: | - docker build -t registry.tech4comp.dbis.rwth-aachen.de/rwthacis/social-bot-manager:${{ steps.extract_branch.outputs.branch }} . - - name: Push to registry - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PW: ${{ secrets.DOCKER_PW }} - run: | - docker login -u $DOCKER_USERNAME -p $DOCKER_PW registry.tech4comp.dbis.rwth-aachen.de - docker push registry.tech4comp.dbis.rwth-aachen.de/rwthacis/social-bot-manager:${{ steps.extract_branch.outputs.branch }} diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 00000000..1c572525 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,49 @@ +name: docker-image + +on: + push: + tags: + - "*" + +env: + VERSION: 1.0.0-dev.1 + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ github.repository }} + ghcr.io/${{ github.repository }} + tags: | + type=raw,value=${{ env.VERSION }} + type=sha + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/docker-pr.yml b/.github/workflows/docker-pr.yml deleted file mode 100644 index e12e5541..00000000 --- a/.github/workflows/docker-pr.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Run tests on pull requests - -on: - pull_request: - branches: [ master, develop] - -jobs: - test: - runs-on: ubuntu-latest - env: - DB_DATABASE: LAS2PEERMON - DB_USER: root - DB_PASSWORD: root - WEBCONNECTOR_URL: http://localhost:8080 - steps: - - name: Set up MySQL - run: | - sudo /etc/init.d/mysql start - mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'adopt' - - run: mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} ${{ env.DB_DATABASE }} < ./SBF.sql - - run: cp etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties.sample etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties - - run: sed -i "s|databasePassword =|databasePassword = ${{ env.DB_PASSWORD }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties - - run: sed -i "s|databaseUser =|databaseUser = ${{ env.DB_USER }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties - - run: sed -i "s|databaseName =|databaseName = ${{ env.DB_DATABASE }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties - - run: sed -i "s|webconnectorUrl =|webconnectorUrl = ${{ env.WEBCONNECTOR_URL }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties - - name: Grant Gradle permissions - run: chmod +x gradlew - - name: Test with Gradle - run: ./gradlew clean test --stacktrace --info \ No newline at end of file