@fishawack/lab-env 4.35.1 → 4.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/bitbucket-pipelines.yml +2 -0
- package/core/1/CHANGELOG.md +68 -0
- package/core/1/Dockerfile +110 -0
- package/core/1/README.md +9 -0
- package/core/1/bitbucket-pipelines.yml +62 -0
- package/core/1/docker-compose.yml +36 -0
- package/core/1/entrypoint.sh +21 -0
- package/core/1/package.json +46 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 4.35.2 (2024-10-02)
|
|
4
|
+
|
|
5
|
+
#### Build Updates
|
|
6
|
+
|
|
7
|
+
* install submodules during release so avail in npm module ([94f14a5](https://bitbucket.org/fishawackdigital/lab-env/commits/94f14a5849d7ad9027503865dd8d4395c25f077f))
|
|
8
|
+
|
|
3
9
|
### 4.35.1 (2024-10-02)
|
|
4
10
|
|
|
5
11
|
#### Build Updates
|
package/bitbucket-pipelines.yml
CHANGED
|
@@ -54,6 +54,8 @@ pipelines:
|
|
|
54
54
|
- production
|
|
55
55
|
size: 4x
|
|
56
56
|
script:
|
|
57
|
+
# Install lib deps
|
|
58
|
+
- git submodule init && git submodule update
|
|
57
59
|
# Install release deps
|
|
58
60
|
- npm install -g semantic-release@24 @semantic-release/changelog@6 @semantic-release/git@10 conventional-changelog-conventionalcommits@8
|
|
59
61
|
# Release version via node so can exit out when no release made
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
## Changelog
|
|
2
|
+
|
|
3
|
+
### 1.5.0 (2024-10-01)
|
|
4
|
+
|
|
5
|
+
#### Features
|
|
6
|
+
|
|
7
|
+
* commit into lab-env and create pull request against development on publish ([22e9c66](https://bitbucket.org/fishawackdigital/lab-env-core-1/commits/22e9c666dff1e6453090da472a6cd4f0b89c6fbb))
|
|
8
|
+
|
|
9
|
+
#### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* close source branch by default on pull request ([5208373](https://bitbucket.org/fishawackdigital/lab-env-core-1/commits/5208373822272c648a547f9b328720cb4fdf9bd4))
|
|
12
|
+
|
|
13
|
+
### 1.4.2 (2024-10-01)
|
|
14
|
+
|
|
15
|
+
#### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* trigger ci ([301d679](https://bitbucket.org/fishawackdigital/lab-env-core-1/commits/301d6795162f0bf8941a3b9413a30092a3e8bf21))
|
|
18
|
+
|
|
19
|
+
### 1.4.1 (2024-07-17)
|
|
20
|
+
* [fix] set global var for git across file system so git avail in mounted volumes i.e node_modules
|
|
21
|
+
|
|
22
|
+
### 1.4.0 (2024-06-04)
|
|
23
|
+
* [feat] bumped node from 18 to 20
|
|
24
|
+
|
|
25
|
+
### 1.3.3 (2024-02-09)
|
|
26
|
+
* [fix] symlink wine64 now htat wine is the default global command but electron expects wine64
|
|
27
|
+
|
|
28
|
+
### 1.3.2 (2024-01-24)
|
|
29
|
+
* [fix] install latest eb cli and use node images python rather than pyenv
|
|
30
|
+
|
|
31
|
+
### 1.3.1 (2024-01-22)
|
|
32
|
+
* [fix] rebuild of image to get the latest chromium version to fix new puppeteer headless mode
|
|
33
|
+
|
|
34
|
+
### 1.3.0 (2023-03-17)
|
|
35
|
+
* [feat] node user is now added to www-data group for easier file permission management
|
|
36
|
+
* [fix] disable npm message about update being available
|
|
37
|
+
|
|
38
|
+
### 1.2.2 (2023-02-25)
|
|
39
|
+
* [fix] set BRANCH and CI_COMMIT_REF_NAME env variables in container
|
|
40
|
+
* [fix] installed git-branch to fetch the current branch for deployment targets
|
|
41
|
+
* [refactor] moved global node module symlinking to alpine image for future use
|
|
42
|
+
|
|
43
|
+
### 1.2.1 (2023-02-25)
|
|
44
|
+
* [fix] install eb cli into root of image rather than root user directory
|
|
45
|
+
* [perf] dont recurse and dont change group of node_modules to speed up command
|
|
46
|
+
* [refactor] set node git flag without switching user directly in dockerfile
|
|
47
|
+
|
|
48
|
+
### 1.1.4 (2023-02-23)
|
|
49
|
+
* [Fix] Installed missing are-you-es5 global npm module
|
|
50
|
+
* [Fix] Installed missing check-dependencies global npm module
|
|
51
|
+
|
|
52
|
+
### 1.1.3 (2023-02-23)
|
|
53
|
+
* [Fix] Switch to ENV for $PATH updates to avoid shell profile loading issues
|
|
54
|
+
* [Fix] Moved chromium to alpine image as its needed for svg tasks and testing
|
|
55
|
+
|
|
56
|
+
### 1.1.2 (2023-02-22)
|
|
57
|
+
* [Fix] cd into $PWD after su command or we'll start in users home directory
|
|
58
|
+
|
|
59
|
+
### 1.1.1 (2023-02-22)
|
|
60
|
+
* [Fix] Use -l login flag for su command for both non interactive and interactive shells
|
|
61
|
+
* [Fix] Switch $PATH writes to .profile so they are executed on non interactive shells
|
|
62
|
+
|
|
63
|
+
### 1.1.0 (2023-02-22)
|
|
64
|
+
* [Feature] Watertight now baked into image so not needed in package.json of projects
|
|
65
|
+
* [Fix] lftp installed in alpine image as it's needed for content tasks
|
|
66
|
+
|
|
67
|
+
### 1.0.0 (2023-02-21)
|
|
68
|
+
* [Misc] initial commit
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#####
|
|
2
|
+
# Alpine image
|
|
3
|
+
#####
|
|
4
|
+
|
|
5
|
+
FROM node:20.6 AS alpine
|
|
6
|
+
|
|
7
|
+
LABEL org.opencontainers.image.authors="Mike Mellor <mike.mellor@avalerehealth.com>"
|
|
8
|
+
|
|
9
|
+
ARG TARGETARCH
|
|
10
|
+
|
|
11
|
+
WORKDIR /app
|
|
12
|
+
|
|
13
|
+
EXPOSE 3000
|
|
14
|
+
EXPOSE 3001
|
|
15
|
+
|
|
16
|
+
# Get latest apt-get
|
|
17
|
+
RUN apt-get update
|
|
18
|
+
|
|
19
|
+
# Update npm to latest
|
|
20
|
+
RUN npm install -g npm@latest
|
|
21
|
+
|
|
22
|
+
# Install dart sass vm (arch switch)
|
|
23
|
+
RUN curl -L -o /sass.tar.gz https://github.com/sass/dart-sass/releases/download/1.57.1/dart-sass-1.57.1-linux-$(if [ "$TARGETARCH" = "arm64" ]; then echo 'arm64'; else echo 'x64'; fi).tar.gz
|
|
24
|
+
RUN tar -xf /sass.tar.gz -C /
|
|
25
|
+
ENV PATH="${PATH}:/dart-sass/"
|
|
26
|
+
RUN rm -rf /sass.tar.gz
|
|
27
|
+
|
|
28
|
+
# Set safe directory to remove intel errors when running git rev-parse
|
|
29
|
+
RUN su node -c "git config --global --add safe.directory /app"
|
|
30
|
+
|
|
31
|
+
# Also set global git flag for allowing access across filesystems for mounted node_modules dir
|
|
32
|
+
ENV GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
|
33
|
+
|
|
34
|
+
# Disable npm message about updates being available
|
|
35
|
+
RUN su node -c "npm config set update-notifier false"
|
|
36
|
+
|
|
37
|
+
# Add node user to www-data group
|
|
38
|
+
RUN usermod -a -G www-data node
|
|
39
|
+
|
|
40
|
+
# Install lftp
|
|
41
|
+
RUN apt-get install -y lftp
|
|
42
|
+
|
|
43
|
+
# Install chromium
|
|
44
|
+
RUN apt-get install -y chromium fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends
|
|
45
|
+
# Stop Puppeteer downloading browsers during npm install
|
|
46
|
+
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
|
47
|
+
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
|
|
48
|
+
|
|
49
|
+
# Install package.json checker
|
|
50
|
+
RUN npm install check-dependencies -g
|
|
51
|
+
|
|
52
|
+
# Install node_modules checker
|
|
53
|
+
RUN npm install are-you-es5 -g
|
|
54
|
+
|
|
55
|
+
# Install git branch fetcher
|
|
56
|
+
RUN npm install git-branch -g
|
|
57
|
+
|
|
58
|
+
# Link root global node_modules to ~/.node_modules
|
|
59
|
+
RUN ln -s /usr/local/lib/node_modules/ /home/node/.node_modules
|
|
60
|
+
|
|
61
|
+
# Cleanup apt-get install folders
|
|
62
|
+
RUN apt-get clean && \
|
|
63
|
+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
64
|
+
|
|
65
|
+
COPY entrypoint.sh /bin/entrypoint.sh
|
|
66
|
+
RUN chmod +x /bin/entrypoint.sh
|
|
67
|
+
ENTRYPOINT ["/bin/entrypoint.sh"]
|
|
68
|
+
|
|
69
|
+
#####
|
|
70
|
+
# Full image
|
|
71
|
+
#####
|
|
72
|
+
|
|
73
|
+
FROM alpine AS full
|
|
74
|
+
|
|
75
|
+
# Get latest apt-get
|
|
76
|
+
RUN apt-get update
|
|
77
|
+
|
|
78
|
+
# Install ghostscript
|
|
79
|
+
RUN apt-get install -y ghostscript
|
|
80
|
+
|
|
81
|
+
# Install zip
|
|
82
|
+
RUN apt-get install zip
|
|
83
|
+
|
|
84
|
+
# Install AWS Elastic Beanstalk cli
|
|
85
|
+
ENV PATH="${PATH}:/.ebcli-virtual-env/executables"
|
|
86
|
+
RUN apt-get -y install python-is-python3 python3-pip && \
|
|
87
|
+
pip install virtualenv --break-system-packages && \
|
|
88
|
+
git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git ~/aws-eb && \
|
|
89
|
+
python ~/aws-eb/scripts/ebcli_installer.py --location / && \
|
|
90
|
+
rm -rf ~/aws-eb
|
|
91
|
+
|
|
92
|
+
# Install AWS-CLI@2 (arch switch)
|
|
93
|
+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(if [ "$TARGETARCH" = "arm64" ]; then echo 'aarch64'; else echo 'x86_64'; fi).zip" -o "awscliv2.zip"
|
|
94
|
+
RUN unzip awscliv2.zip
|
|
95
|
+
RUN ./aws/install
|
|
96
|
+
RUN rm -rf ./aws && rm -rf awscliv2.zip
|
|
97
|
+
|
|
98
|
+
# Update electron globally
|
|
99
|
+
RUN npm install -g electron-packager@latest
|
|
100
|
+
|
|
101
|
+
# Install wine64
|
|
102
|
+
RUN apt-get install -y wine64 && \
|
|
103
|
+
ln -s /usr/bin/wine /usr/bin/wine64
|
|
104
|
+
|
|
105
|
+
# Install watertight
|
|
106
|
+
RUN --mount=type=ssh npm install -g git+ssh://git@bitbucket.org/fishawackdigital/watertight-node-auto.git#v6.0.0
|
|
107
|
+
|
|
108
|
+
# Cleanup apt-get install folders
|
|
109
|
+
RUN apt-get clean && \
|
|
110
|
+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
package/core/1/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
definitions:
|
|
2
|
+
services:
|
|
3
|
+
docker:
|
|
4
|
+
image: docker:dind
|
|
5
|
+
memory: 12288
|
|
6
|
+
|
|
7
|
+
pipelines:
|
|
8
|
+
branches:
|
|
9
|
+
master:
|
|
10
|
+
- step:
|
|
11
|
+
image: fishawack/aws-runner
|
|
12
|
+
runs-on:
|
|
13
|
+
- self.hosted
|
|
14
|
+
- linux
|
|
15
|
+
- production
|
|
16
|
+
size: 4x
|
|
17
|
+
script:
|
|
18
|
+
# Copy ssh keys so physical files exist for agent to use
|
|
19
|
+
- cp /build/*/ssh/* ~/.ssh/
|
|
20
|
+
# Start ssh agent and add all (if any) keys
|
|
21
|
+
- eval `ssh-agent` && ssh-add || true
|
|
22
|
+
# Install release deps
|
|
23
|
+
- npm install -g semantic-release@24 @semantic-release/changelog@6 @semantic-release/git@10 conventional-changelog-conventionalcommits@8
|
|
24
|
+
# Release version
|
|
25
|
+
- semantic-release --repositoryUrl=https://$GIT_CREDENTIALS@bitbucket.org/$BITBUCKET_REPO_FULL_NAME
|
|
26
|
+
# Publish docker image
|
|
27
|
+
- docker login $DOCKER_CREDENTIALS && docker buildx create --use && npm run image
|
|
28
|
+
# Sync development after publish
|
|
29
|
+
- git fetch origin "+refs/heads/*:refs/remotes/origin/*" && git checkout -b development origin/development && git merge master && git push origin development
|
|
30
|
+
# Commit and create pull request for new version on lab-env repo
|
|
31
|
+
- git config --global user.email "digital@fishawack.com"
|
|
32
|
+
- git config --global user.name "Digital Fishawack"
|
|
33
|
+
- git clone https://$GIT_CREDENTIALS@bitbucket.org/fishawackdigital/lab-env
|
|
34
|
+
- cd lab-env
|
|
35
|
+
- git checkout -b "$BITBUCKET_REPO_SLUG-$BITBUCKET_COMMIT" origin/development
|
|
36
|
+
- git submodule init
|
|
37
|
+
- git submodule update
|
|
38
|
+
- git submodule update --remote --merge core/1
|
|
39
|
+
- git add .
|
|
40
|
+
- |
|
|
41
|
+
git commit --allow-empty -m "build: Bumped $BITBUCKET_REPO_SLUG"
|
|
42
|
+
- git push origin "$BITBUCKET_REPO_SLUG-$BITBUCKET_COMMIT"
|
|
43
|
+
- |
|
|
44
|
+
curl https://api.bitbucket.org/2.0/repositories/fishawackdigital/lab-env/pullrequests \
|
|
45
|
+
-u $GIT_CREDENTIALS \
|
|
46
|
+
--header 'Content-Type: application/json' \
|
|
47
|
+
--data "{
|
|
48
|
+
\"title\": \"Bumped $BITBUCKET_REPO_SLUG\",
|
|
49
|
+
\"destination\": {
|
|
50
|
+
\"branch\": {
|
|
51
|
+
\"name\": \"development\"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
\"source\": {
|
|
55
|
+
\"branch\": {
|
|
56
|
+
\"name\": \"$BITBUCKET_REPO_SLUG-$BITBUCKET_COMMIT\"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
\"close_source_branch\": true
|
|
60
|
+
}"
|
|
61
|
+
services:
|
|
62
|
+
- docker
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
services:
|
|
2
|
+
core:
|
|
3
|
+
build:
|
|
4
|
+
context: $FW_CORE_1_CONTEXT
|
|
5
|
+
target: $FW_CORE_1_TARGET
|
|
6
|
+
ssh:
|
|
7
|
+
- default
|
|
8
|
+
args:
|
|
9
|
+
target: $FW_CORE_1_TARGET
|
|
10
|
+
target_image: $FW_CORE_1_TARGET_IMAGE
|
|
11
|
+
image: $FW_CORE_1_IMAGE:${FW_CORE_1_VERSION:-latest}
|
|
12
|
+
init: true
|
|
13
|
+
tty: true
|
|
14
|
+
volumes:
|
|
15
|
+
- $CWD/:/app
|
|
16
|
+
- $FW_DIR/targets:/home/node/targets
|
|
17
|
+
- $FW_DIR/.ssh:/home/node/.ssh
|
|
18
|
+
- $FW_DIR/.aws:/home/node/.aws
|
|
19
|
+
- node_modules:/app/node_modules
|
|
20
|
+
ports:
|
|
21
|
+
- ${PORT:-3000}:${PORT:-3000}
|
|
22
|
+
- ${PORT_OPT:-3001}:${PORT_OPT:-3001}
|
|
23
|
+
environment:
|
|
24
|
+
- REPO=${REPO:-}
|
|
25
|
+
- PORT=${PORT:-3000}
|
|
26
|
+
- PORT_OPT=${PORT_OPT:-3001}
|
|
27
|
+
- PORT_WEB=${PORT_WEB:-8000}
|
|
28
|
+
- PORT_DB=${PORT_DB:-3306}
|
|
29
|
+
- USER_UID=${USER_UID:-0}
|
|
30
|
+
- USER_GID=${USER_GID:-0}
|
|
31
|
+
- FW_ROOT=${FW_ROOT:-}
|
|
32
|
+
- BRANCH=${BRANCH:-}
|
|
33
|
+
- CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME:-}
|
|
34
|
+
volumes:
|
|
35
|
+
node_modules:
|
|
36
|
+
driver: "local"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Setting $FW_ROOT will bypass the user switch to node
|
|
4
|
+
if [ -z "$FW_ROOT" ]; then
|
|
5
|
+
# Set node user id to match host users id so no permission issues outside of docker
|
|
6
|
+
usermod -u $USER_UID node &>/dev/null
|
|
7
|
+
|
|
8
|
+
# Own the node_modules folder otherwise it'll be owned by root/previous node id which will prevent writing
|
|
9
|
+
chown node /app/node_modules
|
|
10
|
+
|
|
11
|
+
# Default arguments will always be bash -l, if nothing follows this just start an non login interactive shell
|
|
12
|
+
if [ -z "${@:3}" ]; then
|
|
13
|
+
exec su node
|
|
14
|
+
# Otherwise pipe the command after the bash -lc into the non login non interactive shell as a command to exec
|
|
15
|
+
else
|
|
16
|
+
exec su node -c "${@:3}"
|
|
17
|
+
fi
|
|
18
|
+
else
|
|
19
|
+
echo "Accessing as root"
|
|
20
|
+
exec "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "core",
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "lab-env docker config for the @fishawack/core/1 npm module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"image": "docker buildx build --ssh default --platform linux/amd64,linux/arm64 -t fishawack/lab-env-core-1:$npm_package_version -t fishawack/lab-env-core-1:latest --push . && docker buildx build --ssh default --target alpine --platform linux/amd64,linux/arm64 -t fishawack/lab-env-core-1-alpine:$npm_package_version -t fishawack/lab-env-core-1-alpine:latest --push ."
|
|
7
|
+
},
|
|
8
|
+
"author": "Mike Mellor",
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"release": {
|
|
11
|
+
"plugins": [
|
|
12
|
+
[
|
|
13
|
+
"@semantic-release/commit-analyzer",
|
|
14
|
+
{
|
|
15
|
+
"preset": "conventionalcommits"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"@semantic-release/release-notes-generator",
|
|
20
|
+
{
|
|
21
|
+
"preset": "conventionalcommits",
|
|
22
|
+
"writerOpts": {
|
|
23
|
+
"headerPartial": "### {{version}} ({{date}})\n",
|
|
24
|
+
"mainTemplate": "{{> header}}\n{{#each commitGroups}}\n\n{{#if title}}\n#### {{title}}\n\n{{/if}}\n{{#each commits}}\n{{> commit root=@root}}\n{{/each}}\n{{/each}}"
|
|
25
|
+
},
|
|
26
|
+
"presetConfig": {
|
|
27
|
+
"commitUrlFormat": "{{host}}/{{owner}}/{{repository}}/commits/{{hash}}"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
"@semantic-release/changelog",
|
|
33
|
+
{
|
|
34
|
+
"changelogTitle": "## Changelog"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
"@semantic-release/npm",
|
|
39
|
+
{
|
|
40
|
+
"npmPublish": false
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"@semantic-release/git"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|