Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lenshxm -ind-test #25

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6274266
refactor: add documentation
revant Jan 18, 2023
4069745
docs: docker swarm backup and new-site
revant Jan 18, 2023
29bb724
docs: fix create-site command info
revant Jan 18, 2023
d6ad07f
docs: non interactive unattended-upgrade
revant Jan 23, 2023
f668958
docs: documentation
revant Jan 23, 2023
4745129
ci: add github and gitlab ci
revant Jan 24, 2023
f0aa0a1
ci: install docker
revant Jan 24, 2023
0703f4d
ci: link docker
revant Jan 24, 2023
2c759af
ci: remove docker step
revant Jan 24, 2023
bea38c9
ci: comma separate build args
revant Jan 24, 2023
0113546
ci: set default context
revant Jan 24, 2023
839286b
ci: set context thru args
revant Jan 24, 2023
43b8ef0
ci: set dest thru args
revant Jan 24, 2023
b695b23
ci: set all args thru kaniko-args
revant Jan 24, 2023
f2dd036
docs: ci for github and gitlab
revant Jan 24, 2023
6c73fd6
docs: create-site and cronjob
revant Jan 30, 2023
7b1d9f3
ci: update frappe, erpnext, india_compliance
revant Jan 30, 2023
57153a5
chore: bump image version
revant Jan 30, 2023
2f72eed
docs: update restic command
revant Jan 31, 2023
4bad595
docs: change mariadb helm release command
revant Feb 9, 2023
1e70611
custom lens app 2023
gsarunk Feb 25, 2023
a557071
Merge pull request #11 from lmnaslimited/loud-2023
arun-lmnas Feb 25, 2023
744b0e5
added payments app
gsarunk Feb 25, 2023
d6ee4ff
Merge pull request #12 from lmnaslimited/loud-2023
arun-lmnas Feb 25, 2023
9b1c13b
bench site command missing
gsarunk Feb 26, 2023
2ad4e86
Merge pull request #13 from lmnaslimited/loud-2023
arun-lmnas Feb 26, 2023
b26df31
Image lenshxm v14.11.1 with erpenext payment hrms and lms
gsarunk Feb 26, 2023
2dae1c5
Merge pull request #14 from lmnaslimited/loud-2023
arun-lmnas Feb 26, 2023
ab1fabe
separate branch for lenshxm
gsarunk Feb 26, 2023
d353dbc
Version 14.12.0
gsarunk Mar 11, 2023
fd15b2a
v14.12.0
arun-lmnas Mar 19, 2023
53a2e4c
India compliance added to lenshxm
gsarunk Apr 8, 2023
297bf54
Merge branch 'lenshxm' of https://github.com/lmnaslimited/lensdocker …
gsarunk Apr 8, 2023
b17cc00
with desk app
gsarunk Jul 19, 2023
ca0c27c
python version 3.11.4 used
gsarunk Jul 20, 2023
da7179b
with frappe v14.24.0
gsarunk Jul 20, 2023
4248631
python version
gsarunk Jul 20, 2023
80e5648
apps.json fix
gsarunk Jul 20, 2023
c21e611
erpnext version with v14.24.0
gsarunk Jul 20, 2023
9272f08
python version fix
gsarunk Jul 22, 2023
090d6f6
python v3.10.12
gsarunk Jul 22, 2023
cafacc8
Rebuild lenshxm version v14.12.0 with payments app version 14
gsarunk Nov 20, 2023
068a64b
reverted to python version 3.10.5 and frappe to v14.21.0
gsarunk Nov 21, 2023
9142ac5
frappe version-14
gsarunk Nov 21, 2023
197266b
frappe v14.36.0 erpnext v14.24.0 hrms v14.3.1
gsarunk Nov 23, 2023
24a49b7
lenshxm-ind fv14.36.0, ev14.24.0, hrv14.3.1, icv14.7.0
gsarunk Nov 23, 2023
a45074c
version 14.42.0
gsarunk Feb 22, 2024
d82cb21
Merge pull request #23 from lmnaslimited/hxm-ind-1442
arun-lmnas Feb 22, 2024
1bd6a26
Changed the version of India_compliance
Fathima786Irfana Feb 26, 2024
7c0b14a
Merge pull request #27 from lmnaslimited/hxm-ind-1442
arun-lmnas Feb 26, 2024
b3a0f5b
Removed the helpdesk app from lenshxm image in v14.42.0
Fathima786Irfana Feb 29, 2024
8a9084e
Merge pull request #28 from lmnaslimited/hxm-ind-1442
arun-lmnas Feb 29, 2024
d5ff833
lenshxm-ind:v14.51.0 with frappe-v14.51.0 and ERPNext-v14.44.0
Fathima786Irfana Mar 20, 2024
e1df3e6
Merge pull request #36 from lmnaslimited/hxm-ind-1451
arun-lmnas Mar 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
- package-ecosystem: docker
directory: devcontainer
schedule:
interval: daily

- package-ecosystem: docker
directory: images
directory: kube-devcontainer
schedule:
interval: daily

- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
80 changes: 80 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build Image

on:
push:
branches:
- lenshxm-ind

workflow_dispatch:
inputs:
image:
description: Image name
type: string
version:
description: Image version tag
type: string
frappe-repo:
description: Frappe repo
type: string
frappe-version:
description: Frappe branch
type: string
py-version:
description: Python version
type: string
nodejs-version:
description: NodeJS version
type: string
apps-json-base64:
description: base64 encoded string of apps.json
type: string
context:
description: kaniko context
type: string
dockerfile:
description: dockerfile path from context
type: string
registry-user:
description: registry username
required: false

secrets:
REGISTRY_PASSWORD:
description: registry password
required: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Source Build Env
id: source-build-env
run: |
cat ./ci/build.env >> $GITHUB_ENV
echo "VERSION=$(cat ./ci/version.txt)" >> $GITHUB_ENV
echo "APPS_JSON_BASE64=$(base64 -w 0 ./ci/apps.json)" >> $GITHUB_ENV

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ inputs.registry || env.REGISTRY }}
username: ${{ inputs.registry-user || github.actor }}
password: ${{ secrets.REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}

- uses: int128/kaniko-action@v1
with:
push: true
cache: true
kaniko-args: |
--build-arg=FRAPPE_PATH=${{ inputs.frappe-repo || env.FRAPPE_REPO }}
--build-arg=FRAPPE_BRANCH=${{ inputs.frappe-version || env.FRAPPE_VERSION }}
--build-arg=PYTHON_VERSION=${{ inputs.py-version || env.PY_VERSION }}
--build-arg=NODE_VERSION=${{ inputs.nodejs-version || env.NODEJS_VERSION }}
--build-arg=APPS_JSON_BASE64=${{ inputs.apps-json-base64 || env.APPS_JSON_BASE64 }}
--context=${{ inputs.context || env.CONTEXT }}
--destination=ghcr.io/${{ github.repository }}/${{ inputs.image || env.IMAGE }}:${{ inputs.version || env.VERSION }}
--destination=ghcr.io/${{ github.repository }}/${{ inputs.image || env.IMAGE }}:latest
file: ${{ inputs.dockerfile || env.DOCKERFILE }}
58 changes: 0 additions & 58 deletions .github/workflows/build_latest.yaml

This file was deleted.

64 changes: 0 additions & 64 deletions .github/workflows/build_tags.yaml

This file was deleted.

84 changes: 26 additions & 58 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,35 @@
image: docker:latest

stages:
- build
- deploy

services:
- docker:dind

build_latest:
stage: build
only:
- main
before_script:
# Install os dependencies
- apk --update add openssh-client git jq curl
# Login to container registry
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
# Install buildx
- mkdir -p $HOME/.docker/cli-plugins
- curl -sSLo $HOME/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/v0.8.2/buildx-v0.8.2.linux-amd64
- chmod +x ~/.docker/cli-plugins/docker-buildx
- docker buildx create --name ci_build_latest --use
script:
- ./ci/clone-apps.sh
- export FRAPPE_VERSION=$(jq -r .frappe base_versions.json)
- export ERPNEXT_VERSION=$(jq -r .erpnext base_versions.json)
- export VERSION=latest
- export REGISTRY_NAME=${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}
- export BACKEND_IMAGE_NAME=worker
- export FRONTEND_IMAGE_NAME=nginx
- docker buildx bake --push
# Cleanup runner
- docker buildx stop ci_build_latest
- docker buildx rm ci_build_latest
- docker volume prune -f

build_version:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
only:
refs:
- main
changes:
- version.txt
before_script:
# Install os dependencies
- apk --update add openssh-client git jq curl
# Login to container registry
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
# Install buildx
- mkdir -p $HOME/.docker/cli-plugins
- curl -sSLo $HOME/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/v0.8.2/buildx-v0.8.2.linux-amd64
- chmod +x ~/.docker/cli-plugins/docker-buildx
- docker buildx create --name ci_build_version --use
script:
- ./ci/clone-apps.sh
- export FRAPPE_VERSION=$(jq -r .frappe base_versions.json)
- export ERPNEXT_VERSION=$(jq -r .erpnext base_versions.json)
- export VERSION=$(cat version.txt)
- export REGISTRY_NAME=${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}
- export BACKEND_IMAGE_NAME=worker
- export FRONTEND_IMAGE_NAME=nginx
- docker buildx bake --push
# Cleanup runner
- docker buildx stop ci_build_version
- docker buildx rm ci_build_version
- docker volume prune -f
- |
source ./ci/build.env
mkdir -p /kaniko/.docker
export IMAGE_NAME=${CI_REGISTRY:-${REGISTRY}}/${CI_PROJECT_NAMESPACE:-${PROJECT_NAMESPACE}}/${CI_PROJECT_NAME:-${PROJECT_NAME}}/${IMAGE_NAME:-${IMAGE}}
export BASIC_AUTH=$(echo -n ${CI_REGISTRY_USER}:${CI_JOB_TOKEN} | base64)
echo "{
\"auths\": {
\"${CI_REGISTRY:-${REGISTRY}}\":{
\"auth\": \"${BASIC_AUTH}\"
}
}
}" > /kaniko/.docker/config.json
/kaniko/executor \
--dockerfile=${CONTAINERFILE:-${DOCKERFILE}} \
--context=${BUILD_CONTEXT:-${CONTEXT}} \
--build-arg=FRAPPE_PATH=${FRAPPE_PATH:-${FRAPPE_REPO}} \
--build-arg=FRAPPE_BRANCH=${FRAPPE_BRANCH:-${FRAPPE_VERSION}} \
--build-arg=PYTHON_VERSION=${PYTHON_VERSION:-${PY_VERSION}} \
--build-arg=NODE_VERSION=${NODE_VERSION:-${NODEJS_VERSION}} \
--build-arg=APPS_JSON_BASE64=${APPS_JSON_BASE64:-$(base64 -w 0 ./ci/apps.json)} \
--destination=${IMAGE_NAME}:${VERSION:-$(cat ./ci/version.txt)} \
--destination=${IMAGE_NAME}:latest \
--cache=true
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2021 Castlecraft Ecommerce Pvt. Ltd.
Copyright 2023 Castlecraft Ecommerce Pvt. Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
59 changes: 6 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,7 @@
### Introduction
## Topics

- This repo is based on official frappe_docker documentation to build [custom apps](https://github.com/frappe/frappe_docker/blob/main/custom_app/README.md).
- Fork this repo to build your own image with ERPNext and list of custom Frappe apps.
- Change the `frappe` and `erpnext` versions in `base_versions.json` to use them as base. These values correspond to tags and branch names on the github frappe and erpnext repo. e.g. `version-14`, `v14.18.1`
- Change `ci/clone-apps.sh` script to clone your private and public apps. Read comments in the file to update it as per need. This repo will install following apps:
- https://github.com/castlecraft/cfe
- https://github.com/castlecraft/microsoft_integration
- Change `images/backend.Dockerfile` to copy and install required apps with `install-app`.
- Change `images/frontend.Dockerfile` to install ERPNext if required.
- Change `docker-bake.hcl` for builds as per need.
- Workflows from `.github/workflows` will build latest or tagged images using GitHub. Change as per need.
- Runner will build images automatically and publish to container registry.
- Use `gitlab-ci.yml` in case of Gitlab CI.

### Manually Build images

Execute from root of app repo

Clone,

```shell
./ci/clone-apps.sh
```

Set environment variables,

- `FRAPPE_VERSION` set to use frappe version during building images. Default is `version-14`.
- `ERPNEXT_VERSION` set to use erpnext version during building images. Default is `version-14`.
- `VERSION` set the tag version. Default is `latest`.
- `REGISTRY_NAME` set the registry name. Default is `custom_app`.
- `BACKEND_IMAGE_NAME` set worker image name. Default is `custom_worker`.
- `FRONTEND_IMAGE_NAME` set nginx image name. Default is `custom_nginx`.

Build,

```shell
docker buildx bake -f docker-bake.hcl --load
```

Note:

- Use `docker buildx bake --load` to load images for usage with docker.
- Use `docker buildx bake --push` to push images to registry.
- Use `docker buildx bake --help` for more information.
- Change version in `version.txt` to build tagged images from the changed version.

### Development

Refer development directory to [start development](development/README.md)

### K8s Bench

Refer docs directory to use [Kubernetes Bench Operator](docs/k8s-bench.md)
- [Frappe apps on Kubernetes](docs/kube-devcontainer.md)
- [Frappe apps on Docker Swarm](docs/docker-swarm.md)
- [Custom Devcontainer](docs/devcontainer.md)
- [Setup Kubernetes cluster with k3s](docs/k3s-cluster.md)
- [CI Runner Build API](docs/runner-api.md)
4 changes: 0 additions & 4 deletions base_versions.json

This file was deleted.

Loading