Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit e5b3c0e

Browse files
committed
Rename directory for base docker image and add release instructions
1 parent dceab06 commit e5b3c0e

File tree

14 files changed

+98
-4
lines changed

14 files changed

+98
-4
lines changed

.github/workflows/publish.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ on:
66
master
77

88
jobs:
9-
publish-check-queries-image:
9+
publish-codeql-learninglab-check:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v1
1414

1515
- name: Build and Publish Query Checking Docker Image
16-
run: cd check-queries && ./publish.sh
16+
run: cd codeql-learninglab-check && ./publish.sh
1717
env:
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1919
publish-courses-cpp-ctf-segv:
20-
needs: publish-check-queries-image
20+
needs: publish-codeql-learninglab-check
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout

CONTRIBUTING.md

+32-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,35 @@ Here are a few things you can do that will increase the likelihood of your pull
3131

3232
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
3333
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
34-
- [GitHub Help](https://help.github.com)
34+
- [GitHub Help](https://help.github.com)
35+
36+
## Updating and Releasing
37+
38+
### :whale: `codeql-learninglab-check` docker image
39+
40+
The top-level dependency is the
41+
[`codeql-learninglab-check`](codeql-learninglab-check) docker image.
42+
To update its dependencies,
43+
or release a new version of it,
44+
please see [the README for that docker image](codeql-learninglab-check).
45+
46+
### Courses included in the `courses/` directory
47+
48+
Following changes to the [`codeql-learninglab-check`](codeql-learninglab-check)
49+
base docker image,
50+
you'll likely want to update each of the individual courses to use the latest
51+
version.
52+
(This will be neccesary for users to take advantage of the latest changes to
53+
the CodeQL libraries or tools).
54+
You can do this by updating the `FROM` line in the respective `Dockerfile`.
55+
56+
Changes to the courses,
57+
including changes to the `Dockerfile`,
58+
the configuration,
59+
or any of the expected results `.csv` files are automatically published when
60+
pushes are made to `master`.
61+
This is done by the respective `publish.sh` file for each course.
62+
63+
We generally want to ensure that we always push the version `latest` so that
64+
changes can immediately be used by all course participants,
65+
and we don't need to update any references to versions elsewhere.
File renamed without changes.

codeql-learninglab-check/README.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# :whale: `codeql-learninglab-check`
2+
3+
This is the docker image used as the base for query-checking actions used by
4+
CodeQL Learning Lab courses,
5+
and it is [published to GitHub
6+
Packages](https://github.com/github/codeql-learninglab-actions/packages/95228).
7+
8+
## Usage
9+
10+
For instructions on how to use this docker image, please see
11+
[Creating your own course](../README.md#creating-your-own-course)
12+
in the main README.
13+
14+
## Architecture / Components
15+
16+
This docker image bundles a number of elements:
17+
18+
* **Dependency:** Some debian packages, importantly including Node v12.
19+
* **Dependency:** The CodeQL CLI binaries from
20+
[`codeql-cli-binaries`](https://github.com/github/codeql-cli-binaries/releases)
21+
* **Dependency:** A checkout of the [`Semmle/ql`](https://github.com/Semmle/ql)
22+
repository, pinned to a specific version.
23+
* The core action JavaScript/TypeScript code from [`package/`](package),
24+
and all its NPM dependencies.
25+
26+
## Updating the CodeQL dependencies
27+
28+
You will want to make sure that the versions of the CodeQL CLI and `Semmle/ql`
29+
are compatible.
30+
31+
* **Updating the CodeQL CLI**: Modify the URL for the CLI in
32+
[`Dockerfile`](Dockerfile).
33+
* **Updating the `Semmle/ql` repo**: Update the `RUN git checkout <ref>` line in
34+
[`Dockerfile`](Dockerfile) to a git sha / reference that is compatible with
35+
the version of the CodeQL CLI that is in use.
36+
37+
## Releasing
38+
39+
After making changes to any of the elements of this docker image,
40+
including the source code in `package/`,
41+
for courses to make use of these changes you need to make a release.
42+
43+
This repository has a GitHub Actions workflow configured on pushes to `master`
44+
to automatically publish the image
45+
using the script [`publish.sh`](publish.sh).
46+
It will check to see if an image has already been published for the current
47+
version,
48+
and if not it will build and publish the image automatically.
49+
So to publish a new version,
50+
simply change the `IMAGE_VERSION` variable in [`publish.sh`](publish.sh),
51+
and push to `master`.
52+
53+
**Note: it's probably best to avoid publishing to `latest` so that courses have
54+
to specify an explicit as their base images,
55+
so that courses won't break unexpectedly with breaking changes to this image**
56+
57+
### Updating downstream dependencies
58+
59+
Once you have updated this base image,
60+
you probably want to also update a number of the courses to use this updated
61+
image.
62+
63+
See the main [CONTRIBUTING.md](../CONTRIBUTING.md) file for more info.
File renamed without changes.

0 commit comments

Comments
 (0)