Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
Resin
Client
Commits
b9a67640
Commit
b9a67640
authored
3 years ago
by
Hugo SUBTIL
Browse files
Options
Downloads
Patches
Plain Diff
feat(cicd): rework on automation. Add feature and tag build. Better handling of dependencie proxy
parent
db59d599
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!220
1.14
,
!206
feat: cicid rework
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+34
-42
34 additions, 42 deletions
.gitlab-ci.yml
Dockerfile
+3
-2
3 additions, 2 deletions
Dockerfile
with
37 additions
and
44 deletions
.gitlab-ci.yml
+
34
−
42
View file @
b9a67640
...
...
@@ -3,20 +3,33 @@ stages:
-
build
-
deploy
default
:
services
:
-
name
:
${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09-dind
alias
:
docker
variables
:
DOCKER_TLS_CERTDIR
:
'
'
DOCKER_HOST
:
tcp://docker:2375/
DOCKER_DRIVER
:
overlay2
DEPENDENCY_PROXY
:
${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/
build_branch
:
image
:
${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09
services
:
-
docker:18.09-dind
stage
:
build
except
:
-
master
-
recette
-
dev
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" --build-arg conf=prod .
-
docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
-
docker build --pull -t "$CI_REGISTRY_IMAGE
/feat
:$CI_COMMIT_REF_SLUG" --build-arg conf=prod .
-
docker push "$CI_REGISTRY_IMAGE
/feat
:$CI_COMMIT_REF_SLUG"
build
:
image
:
${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09
services
:
-
docker
:18.09-dind
-
${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/
:18.09-dind
stage
:
build
only
:
-
master
...
...
@@ -26,30 +39,29 @@ build:
-
docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" --build-arg conf=prod .
-
docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
build
_dev
:
build
-release
:
image
:
${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09
services
:
-
docker
:18.09-dind
-
${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/
:18.09-dind
stage
:
build
only
:
-
dev
-
tags
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker build --pull -t "$CI_REGISTRY_IMAGE
:dev
" --build-arg conf=
dev
.
-
docker push "$CI_REGISTRY_IMAGE
:dev
"
-
docker build --pull -t "$CI_REGISTRY_IMAGE
/tags:$CI_COMMIT_TAG
" --build-arg conf=
prod
.
-
docker push "$CI_REGISTRY_IMAGE
/tags:$CI_COMMIT_TAG
"
build_
json_server
:
build_
dev
:
image
:
${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09
services
:
-
docker:18.09-dind
-
${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/
docker:18.09-dind
stage
:
build
only
:
-
dev
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker build --pull -t "$CI_REGISTRY_IMAGE:json_server" ./api/
-
docker push "$CI_REGISTRY_IMAGE:json_server"
when
:
manual
-
docker build --pull -t "$CI_REGISTRY_IMAGE:dev" --build-arg conf=dev .
-
docker push "$CI_REGISTRY_IMAGE:dev"
deploy_dev
:
stage
:
deploy
...
...
@@ -63,19 +75,9 @@ deploy_dev:
-
docker-compose pull web-app
-
docker-compose up -d web-app
-
docker system prune -a -f
deploy_mobile
:
stage
:
deploy
tags
:
-
deploy
only
:
-
mobile
script
:
-
cd /home/mps/ram
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker-compose pull web-app
-
docker-compose up -d web-app
-
docker system prune -a -f
environment
:
name
:
dev
url
:
https://resin-dev.grandlyon.com
deploy_rec
:
stage
:
deploy
...
...
@@ -89,6 +91,10 @@ deploy_rec:
-
docker-compose pull web-app-rec
-
docker-compose up -d web-app-rec
-
docker system prune -a -f
when
:
manual
environment
:
name
:
rec
url
:
https://resin-rec.grandlyon.com
# code_analysis:
# image: skilldlabs/sonar-scanner:3.4.0
...
...
@@ -121,17 +127,3 @@ mr:
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker build --pull -t "$CI_REGISTRY_IMAGE:dev" --build-arg conf=dev .
# Job for auto building pwa in case of issue
# Juste create a new branche 'pwa'
pwa-build
:
image
:
${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09
services
:
-
docker:18.09-dind
stage
:
build
only
:
-
feat/poc-pwa
script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker build --pull -t "$CI_REGISTRY_IMAGE:pwa" --build-arg conf=dev .
-
docker push "$CI_REGISTRY_IMAGE:pwa"
This diff is collapsed.
Click to expand it.
Dockerfile
+
3
−
2
View file @
b9a67640
# Stage 0, based on Node.js, to build and compile Angular
FROM
node:14.18-slim
as
build
ARG
DEPENDENCY_PROXY=
FROM
${DEPENDENCY_PROXY}node:14.18-slim
as
build
WORKDIR
/app
...
...
@@ -24,7 +25,7 @@ ARG conf
RUN
npm run build:prod
# Stage 1, based on Nginx, to have only the compiled app
FROM
nginx
FROM
${DEPENDENCY_PROXY}
nginx
# copy artifact build from the 'build environment'
RUN
apt-get update
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment