Skip to content

Commit

Permalink
👷 auto releases
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tokyo committed Apr 23, 2020
1 parent eeecad1 commit 903231e
Show file tree
Hide file tree
Showing 12 changed files with 205 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs:
docker-build:
working_directory: ~/repo
docker:
- image: circleci/node:10.16.0
- image: circleci/node:12.10.0
steps:
- checkout
- setup_remote_docker:
Expand Down
8 changes: 8 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Contributing
Greetings fellow engineer! Here's the contributing guideline, please follow it in all your interactions with the project.

- It is crucial to keep the documentation in sync with the code base, so remember to update the docs with your changes.

#### Plural Team
- Please make sure you followed the [Onboarding Guide](https://github.com/pluralcom/plural-docs/tree/master/onboarding).
- Please checkout the [Plural's Software Engineer Guide](https://github.com/pluralcom/plural-docs/tree/master/software-engineer-guidelines).
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

18 changes: 18 additions & 0 deletions .github/pr-branch-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# # Head rules

# Apply label "feature" if base matches "feature/*"
feature:
head: "feature/*"

# Apply label "enhancement" if base matches "enhancement/*"
enhancement:
head: "enhancement/*"

# Apply label "bug" if base matches "hotfix/*"
bug:
head: ["hotfix/*", "bugfix/*"]

# Apply label "tests" if base matches "tests/*"
tests:
head: ["tests/*"]

15 changes: 15 additions & 0 deletions .github/pr-labeler-on-change.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
onComment:
set:
- wip

onApproved:
remove:
- help wanted
set:
- ready

onChangesRequested:
remove:
- invalid
- duplicate
- help wanted
25 changes: 25 additions & 0 deletions .github/workflows/label-assign-creator-reviewers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Label and Assign PR to assignee and reviewers.

on:
pull_request:
types: [opened]

jobs:
automation:
runs-on: ubuntu-latest

steps:
- name: Assign PR to creator
uses: thomaseizinger/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Label PR based on branch
uses: ffittschen/pr-branch-labeler@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Assign Review Request to Tokyo
uses: kunihiko-t/[email protected]
if: github.event.pull_request.user.login != 'a-tokyo'
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
reviewers: "a-tokyo"
21 changes: 21 additions & 0 deletions .github/workflows/merge-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Merge PR

on:
pull_request:
types: [labeled, unlabeled, review_request_removed]
pull_request_review:

jobs:
merge:
runs-on: ubuntu-latest
name: Merge
steps:
- name: Integration check
uses: squalrus/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test: true
reviewers: true
labels: ready
blocking-labels: blocked, archived, wip
method: squash
14 changes: 14 additions & 0 deletions .github/workflows/pr-labeler-on-change.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: PR Labeler on Change

on: [pull_request_review, pull_request_review_comment]

jobs:
label_pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Labeler
uses: estrada9166/labeler@v1
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CONFIG_PATH: .github/pr-labeler-on-change.yml
59 changes: 59 additions & 0 deletions .github/workflows/release-deploy-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release and deploy to docker hub

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: Login to docker hub
if: success()
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

- name: Setup env vars
id: ownEnvVars
run: |
# Set PACKAGE_VERSION
PACKAGE_VERSION=$(node -p -e "require('./package.json').version")
echo ::set-output name=PACKAGE_VERSION::$PACKAGE_VERSION
# Set COMMIT_LOG
COMMIT_LOG=`git log $(git describe --tags --abbrev=0)..HEAD --date=iso-local --format='%cd %h %an - %s '`
echo ::set-output name=COMMIT_LOG::$COMMIT_LOG
# Set DOCKER_IMAGE_NAME
DOCKER_IMAGE_NAME="pluralcom/neo4j"
echo ::set-output name=DOCKER_IMAGE_NAME::$DOCKER_IMAGE_NAME
- name: Build image
if: success()
run: docker build -t ${{ steps.ownEnvVars.outputs.DOCKER_IMAGE_NAME }}:${{ steps.ownEnvVars.outputs.PACKAGE_VERSION }} .

- uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.ownEnvVars.outputs.PACKAGE_VERSION }}
commit: master
body: ${{ steps.ownEnvVars.outputs.COMMIT_LOG }}

- name: Push to docker tag:version
if: success()
uses: actions-hub/docker@master
with:
args: push ${{ steps.ownEnvVars.outputs.DOCKER_IMAGE_NAME }}:${{ steps.ownEnvVars.outputs.PACKAGE_VERSION }}

- name: Slack Notification - Release
uses: rtCamp/[email protected]
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: "dockerBot"
SLACK_CHANNEL: "releases_npm"
SLACK_ICON: "https://avatars0.githubusercontent.com/u/5429470?s=200&v=4"
SLACK_MESSAGE: "🐳 Released Docker image ${{github.repository}} https://github.com/${{github.repository}}/releases/tag/${{ steps.ownEnvVars.outputs.PACKAGE_VERSION }}"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Plural
Copyright (c) 2020 Plural.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# docker-neo4j
Plural's Docker Image for the [Neo4j Graph Database](https://neo4j.com/)
🐳 Plural's Docker Image for the [Neo4j Graph Database](https://neo4j.com/)

![Release and deploy to docker hub](https://github.com/pluralcom/docker-neo4j/workflows/Release%20and%20deploy%20to%20docker%20hub/badge.svg)

## Getting started
Documentation for the Neo4j image can be found [here](http://neo4j.com/docs/operations-manual/current/deployment/single-instance/docker/).
Expand All @@ -23,4 +25,9 @@ docker run \
#### Legal Notes:
- By using this you accept Neo4j's License agreement.

###### Built with ❤️ in California.

#### Extra plugins:
- [neo4j-backup](https://github.com/pluralcom/neo4j-backup) for auto backup and restore of the neo4j data.


[Plural](https://plural.com) ❤️ Open source
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "@pluralcom/docker-neo4j",
"version": "4.0.0-enterprise-p.0",
"private": true,
"description": "🐳 Docker container files that are used to backup Neo4j on EKS' Kubernetes",
"repository": {
"type": "git",
"url": "https://github.com/pluralcom/plural-neo4j-backup.git"
},
"author": {
"name": "Ahmed Tarek",
"email": "[email protected]",
"url": "https://github.com/A-Tokyo"
},
"bugs": {
"url": "https://github.com/pluralcom/eslint-config-plural/issues"
},
"homepage": "https://github.com/pluralcom/eslint-config-plural",
"scripts": {
"test": "docker build . -t test"
},
"keywords": [
"docker",
"neo4j",
"database",
"graph-database",
"aws",
"eks",
"kubernetes",
"plural"
],
"license": "MIT"
}

0 comments on commit 903231e

Please sign in to comment.