Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DojoCLI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dojo Project (HES-SO)
Projects
UI
DojoCLI
Commits
6e775eb4
Commit
6e775eb4
authored
1 year ago
by
michael.minelli
Browse files
Options
Downloads
Patches
Plain Diff
CI/CD => Add DOTENV_KEY for production
parent
df2697ee
Branches
Branches containing commit
No related tags found
1 merge request
!2
Adds a first version of the wiki documentation
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+16
-14
16 additions, 14 deletions
.gitlab-ci.yml
with
16 additions
and
14 deletions
.gitlab-ci.yml
+
16
−
14
View file @
6e775eb4
...
@@ -3,6 +3,8 @@ variables:
...
@@ -3,6 +3,8 @@ variables:
GIT_SUBMODULE_FORCE_HTTPS
:
"
true"
GIT_SUBMODULE_FORCE_HTTPS
:
"
true"
SECURE_FILES_DOWNLOAD_PATH
:
'
./'
SECURE_FILES_DOWNLOAD_PATH
:
'
./'
PROJECT_NAME
:
DojoCLI
BIN_NAME
:
dojo
BIN_NAME
:
dojo
MACOS_PKG_EXTENSION
:
'
.pkg'
MACOS_PKG_EXTENSION
:
'
.pkg'
...
@@ -62,18 +64,14 @@ variables:
...
@@ -62,18 +64,14 @@ variables:
-
PACKAGE_URL_MACOS_X64_PKG="${PACKAGE_REGISTRY_URL}_macOS-pkg-x64/${VERSION}/${MACOS_PKG_BIN_NAME}"
-
PACKAGE_URL_MACOS_X64_PKG="${PACKAGE_REGISTRY_URL}_macOS-pkg-x64/${VERSION}/${MACOS_PKG_BIN_NAME}"
# Wiki
# Wiki
-
WIKI_ARCHIVE_NAME="
DojoCLI
_Wiki_${VERSION}.tar.xz"
-
WIKI_ARCHIVE_NAME="
${PROJECT_NAME}
_Wiki_${VERSION}.tar.xz"
-
PACKAGE_URL_WIKI="${PACKAGE_REGISTRY_URL}_Wi
ndows-x64
/${VERSION}/${WIKI_ARCHIVE_NAME}"
-
PACKAGE_URL_WIKI="${PACKAGE_REGISTRY_URL}_Wi
ki
/${VERSION}/${WIKI_ARCHIVE_NAME}"
.build_cli
:
.build_cli
:
script
:
script
:
-
cd NodeApp
-
cd NodeApp
# Download secure files
-
curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash
-
mv env_$VERSION .env
# Install dependencies
# Install dependencies
-
npm install
-
npm install
-
npm run build
-
npm run build
...
@@ -155,7 +153,7 @@ test:build:
...
@@ -155,7 +153,7 @@ test:build:
# Build
# Build
-
!reference
[
.build_cli
,
script
]
-
!reference
[
.build_cli
,
script
]
rules
:
rules
:
-
if
:
'
$CI_COMMIT_
TAG
=~
"/^$/"
&&
$CI_COMMIT_BRANCH
!=
$CI_DEFAULT_BRANCH
&&
$CI_COMMIT_BRANCH
!~
/^v[0-9]+(\.[0-9]+)*$/
'
-
if
:
'
$CI_COMMIT_
REF_PROTECTED
==
"true"
'
build:version
:
build:version
:
...
@@ -170,6 +168,10 @@ build:version:
...
@@ -170,6 +168,10 @@ build:version:
-
mkdir -p $ARTIFACTS_FOLDER
-
mkdir -p $ARTIFACTS_FOLDER
-
echo $VERSION > $VERSION_FILE
-
echo $VERSION > $VERSION_FILE
-
|
echo "Replace DOTENV_KEY if we are on a protected branch" # Hide the print of the DOTENV_PROD_KEY
sed -r "s/(DOTENV_KEY[ ]*:[ ]*[\'\"\`])[^'\"\`]*([\'\"\`])/\${DOTENV_PROD_KEY}\2/g" src/app.ts > src/app.ts;
# Build
# Build
-
!reference
[
.build_cli
,
script
]
-
!reference
[
.build_cli
,
script
]
artifacts
:
artifacts
:
...
@@ -178,7 +180,7 @@ build:version:
...
@@ -178,7 +180,7 @@ build:version:
-
$ARTIFACTS_FOLDER/*
-
$ARTIFACTS_FOLDER/*
expire_in
:
1 hour
expire_in
:
1 hour
rules
:
rules
:
-
if
:
'
$CI_COMMIT_
BRANCH
==
$CI_DEFAULT_BRANCH
||
$CI_COMMIT_BRANCH
=~
/^v[0-9]+(\.[0-9]+)*$/
'
-
if
:
'
$CI_COMMIT_
REF_PROTECTED
==
"true"
'
sign:macos
:
sign:macos
:
...
@@ -203,7 +205,7 @@ sign:macos:
...
@@ -203,7 +205,7 @@ sign:macos:
-
$ARTIFACTS_FOLDER/*
-
$ARTIFACTS_FOLDER/*
expire_in
:
1 hour
expire_in
:
1 hour
rules
:
rules
:
-
if
:
'
$CI_COMMIT_
BRANCH
==
$CI_DEFAULT_BRANCH
||
$CI_COMMIT_BRANCH
=~
/^v[0-9]+(\.[0-9]+)*$/
'
-
if
:
'
$CI_COMMIT_
REF_PROTECTED
==
"true"
'
clean:release
:
clean:release
:
...
@@ -215,7 +217,7 @@ clean:release:
...
@@ -215,7 +217,7 @@ clean:release:
-
!reference
[
.get_version
,
script
]
-
!reference
[
.get_version
,
script
]
-
!reference
[
.clean_release
,
script
]
-
!reference
[
.clean_release
,
script
]
rules
:
rules
:
-
if
:
'
$CI_COMMIT_
BRANCH
==
$CI_DEFAULT_BRANCH
||
$CI_COMMIT_BRANCH
=~
/^v[0-9]+(\.[0-9]+)*$/
'
-
if
:
'
$CI_COMMIT_
REF_PROTECTED
==
"true"
'
clean:packages
:
clean:packages
:
...
@@ -227,7 +229,7 @@ clean:packages:
...
@@ -227,7 +229,7 @@ clean:packages:
-
!reference
[
.get_version
,
script
]
-
!reference
[
.get_version
,
script
]
-
!reference
[
.clean_packages
,
script
]
-
!reference
[
.clean_packages
,
script
]
rules
:
rules
:
-
if
:
'
$CI_COMMIT_
BRANCH
==
$CI_DEFAULT_BRANCH
||
$CI_COMMIT_BRANCH
=~
/^v[0-9]+(\.[0-9]+)*$/
'
-
if
:
'
$CI_COMMIT_
REF_PROTECTED
==
"true"
'
clean:dev:release
:
clean:dev:release
:
...
@@ -281,7 +283,7 @@ upload:packages:
...
@@ -281,7 +283,7 @@ upload:packages:
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
${BIN_FILE_WINDOWS_ARM64}
"${PACKAGE_URL_WINDOWS_ARM64_BIN}";'
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
${BIN_FILE_WINDOWS_ARM64}
"${PACKAGE_URL_WINDOWS_ARM64_BIN}";'
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
${BIN_FILE_WINDOWS_X64}
"${PACKAGE_URL_WINDOWS_X64_BIN}";'
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
${BIN_FILE_WINDOWS_X64}
"${PACKAGE_URL_WINDOWS_X64_BIN}";'
rules
:
rules
:
-
if
:
'
$CI_COMMIT_
BRANCH
==
$CI_DEFAULT_BRANCH
||
$CI_COMMIT_BRANCH
=~
/^v[0-9]+(\.[0-9]+)*$/
'
-
if
:
'
$CI_COMMIT_
REF_PROTECTED
==
"true"
'
upload:packages:wiki
:
upload:packages:wiki
:
...
@@ -304,7 +306,7 @@ upload:packages:wiki:
...
@@ -304,7 +306,7 @@ upload:packages:wiki:
# Send package
# Send package
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
${WIKI_ARCHIVE_PATH}
"${PACKAGE_URL_WIKI}";'
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
${WIKI_ARCHIVE_PATH}
"${PACKAGE_URL_WIKI}";'
rules
:
rules
:
-
if
:
'
$CI_COMMIT_
BRANCH
==
$CI_DEFAULT_BRANCH
||
$CI_COMMIT_BRANCH
=~
/^v[0-9]+(\.[0-9]+)*$/
'
-
if
:
'
$CI_COMMIT_
REF_PROTECTED
==
"true"
'
release:wiki
:
release:wiki
:
...
@@ -414,4 +416,4 @@ release:gitlab:
...
@@ -414,4 +416,4 @@ release:gitlab:
--header "JOB-TOKEN: $CI_JOB_TOKEN" \
--header "JOB-TOKEN: $CI_JOB_TOKEN" \
--request POST "${GITLAB_API_PROJECT_URL}/releases"
--request POST "${GITLAB_API_PROJECT_URL}/releases"
rules
:
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
==
$CI_DEFAULT_BRANCH
||
$CI_COMMIT_BRANCH
=~
/^v[0-9]+(\.[0-9]+)*$/'
-
if
:
'
$CI_COMMIT_REF_PROTECTED
==
"true"'
\ No newline at end of file
\ No newline at end of file
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