Browse Source

CICD for packages and containers

pull/531/head
Guillaume Vincent 4 years ago
parent
commit
a73daf6a1e
6 changed files with 69 additions and 46 deletions
  1. +29
    -0
      .github/workflows/deploy-containers.yml
  2. +29
    -0
      .github/workflows/deploy-packages.yml
  3. +0
    -43
      .github/workflows/deploy.yml
  4. +9
    -0
      .github/workflows/test.yml
  5. +1
    -2
      containers/deploy
  6. +1
    -1
      packages/deploy

+ 29
- 0
.github/workflows/deploy-containers.yml View File

@@ -0,0 +1,29 @@
name: deploy-containers

on:
push:
paths:
- 'containers/**'

jobs:
test-containers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: test containers
run: |
cd container
./test

deploy-containers:
runs-on: ubuntu-latest
needs: test-containers
steps:
- uses: actions/checkout@v2
- name: deploy containers
run: |
cd containers
./deploy
env:
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}

+ 29
- 0
.github/workflows/deploy-packages.yml View File

@@ -0,0 +1,29 @@
name: deploy-packages

on:
push:
paths:
- 'packages/**'

jobs:
test-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: test packages
run: |
yarn install
yarn test

deploy-packages:
runs-on: ubuntu-latest
needs: test-packages
steps:
- uses: actions/checkout@v2
- name: deploy packages
run: |
cd packages
./deploy
continue-on-error: true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

+ 0
- 43
.github/workflows/deploy.yml View File

@@ -1,43 +0,0 @@
name: deploy

on:
push:
tags:
- '*'

jobs:
deploy-containers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: deploy containers
run: |
./bin/deploy_containers
env:
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}

deploy-node-modules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: deploy node modules
run: |
./bin/deploy_node_modules
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

deploy-web-extensions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: deploy web extensions
run: |
./bin/deploy_web_extensions
env:
EXTENSION_ID: ${{ secrets.EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}

+ 9
- 0
.github/workflows/test.yml View File

@@ -51,3 +51,12 @@ jobs:
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python manage.py test

test-containers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: test containers
run: |
cd container
./test

bin/deploy_containers → containers/deploy View File

@@ -16,12 +16,10 @@ set -o pipefail
set -o nounset

function build_and_push_container {
pushd containers
container=$1
docker build --tag lesspass/${container} ./${container}
docker tag lesspass/${container} quay.io/lesspass/${container}
docker push quay.io/lesspass/${container}
popd
}

function build_and_push_containers {
@@ -29,6 +27,7 @@ function build_and_push_containers {
build_and_push_container webserver
build_and_push_container backend
build_and_push_container frontend
build_and_push_container blog
}

build_and_push_containers

bin/deploy_node_modules → packages/deploy View File

@@ -21,7 +21,7 @@ function push_packages_on_npm {
projects="lesspass lesspass-crypto lesspass-entropy lesspass-fingerprint lesspass-pure lesspass-render-password"
for project in ${projects}
do
pushd packages/${project}
pushd ${project}
yarn publish --non-interactive
popd
done

Loading…
Cancel
Save