Skip to content

Commit 771afa5

Browse files
committed
feat: migrate to buildah, ng:v18
1 parent ca19cd0 commit 771afa5

File tree

10 files changed

+840
-3712
lines changed

10 files changed

+840
-3712
lines changed

.eslintrc.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@
6767
"rules": {
6868
"prettier/prettier": ["error", { "parser": "angular" }]
6969
}
70-
},
71-
{
72-
"files": ["*.json"],
73-
"extends": ["plugin:json/recommended"]
7470
}
7571
]
7672
}

.gitlab-ci.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
variables:
2-
DOCKER_DRIVER: overlay2
3-
DOCKER_TLS_CERTDIR: ""
4-
DOCKER_HOST: tcp://docker:2375
52
SONAR_HOST_URL: https://sonarcloud.io
63

74
image: $CI_REGISTRY/autowp/runner-base-image
@@ -24,28 +21,23 @@ build:
2421
- npx ng lint
2522
- npx stylelint "src/**/*.scss"
2623
- sonar-scanner -Dsonar.login=$SONAR_TOKEN
27-
- ./node_modules/.bin/ng build --configuration production --no-progress --base-href=/ --extra-webpack-config webpack.extra.js
24+
- ./node_modules/.bin/ng build --configuration production --no-progress --base-href=/
2825
- npx semantic-release
2926
rules:
3027
- if: $CI_COMMIT_TAG !~ /^v\d.*/
3128

3229
deploy:
3330
stage: deploy
34-
services:
35-
- name: docker:dind
36-
alias: docker
37-
before_script:
38-
- waitforit -address=tcp://docker:2375 -timeout=30
3931
script:
4032
- npm ci || npm cache clear --force && npm ci
4133
- "jq -n --arg release \"$CI_COMMIT_TAG\" '{release: $release}' > src/version.json"
42-
- ./node_modules/.bin/ng build --configuration production --no-progress --base-href=/ --extra-webpack-config webpack.extra.js
34+
- ./node_modules/.bin/ng build --configuration production --no-progress --base-href=/
4335

44-
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
45-
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY_IMAGE"
46-
- docker pull "$CI_REGISTRY_IMAGE" || true
47-
- docker build . -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
48-
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
36+
- echo "$DOCKER_PASSWORD" | buildah login -u "$DOCKER_USERNAME" --password-stdin docker.io
37+
- echo "$CI_REGISTRY_PASSWORD" | buildah login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
38+
- buildah pull "$CI_REGISTRY_IMAGE" || true
39+
- buildah build . -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
40+
- buildah push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
4941

5042
- sentry-cli releases new "$CI_COMMIT_TAG" || true
5143
- git config --global user.email "$GITLAB_USER_EMAIL"
@@ -58,11 +50,9 @@ deploy:
5850
- git push origin master
5951
- sentry-cli releases finalize "$CI_COMMIT_TAG" || true
6052

61-
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
62-
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY_IMAGE"
63-
- docker pull "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
64-
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" autowp/autowp-frontend:$CI_COMMIT_TAG
65-
- docker push autowp/autowp-frontend:$CI_COMMIT_TAG
53+
- buildah pull "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
54+
- buildah tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" autowp/autowp-frontend:$CI_COMMIT_TAG
55+
- buildah push autowp/autowp-frontend:$CI_COMMIT_TAG
6656
rules:
6757
- if: $CI_COMMIT_TAG =~ /^v\d.*/
6858
environment:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nginxinc/nginx-unprivileged:1-alpine
1+
FROM docker.io/nginxinc/nginx-unprivileged:1-alpine
22

33
LABEL app_name="autowp-frontend" \
44
maintainer="dmitry@pereslegin.ru"

angular.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
},
5454
"architect": {
5555
"build": {
56-
"builder": "ngx-build-plus:browser",
56+
"builder": "@angular-devkit/build-angular:browser",
5757
"options": {
5858
"outputPath": "dist",
5959
"index": "src/index.html",
@@ -168,7 +168,7 @@
168168
}
169169
},
170170
"serve": {
171-
"builder": "ngx-build-plus:dev-server",
171+
"builder": "@angular-devkit/build-angular:dev-server",
172172
"options": {
173173
"browserTarget": "wheelsage:build"
174174
},
@@ -192,9 +192,6 @@
192192
"src/**/*.html"
193193
]
194194
}
195-
},
196-
"test": {
197-
"builder": "ngx-build-plus:karma"
198195
}
199196
}
200197
}

build-dev.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
set -e
44

5-
./node_modules/.bin/ng build --base-href=/ --extra-webpack-config webpack.extra.js --configuration=test
5+
./node_modules/.bin/ng build --base-href=/ --configuration=test
66

77
cp -R ./dist/* ../autowp/frontend/

0 commit comments

Comments
 (0)