Fakultas Ilmu Komputer UI

Commit 9e0ffd17 authored by Daya Adianto's avatar Daya Adianto
Browse files

Merge branch '1-deploy' into 'master'

Setup CI pipeline to automate the build and deploy processes

See merge request !1
parents 2457f385 30701030
Pipeline #87220 failed with stages
in 2 minutes and 19 seconds
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file # top-most EditorConfig file
root = true root = true
...@@ -8,8 +6,8 @@ charset = utf-8 ...@@ -8,8 +6,8 @@ charset = utf-8
end_of_line = lf end_of_line = lf
indent_size = 4 indent_size = 4
indent_style = space indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true
[*.yml] [*.yml]
indent_size = 2 indent_size = 2
--- ---
default:
image: python:3.9-alpine
before_script:
- python --version && pip --version
- apk update && apk add --no-cache gcc musl-dev
- pip install --no-cache-dir "pipenv==2020.11.15"
- pipenv sync
variables: variables:
PIPENV_VENV_IN_PROJECT: 1 PIPENV_VERSION: 2021.5.29
PIPENV_VENV_IN_PROJECT: 'True'
# Use merge request pipeline
workflow:
rules:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
stages: stages:
- test - build
- package - deploy
check: # Use merge request pipeline
stage: test workflow:
rules: rules:
- allow_failure: true - if: '$CI_MERGE_REQUEST_IID'
script: - if: '$CI_COMMIT_TAG'
- pipenv check - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
--ignore 39462
# Ignore CVE #39462 until next version of Tornado and/or Python.
# See discussion at https://github.com/tornadoweb/tornado/issues/2981.
build:artifact: build:
stage: package stage: build
image: docker.io/python:3.9.7-alpine
before_script:
- pip install pipenv==${PIPENV_VERSION}
- unset PIPENV_VERSION
- pipenv sync
script: script:
- pipenv run mkdocs build - pipenv run mkdocs build
cache:
key:
files:
- Pipfile.lock
paths:
- .venv/
artifacts: artifacts:
name: $CI_JOB_NAME
paths: paths:
- site - site/
build:image: deploy:
stage: package stage: deploy
image: image: docker.io/alpine:3.14.2
name: gcr.io/kaniko-project/executor:v1.3.0-debug rules:
entrypoint: [""] - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
variables: needs:
IMAGE_TAG: latest - build
before_script: before_script:
- mv ${CSUI_REGISTRY_AUTH_FILE} /kaniko/.docker/config.json - apk add --no-cache openssh-client rsync
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- eval $(ssh-agent -s)
- echo "${SSH_PRIVATE_KEY}" | tr -d '\r' | ssh-add -
- echo "${SSH_KNOWN_HOSTS}" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script: script:
- /kaniko/executor - rsync -ahP site/ pmpl.cs.ui.ac.id:/var/www/html
--cache environment:
--cleanup name: production
--context ./ url: https://pmpl.cs.ui.ac.id
--destination registry.cs.ui.ac.id/pmpl/pmpl.cs.ui.ac.id:${IMAGE_TAG}
--destination registry.cs.ui.ac.id/pmpl/pmpl.cs.ui.ac.id:${CI_COMMIT_SHORT_SHA}
--dockerfile Dockerfile
--label org.opencontainers.image.revision=${CI_COMMIT_SHA}
--single-snapshot
--use-new-run
after_script:
- rm /kaniko/.docker/config.json
Attribution 4.0 International Attribution-ShareAlike 4.0 International
======================================================================= =======================================================================
...@@ -54,16 +54,18 @@ exhaustive, and do not form part of our licenses. ...@@ -54,16 +54,18 @@ exhaustive, and do not form part of our licenses.
======================================================================= =======================================================================
Creative Commons Attribution 4.0 International Public License Creative Commons Attribution-ShareAlike 4.0 International Public
License
By exercising the Licensed Rights (defined below), You accept and agree By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons to be bound by the terms and conditions of this Creative Commons
Attribution 4.0 International Public License ("Public License"). To the Attribution-ShareAlike 4.0 International Public License ("Public
extent this Public License may be interpreted as a contract, You are License"). To the extent this Public License may be interpreted as a
granted the Licensed Rights in consideration of Your acceptance of contract, You are granted the Licensed Rights in consideration of Your
these terms and conditions, and the Licensor grants You such rights in acceptance of these terms and conditions, and the Licensor grants You
consideration of benefits the Licensor receives from making the such rights in consideration of benefits the Licensor receives from
Licensed Material available under these terms and conditions. making the Licensed Material available under these terms and
conditions.
Section 1 -- Definitions. Section 1 -- Definitions.
...@@ -82,7 +84,11 @@ Section 1 -- Definitions. ...@@ -82,7 +84,11 @@ Section 1 -- Definitions.
and Similar Rights in Your contributions to Adapted Material in and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License. accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights c. BY-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative
Commons as essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation, closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or Rights, without regard to how the rights are labeled or
...@@ -90,29 +96,33 @@ Section 1 -- Definitions. ...@@ -90,29 +96,33 @@ Section 1 -- Definitions.
specified in Section 2(b)(1)-(2) are not Copyright and Similar specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights. Rights.
d. Effective Technological Measures means those measures that, in the e. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international Treaty adopted on December 20, 1996, and/or similar international
agreements. agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or f. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material. that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database, g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution and ShareAlike.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public or other material to which the Licensor applied this Public
License. License.
g. Licensed Rights means the rights granted to You subject to the i. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license. Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights j. Licensor means the individual(s) or entity(ies) granting rights
under this Public License. under this Public License.
i. Share means to provide material to the public by any means or k. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution, as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material dissemination, communication, or importation, and to make material
...@@ -120,13 +130,13 @@ Section 1 -- Definitions. ...@@ -120,13 +130,13 @@ Section 1 -- Definitions.
public may access the material from a place and at a time public may access the material from a place and at a time
individually chosen by them. individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright l. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases, the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world. equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights m. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning. under this Public License. Your has a corresponding meaning.
...@@ -172,7 +182,13 @@ Section 2 -- Scope. ...@@ -172,7 +182,13 @@ Section 2 -- Scope.
Licensed Rights under the terms and conditions of this Licensed Rights under the terms and conditions of this
Public License. Public License.
b. No downstream restrictions. You may not offer or impose b. Additional offer from the Licensor -- Adapted Material.
Every recipient of Adapted Material from You
automatically receives an offer from the Licensor to
exercise the Licensed Rights in the Adapted Material
under the conditions of the Adapter's License You apply.
c. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the Licensed Material if doing so restricts exercise of the
...@@ -254,9 +270,24 @@ following conditions. ...@@ -254,9 +270,24 @@ following conditions.
information required by Section 3(a)(1)(A) to the extent information required by Section 3(a)(1)(A) to the extent
reasonably practicable. reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's b. ShareAlike.
License You apply must not prevent recipients of the Adapted
Material from complying with this Public License. In addition to the conditions in Section 3(a), if You Share
Adapted Material You produce, the following conditions also apply.
1. The Adapter's License You apply must be a Creative Commons
license with the same License Elements, this version or
later, or a BY-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the
Adapter's License You apply. You may satisfy this condition
in any reasonable manner based on the medium, means, and
context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms
or conditions on, or apply any Effective Technological
Measures to, Adapted Material that restrict exercise of the
rights granted under the Adapter's License You apply.
Section 4 -- Sui Generis Database Rights. Section 4 -- Sui Generis Database Rights.
...@@ -271,8 +302,9 @@ apply to Your use of the Licensed Material: ...@@ -271,8 +302,9 @@ apply to Your use of the Licensed Material:
b. if You include all or a substantial portion of the database b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and Rights (but not its individual contents) is Adapted Material,
including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database. all or a substantial portion of the contents of the database.
......
...@@ -4,7 +4,7 @@ verify_ssl = true ...@@ -4,7 +4,7 @@ verify_ssl = true
name = "pypi" name = "pypi"
[packages] [packages]
mkdocs = "~=1.1" mkdocs = "~=1.2.3"
[dev-packages] [dev-packages]
......
This diff is collapsed.
# pmpl.cs.ui.ac.id Static Website # Software Quality Assurance Course Website
[![pipeline status](https://gitlab.cs.ui.ac.id/pmpl/pmpl.cs.ui.ac.id/badges/master/pipeline.svg)](https://gitlab.cs.ui.ac.id/pmpl/pmpl.cs.ui.ac.id/-/commits/master) [![pipeline status](https://gitlab.cs.ui.ac.id/pmpl/course-site/badges/master/pipeline.svg)](https://gitlab.cs.ui.ac.id/pmpl/course-site/-/commits/master)
TBD. ## Requirements
- Python >= 3.9
- [`pipenv`](https://pipenv.kennethreitz.org/en/latest/)
## Getting Started
Assuming `pipenv` present in the shell, create a new virtual environment and
download all of the required dependencies:
```shell
pipenv sync
```
Activate the virtual environment:
```shell
pipenv shell
```
To live preview the website:
```shell
mkdocs serve
```
Any new changes to the website can be previewed locally using the dev server.
To build the website:
```shell
mkdocs build
```
By default, the built website is written into `site` directory.
## License
Copyright (c) 2021 Faculty of Computer Science Universitas Indonesia.
This project is licensed under the Creative Commons Attribution-ShareAlike 4.0
International (CC BY-SA 4.0).
site_name: My Docs ---
site_name: Software Quality Assurance
site_description: >-
The website of Software Quality Assurance (SQA)/Penjaminan Mutu Perangkat
Lunak (PMPL) at the Faculty of Computer Science Universitas Indonesia
site_author: Daya Adianto
copyright: Copyright © 2021 Faculty of Computer Science Universitas Indonesia
repo_url: https://gitlab.cs.ui.ac.id/pmpl/course-site
repo_name: GitLab @ CSUI
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment